зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1529931 - Avoid autofill flicker: Fix reflow performance tests. r=mconley
Replace a couple of popup methods so that they call dirtyFrame(), so that reflows happen deterministically. Differential Revision: https://phabricator.services.mozilla.com/D23734 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
674a2ade96
Коммит
66b8f1c131
|
@ -14,20 +14,6 @@
|
|||
|
||||
/* These reflows happen only the first time the panel opens. */
|
||||
const EXPECTED_REFLOWS_FIRST_OPEN = [
|
||||
// This is the this.panel.openPopup() call in UrlbarView._openPanel. See bug
|
||||
// 1359989, which was filed against the legacy awesomebar but applies here too
|
||||
// because it seems to be caused by platform code.
|
||||
{
|
||||
stack: [
|
||||
"_openPanel@resource:///modules/UrlbarView.jsm",
|
||||
"onQueryResults@resource:///modules/UrlbarView.jsm",
|
||||
"_notify@resource:///modules/UrlbarController.jsm",
|
||||
"receiveResults@resource:///modules/UrlbarController.jsm",
|
||||
"notifyResults@resource:///modules/UrlbarProvidersManager.jsm",
|
||||
"add@resource:///modules/UrlbarProvidersManager.jsm",
|
||||
"onSearchResult@resource:///modules/UrlbarProviderUnifiedComplete.jsm",
|
||||
],
|
||||
},
|
||||
{
|
||||
stack: [
|
||||
"__rebuild@chrome://browser/content/search/search-one-offs.js",
|
||||
|
@ -46,6 +32,15 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
|
|||
*/
|
||||
],
|
||||
},
|
||||
// This is the this.panel.openPopup() call in UrlbarView._openPanel. See bug
|
||||
// 1359989, which was filed against the legacy awesomebar but applies here too
|
||||
// because it seems to be caused by platform code.
|
||||
{
|
||||
stack: [
|
||||
"_openPanel@resource:///modules/UrlbarView.jsm",
|
||||
"onQueryResults@resource:///modules/UrlbarView.jsm",
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
add_task(async function quantumbar() {
|
||||
|
|
|
@ -14,17 +14,6 @@
|
|||
|
||||
/* These reflows happen only the first time the panel opens. */
|
||||
const EXPECTED_REFLOWS_FIRST_OPEN = [
|
||||
{
|
||||
stack: [
|
||||
"_openPanel@resource:///modules/UrlbarView.jsm",
|
||||
"onQueryResults@resource:///modules/UrlbarView.jsm",
|
||||
"_notify@resource:///modules/UrlbarController.jsm",
|
||||
"receiveResults@resource:///modules/UrlbarController.jsm",
|
||||
"notifyResults@resource:///modules/UrlbarProvidersManager.jsm",
|
||||
"add@resource:///modules/UrlbarProvidersManager.jsm",
|
||||
"onSearchResult@resource:///modules/UrlbarProviderUnifiedComplete.jsm",
|
||||
],
|
||||
},
|
||||
{
|
||||
stack: [
|
||||
"__rebuild@chrome://browser/content/search/search-one-offs.js",
|
||||
|
@ -43,6 +32,15 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
|
|||
*/
|
||||
],
|
||||
},
|
||||
// This is the this.panel.openPopup() call in UrlbarView._openPanel. See bug
|
||||
// 1359989, which was filed against the legacy awesomebar but applies here too
|
||||
// because it seems to be caused by platform code.
|
||||
{
|
||||
stack: [
|
||||
"_openPanel@resource:///modules/UrlbarView.jsm",
|
||||
"onQueryResults@resource:///modules/UrlbarView.jsm",
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
/* These reflows happen every time the panel opens. */
|
||||
|
@ -54,11 +52,6 @@ const EXPECTED_REFLOWS_SECOND_OPEN = [
|
|||
stack: [
|
||||
"_openPanel@resource:///modules/UrlbarView.jsm",
|
||||
"onQueryResults@resource:///modules/UrlbarView.jsm",
|
||||
"_notify@resource:///modules/UrlbarController.jsm",
|
||||
"receiveResults@resource:///modules/UrlbarController.jsm",
|
||||
"notifyResults@resource:///modules/UrlbarProvidersManager.jsm",
|
||||
"add@resource:///modules/UrlbarProvidersManager.jsm",
|
||||
"onSearchResult@resource:///modules/UrlbarProviderUnifiedComplete.jsm",
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
|
@ -693,6 +693,24 @@ async function runUrlbarTest(useAwesomebar,
|
|||
fn();
|
||||
}, ms);
|
||||
};
|
||||
} else {
|
||||
let popup = URLBar.view;
|
||||
let oldOnQueryResults = popup.onQueryResults.bind(popup);
|
||||
let oldOnQueryFinished = popup.onQueryFinished.bind(popup);
|
||||
|
||||
// We need to invalidate the frame tree outside of the normal
|
||||
// mechanism since invalidations and result additions to the
|
||||
// URL bar occur without firing JS events (which is how we
|
||||
// normally know to dirty the frame tree).
|
||||
popup.onQueryResults = (context) => {
|
||||
dirtyFrame(win);
|
||||
oldOnQueryResults(context);
|
||||
};
|
||||
|
||||
popup.onQueryFinished = (context) => {
|
||||
dirtyFrame(win);
|
||||
oldOnQueryFinished(context);
|
||||
};
|
||||
}
|
||||
|
||||
let waitExtra = async () => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче