Bug 1880914 - Move BrowserFullScreen. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D206200
This commit is contained in:
@@ -124,7 +124,7 @@
|
||||
# in the middle of the fullscreen transition otherwise.
|
||||
oncommand="
|
||||
this.closest('panel').hidePopup();
|
||||
setTimeout(() => BrowserFullScreen(), 0);
|
||||
setTimeout(() => BrowserCommands.fullScreen(), 0);
|
||||
"
|
||||
tooltip="dynamic-shortcut-tooltip">
|
||||
<observes element="View:FullScreen" attribute="checked"/>
|
||||
|
||||
@@ -569,4 +569,8 @@ var BrowserCommands = {
|
||||
args
|
||||
);
|
||||
},
|
||||
|
||||
fullScreen() {
|
||||
window.fullScreen = !window.fullScreen || BrowserHandler.kiosk;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<command id="View:AboutProcesses" oncommand="switchToTabHavingURI('about:processes', true)"/>
|
||||
<command id="View:PageSource" oncommand="BrowserCommands.viewSource(window.gBrowser.selectedBrowser);"/>
|
||||
<command id="View:PageInfo" oncommand="BrowserCommands.pageInfo();"/>
|
||||
<command id="View:FullScreen" oncommand="BrowserFullScreen();"/>
|
||||
<command id="View:FullScreen" oncommand="BrowserCommands.fullScreen();"/>
|
||||
<command id="View:ReaderView" oncommand="AboutReaderParent.toggleReaderMode(event);"/>
|
||||
<command id="View:PictureInPicture" oncommand="PictureInPicture.onCommand(event);"/>
|
||||
<command id="cmd_find" oncommand="gLazyFindCommand('onFindCommand')"/>
|
||||
|
||||
@@ -3005,10 +3005,6 @@ function getDefaultHomePage() {
|
||||
return url;
|
||||
}
|
||||
|
||||
function BrowserFullScreen() {
|
||||
window.fullScreen = !window.fullScreen || BrowserHandler.kiosk;
|
||||
}
|
||||
|
||||
// TODO: can we pull getPEMString in from pippki.js instead of
|
||||
// duplicating them here?
|
||||
function getPEMString(cert) {
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
"BrowserOnClick",
|
||||
"getMeOutOfHere",
|
||||
"getDefaultHomePage",
|
||||
"BrowserFullScreen",
|
||||
"getPEMString",
|
||||
"browserDragAndDrop",
|
||||
"homeButtonObserver",
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
oncommand="FullScreen.setAutohide();"/>
|
||||
<menuitem contexttype="fullscreen"
|
||||
data-lazy-l10n-id="full-screen-exit"
|
||||
oncommand="BrowserFullScreen();"/>
|
||||
oncommand="BrowserCommands.fullScreen();"/>
|
||||
</menupopup>
|
||||
|
||||
<!-- bug 415444/582485: event.stopPropagation is here for the cloned version
|
||||
@@ -363,7 +363,7 @@
|
||||
oncommand="FullScreen.setAutohide();"/>
|
||||
<menuitem contexttype="fullscreen"
|
||||
data-lazy-l10n-id="full-screen-exit"
|
||||
oncommand="BrowserFullScreen();"/>
|
||||
oncommand="BrowserCommands.fullScreen();"/>
|
||||
</menupopup>
|
||||
|
||||
<menupopup id="blockedPopupOptions"
|
||||
|
||||
@@ -708,7 +708,7 @@ add_task(async function test_mousemove_correcttarget() {
|
||||
window,
|
||||
"sizemodechange"
|
||||
);
|
||||
BrowserFullScreen();
|
||||
BrowserCommands.fullScreen();
|
||||
await sizeModeChanged;
|
||||
await popupHiddenPromise;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ add_task(async function () {
|
||||
gBrowser.selectedBrowser,
|
||||
FS_CHANGE_SIZE
|
||||
);
|
||||
executeSoon(() => BrowserFullScreen());
|
||||
executeSoon(() => BrowserCommands.fullScreen());
|
||||
await fullscreenPromise;
|
||||
}
|
||||
});
|
||||
@@ -195,7 +195,7 @@ add_task(async function () {
|
||||
// dispatched synchronously, which would cause the event listener
|
||||
// miss that event and wait infinitely.
|
||||
fullscreenPromise = waitForFullscreenChanges(browser, FS_CHANGE_SIZE);
|
||||
executeSoon(() => BrowserFullScreen());
|
||||
executeSoon(() => BrowserCommands.fullScreen());
|
||||
contentStates = await fullscreenPromise;
|
||||
checkState({ inDOMFullscreen: false, inFullscreen: true }, contentStates);
|
||||
|
||||
@@ -228,7 +228,7 @@ add_task(async function () {
|
||||
if (window.fullScreen) {
|
||||
info("> Cleanup");
|
||||
fullscreenPromise = waitForFullscreenChanges(browser, FS_CHANGE_SIZE);
|
||||
executeSoon(() => BrowserFullScreen());
|
||||
executeSoon(() => BrowserCommands.fullScreen());
|
||||
await fullscreenPromise;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@ async function test() {
|
||||
await promiseTabLoadEvent(newBrowser.selectedTab, gHttpTestRoot + TEST_FILE);
|
||||
|
||||
// Enter browser fullscreen mode.
|
||||
newWin.BrowserFullScreen();
|
||||
newWin.BrowserCommands.fullScreen();
|
||||
|
||||
runNextTest();
|
||||
}
|
||||
|
||||
registerCleanupFunction(async function () {
|
||||
// Exit browser fullscreen mode.
|
||||
newWin.BrowserFullScreen();
|
||||
newWin.BrowserCommands.fullScreen();
|
||||
|
||||
await BrowserTestUtils.closeWindow(newWin);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ add_task(async function () {
|
||||
let fullScreenEntered = TestUtils.waitForCondition(
|
||||
() => document.documentElement.getAttribute("sizemode") == "fullscreen"
|
||||
);
|
||||
BrowserFullScreen();
|
||||
BrowserCommands.fullScreen();
|
||||
await fullScreenEntered;
|
||||
|
||||
tab2.linkedBrowser.focus();
|
||||
@@ -54,7 +54,7 @@ add_task(async function () {
|
||||
let fullScreenExited = TestUtils.waitForCondition(
|
||||
() => document.documentElement.getAttribute("sizemode") != "fullscreen"
|
||||
);
|
||||
BrowserFullScreen();
|
||||
BrowserCommands.fullScreen();
|
||||
await fullScreenExited;
|
||||
|
||||
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
data-l10n-id="browser-window-maximize-button"
|
||||
/>
|
||||
<toolbarbutton class="titlebar-button titlebar-restore"
|
||||
oncommand="window.fullScreen ? BrowserFullScreen() : window.restore();"
|
||||
oncommand="window.fullScreen ? BrowserCommands.fullScreen() : window.restore();"
|
||||
data-l10n-id="browser-window-restore-down-button"
|
||||
/>
|
||||
<toolbarbutton class="titlebar-button titlebar-close"
|
||||
|
||||
@@ -34,7 +34,7 @@ add_task(async function () {
|
||||
"Should not be in fullscreen sizemode before we enter fullscreen."
|
||||
);
|
||||
|
||||
BrowserFullScreen();
|
||||
BrowserCommands.fullScreen();
|
||||
await TestUtils.waitForCondition(() => isFullscreenSizeMode());
|
||||
ok(
|
||||
fullscreenButton.checked,
|
||||
@@ -62,7 +62,7 @@ add_task(async function () {
|
||||
|
||||
await endCustomizing();
|
||||
|
||||
BrowserFullScreen();
|
||||
BrowserCommands.fullScreen();
|
||||
fullscreenButton = document.getElementById("fullscreen-button");
|
||||
await TestUtils.waitForCondition(() => !isFullscreenSizeMode());
|
||||
ok(
|
||||
|
||||
Reference in New Issue
Block a user