diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h index 37fc49cc9c02..edbabeb98cc7 100644 --- a/layout/base/PresShell.h +++ b/layout/base/PresShell.h @@ -56,11 +56,7 @@ typedef nsTHashtable> VisibleFrames; // This is actually pref-controlled, but we use this value if we fail // to get the pref for any reason. -#ifdef MOZ_WIDGET_ANDROID -# define PAINTLOCK_EVENT_DELAY 250 -#else -# define PAINTLOCK_EVENT_DELAY 5 -#endif +#define PAINTLOCK_EVENT_DELAY 5 class PresShell final : public nsIPresShell, public nsISelectionController, diff --git a/mobile/android/tests/browser/chrome/test_settings_fontinflation.html b/mobile/android/tests/browser/chrome/test_settings_fontinflation.html index ca6edb7d3e8a..c12019921239 100644 --- a/mobile/android/tests/browser/chrome/test_settings_fontinflation.html +++ b/mobile/android/tests/browser/chrome/test_settings_fontinflation.html @@ -124,6 +124,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1328868 cleanupTabs(); }); + function waitForPaint(tab) { + return new Promise(function(resolve, reject) { + tab.browser.contentWindow.requestAnimationFrame(() => { + tab.browser.contentWindow.requestAnimationFrame(() => { + resolve(); + }); + }); + }); + } + add_task(async function test_fontInflationPrecedence() { // Check that we're starting out with the default values is(sharedPrefs.getBoolPref(ANDROID_PREF), false, "System font size scaling is disabled"); @@ -133,6 +143,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1328868 is(getSystemFontScale(), 1.0, "system font scale is default"); tab = BrowserApp.addTab(URL_desktop, { selected: true, parentId: BrowserApp.selectedTab.id }); await promiseBrowserEvent(tab.browser, "load"); + await waitForPaint(tab); + is(tab.browser.markupDocumentViewer.effectiveTextZoom, 1.0, "text zoom is default value"); @@ -143,6 +155,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1328868 tab.reloadWithMode(tab.desktopMode); await promiseBrowserEvent(tab.browser, "load"); + await waitForPaint(tab); let fontInflationOn = snapshotWindow(tab.browser.contentWindow); assertSnapshots(noZoom, fontInflationOn, false, null, "noZoom", "fontInflationOn"); @@ -151,6 +164,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1328868 setSystemFontScale(2.0); tab.reloadWithMode(tab.desktopMode); await promiseBrowserEvent(tab.browser, "load"); + await waitForPaint(tab); is(getSystemFontScale(), 2.0, "system font scale is enabled"); is(tab.browser.markupDocumentViewer.effectiveTextZoom, @@ -162,6 +176,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1328868 Services.prefs.setIntPref(GECKO_PREF_FONT_INFLATION, 0); tab.reloadWithMode(tab.desktopMode); await promiseBrowserEvent(tab.browser, "load"); + await waitForPaint(tab); is(tab.browser.markupDocumentViewer.effectiveTextZoom, 2.0, "text zoom set through system font scale zooming"); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html index d837b8f63f0e..073e0f6e06f9 100644 --- a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html @@ -1,4 +1,5 @@ +