зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1488953 - Allows toolbar background paint flash along with the urlbar flickers on MacOSX in browser_windowopen.js. r=mconley
On MacOSX, especially on MacOS 10.10, the toolbar paint flush happens along with the urlbar flickers. Differential Revision: https://phabricator.services.mozilla.com/D34489 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
ec9ad7bde1
Коммит
6ce88e6013
|
@ -21,12 +21,14 @@ const EXPECTED_REFLOWS = [
|
||||||
// We'll assume the changes we are seeing are due to this focus change if
|
// We'll assume the changes we are seeing are due to this focus change if
|
||||||
// there are at least 5 areas that changed near the top of the screen, or if
|
// there are at least 5 areas that changed near the top of the screen, or if
|
||||||
// the toolbar background is involved on OSX, but will only ignore this once.
|
// the toolbar background is involved on OSX, but will only ignore this once.
|
||||||
function isLikelyFocusChange(rects) {
|
function filterLikelyFocusChange(rects) {
|
||||||
if (rects.length > 5 && rects.every(r => r.y2 < 100))
|
if (rects.length > 5 && rects.every(r => r.y2 < 100)) {
|
||||||
return true;
|
return [];
|
||||||
if (Services.appinfo.OS == "Darwin" && rects.length == 2 && rects.every(r => r.y1 == 0 && r.h == 33))
|
}
|
||||||
return true;
|
if (Services.appinfo.OS == "Darwin" && rects.length >= 2) {
|
||||||
return false;
|
return rects.filter(r => r.y1 != 0 || r.h != 33);
|
||||||
|
}
|
||||||
|
return rects;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -52,12 +54,15 @@ add_task(async function() {
|
||||||
filter(rects, frame, previousFrame) {
|
filter(rects, frame, previousFrame) {
|
||||||
// The first screenshot we get in OSX / Windows shows an unfocused browser
|
// The first screenshot we get in OSX / Windows shows an unfocused browser
|
||||||
// window for some reason. See bug 1445161.
|
// window for some reason. See bug 1445161.
|
||||||
if (!alreadyFocused && isLikelyFocusChange(rects)) {
|
if (!alreadyFocused) {
|
||||||
alreadyFocused = true;
|
alreadyFocused = true;
|
||||||
|
let filteredRects = filterLikelyFocusChange(rects);
|
||||||
|
if (rects !== filteredRects) {
|
||||||
todo(false,
|
todo(false,
|
||||||
"bug 1445161 - the window should be focused at first paint, " +
|
"bug 1445161 - the window should be focused at first paint, " +
|
||||||
rects.toSource());
|
rects.filter(r => !filteredRects.includes(r)).toSource());
|
||||||
return [];
|
}
|
||||||
|
return filteredRects;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rects;
|
return rects;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче