mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1536781
, use the same paint suppression delay on mobile and desktop, r=emilio
Differential Revision: https://phabricator.services.mozilla.com//D24804 --HG-- extra : rebase_source : 5fcdd643e253dcad6ab2f0c94ed3addd48724249
This commit is contained in:
parent
d34f886b2d
commit
6143d2b90d
@ -56,11 +56,7 @@ typedef nsTHashtable<nsPtrHashKey<nsIFrame>> 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,
|
||||
|
@ -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");
|
||||
|
@ -1,4 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<style>
|
||||
body {
|
||||
height: 2000px;
|
||||
|
Loading…
Reference in New Issue
Block a user