Bug 1191148 - Don't count fullscreen request handled if we don't change the document state. r=smaug

--HG--
extra : source : 33ad58fdc763e3c6d647b6aec100d2ab9d893316
This commit is contained in:
Xidorn Quan 2015-08-06 15:37:48 +10:00
parent 7237b2a3ff
commit bf52d07f9d
2 changed files with 10 additions and 6 deletions

View File

@ -11650,8 +11650,9 @@ nsIDocument::HandlePendingFullscreenRequest(const FullscreenRequest& aRequest,
return false;
}
doc->ApplyFullscreen(aRequest);
*aHandled = true;
if (doc->ApplyFullscreen(aRequest)) {
*aHandled = true;
}
return true;
}
@ -11712,12 +11713,12 @@ ClearPendingFullscreenRequests(nsIDocument* aDoc)
}
}
void
bool
nsDocument::ApplyFullscreen(const FullscreenRequest& aRequest)
{
Element* elem = aRequest.GetElement();
if (!FullscreenElementReadyCheck(elem, aRequest.mIsCallerChrome)) {
return;
return false;
}
// Stash a reference to any existing fullscreen doc, we'll use this later
@ -11813,6 +11814,7 @@ nsDocument::ApplyFullscreen(const FullscreenRequest& aRequest)
for (uint32_t i = 0; i < changed.Length(); ++i) {
DispatchFullScreenChange(changed[changed.Length() - i - 1]);
}
return true;
}
NS_IMETHODIMP

View File

@ -1529,8 +1529,10 @@ protected:
void NotifyStyleSheetApplicableStateChanged();
// Apply the fullscreen state to the document, and trigger related events.
void ApplyFullscreen(const FullscreenRequest& aRequest);
// Apply the fullscreen state to the document, and trigger related
// events. It returns false if the fullscreen element ready check
// fails and nothing gets changed.
bool ApplyFullscreen(const FullscreenRequest& aRequest);
nsTArray<nsIObserver*> mCharSetObservers;