зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1191597 part 4 - Use inner width and height for check window state. r=smaug
Inner width and height are more reliable than outer ones. Change to outer ones may not trigger resize event on content process. --HG-- extra : source : b89ae9bc6e0675896a2a464f17eee5e0b8575909
This commit is contained in:
Родитель
8219338ba4
Коммит
1dac48d33e
|
@ -3,16 +3,16 @@
|
|||
// Note this only returns true once the transition from normal to
|
||||
// fullscreen mode is complete.
|
||||
function inFullscreenMode(win) {
|
||||
return win.outerWidth == win.screen.width &&
|
||||
win.outerHeight == win.screen.height;
|
||||
return win.innerWidth == win.screen.width &&
|
||||
win.innerHeight == win.screen.height;
|
||||
}
|
||||
|
||||
// Returns true if the window is in normal mode, i.e. non fullscreen mode.
|
||||
// Note this only returns true once the transition from fullscreen back to
|
||||
// normal mode is complete.
|
||||
function inNormalMode(win) {
|
||||
return win.outerWidth == win.normalSize.w &&
|
||||
win.outerHeight == win.normalSize.h;
|
||||
return win.innerWidth == win.normalSize.w &&
|
||||
win.innerHeight == win.normalSize.h;
|
||||
}
|
||||
|
||||
// Adds a listener that will be called once a fullscreen transition
|
||||
|
@ -30,8 +30,8 @@ function addFullscreenChangeContinuation(type, callback, inDoc) {
|
|||
// Remember the window size in non-fullscreen mode.
|
||||
if (!topWin.normalSize) {
|
||||
topWin.normalSize = {
|
||||
w: window.outerWidth,
|
||||
h: window.outerHeight
|
||||
w: window.innerWidth,
|
||||
h: window.innerHeight
|
||||
};
|
||||
}
|
||||
function checkCondition() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче