Bug 1306696 part 2 - Ensure content document handles fullscreen request even if it becomes inactive. r=smaug

MozReview-Commit-ID: FBMe5V0L10v

--HG--
extra : rebase_source : 52797239461fbad4868cb7fdbde08dc5a6f66de4
extra : source : 09a13b337647b5f86326455b4dba185b5d32b30f
This commit is contained in:
Xidorn Quan 2016-10-06 10:48:32 +11:00
Родитель d139ff82fc
Коммит 4476a32d1b
1 изменённых файлов: 12 добавлений и 8 удалений

Просмотреть файл

@ -413,6 +413,18 @@ var FullScreen = {
// before transition.
PointerlockFsWarning.close();
// If it is a remote browser, send a message to ask the content
// to enter fullscreen state. We don't need to do so if it is an
// in-process browser, since all related document should have
// entered fullscreen state at this point.
// This should be done before the active tab check below to ensure
// that the content document handles the pending request. Doing so
// before the check is fine since we also check the activeness of
// the requesting document in content-side handling code.
if (this._isRemoteBrowser(aBrowser)) {
aBrowser.messageManager.sendAsyncMessage("DOMFullscreen:Entered");
}
// If we've received a fullscreen notification, we have to ensure that the
// element that's requesting fullscreen belongs to the browser that's currently
// active. If not, we exit fullscreen since the "full-screen document" isn't
@ -427,14 +439,6 @@ var FullScreen = {
return;
}
// If it is a remote browser, send a message to ask the content
// to enter fullscreen state. We don't need to do so if it is an
// in-process browser, since all related document should have
// entered fullscreen state at this point.
if (this._isRemoteBrowser(aBrowser)) {
aBrowser.messageManager.sendAsyncMessage("DOMFullscreen:Entered");
}
document.documentElement.setAttribute("inDOMFullscreen", true);
if (gFindBarInitialized) {