From 844fb17be9f7a3650cef647307c7f1826609b79d Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Tue, 1 Mar 2022 11:03:42 +0000 Subject: [PATCH] Bug 1607913 - Use Consolas instead of Courier New in Windows monospace font prefs. r=jfkthame A number of tests (and expectations) are updated here to either avoid accidentally relying on the size of Courier New on Windows, or to explicitly use Courier New instead of monospace, where it's harder to work out how to rewrite the test correctly. Differential Revision: https://phabricator.services.mozilla.com/D87222 --- .../test/browser_inplace-editor_maxwidth.js | 2 +- .../test/test_continuous_wheel_events.html | 2 +- layout/reftests/bidi/reftest.list | 2 +- layout/reftests/forms/input/text/reftest.list | 2 +- modules/libpref/init/all.js | 14 +++++------ .../css-pseudo/selection-input-011.html.ini | 1 + .../selection-textarea-011.html.ini | 7 +----- .../text-emphasis-style-008.html.ini | 4 ++++ .../line-break-anywhere-001.html.ini | 2 ++ ...ine-edge-white-space-collapse-001.html.ini | 3 --- .../css/css-ui/text-overflow-027.html.ini | 3 --- .../mouse-events/mousemove-between.html.ini | 1 - .../contain-layout-ink-overflow-013.html | 2 +- .../contain-layout-ink-overflow-014.html | 2 +- .../contain-layout-ink-overflow-017.html | 2 +- .../contain-layout-ink-overflow-013-ref.html | 2 +- .../contain-layout-ink-overflow-014-ref.html | 24 +++++++++++++++++++ .../masonry-align-tracks-multi-001-ref.html | 2 +- .../masonry-align-tracks-multi-001.html | 2 +- .../tentative/masonry-gap-001-ref.html | 2 +- .../masonry/tentative/masonry-gap-001.html | 2 +- .../masonry-justify-tracks-multi-001-ref.html | 2 +- .../masonry-justify-tracks-multi-001.html | 2 +- .../reference/webkit-line-clamp-036-ref.html | 4 ++-- .../css-overflow/webkit-line-clamp-036.html | 2 +- 25 files changed, 56 insertions(+), 37 deletions(-) create mode 100644 testing/web-platform/meta/css/css-text-decor/text-emphasis-style-008.html.ini create mode 100644 testing/web-platform/meta/css/css-text/line-break/line-break-anywhere-001.html.ini delete mode 100644 testing/web-platform/meta/css/css-text/white-space/line-edge-white-space-collapse-001.html.ini delete mode 100644 testing/web-platform/meta/css/css-ui/text-overflow-027.html.ini create mode 100644 testing/web-platform/tests/css/css-contain/reference/contain-layout-ink-overflow-014-ref.html diff --git a/devtools/client/shared/test/browser_inplace-editor_maxwidth.js b/devtools/client/shared/test/browser_inplace-editor_maxwidth.js index 5914d82a8a8a..5f88e9956382 100644 --- a/devtools/client/shared/test/browser_inplace-editor_maxwidth.js +++ b/devtools/client/shared/test/browser_inplace-editor_maxwidth.js @@ -10,7 +10,7 @@ const MAX_WIDTH = 300; const START_TEXT = "Start text"; const LONG_TEXT = "I am a long text and I will not fit in a 300px container. " + - "I expect the inplace editor to wrap."; + "I expect the inplace editor to wrap over more than two lines."; // Test the inplace-editor behavior with a maxWidth configuration option // defined. diff --git a/dom/events/test/test_continuous_wheel_events.html b/dom/events/test/test_continuous_wheel_events.html index e2be56c83379..ad149150fab4 100644 --- a/dom/events/test/test_continuous_wheel_events.html +++ b/dom/events/test/test_continuous_wheel_events.html @@ -9,7 +9,7 @@

-
+
Tere is a lot of text. Tere is a lot of text. Tere is a lot of text. Tere is a lot of text. Tere is a lot of text.
Tere is a lot of text. Tere is a lot of text. Tere is a lot of text. Tere is a lot of text. Tere is a lot of text.
diff --git a/layout/reftests/bidi/reftest.list b/layout/reftests/bidi/reftest.list index bb445c7f6ea1..9ce0ddc56efb 100644 --- a/layout/reftests/bidi/reftest.list +++ b/layout/reftests/bidi/reftest.list @@ -179,6 +179,6 @@ random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-3b-rtl.html bra == 1366623-1.html 1366623-1-ref.html random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 1426042-1.html 1426042-1-ref.html # Bug 1392106 == clone-intrinsic-size-bidi.html clone-intrinsic-size-bidi-ref.html -== slice-intrinsic-size-bidi.html slice-intrinsic-size-bidi-ref.html +fuzzy-if(winWidget,70-112,8-8) == slice-intrinsic-size-bidi.html slice-intrinsic-size-bidi-ref.html == 1556414-1.html 1556414-1-ref.html == 1567036-1.html 1567036-1-ref.html diff --git a/layout/reftests/forms/input/text/reftest.list b/layout/reftests/forms/input/text/reftest.list index 721bf66969fa..a328cb0e1827 100644 --- a/layout/reftests/forms/input/text/reftest.list +++ b/layout/reftests/forms/input/text/reftest.list @@ -1,6 +1,6 @@ == bounds-1.html bounds-1-ref.html fuzzy(0-65,0-3) == size-1.html size-1-ref.html -== size-2.html size-2-ref.html +fuzzy-if(winWidget,0-36,0-1) == size-2.html size-2-ref.html == baseline-1.html baseline-1-ref.html == chrome://reftest/content/forms/input/text/centering-1.xhtml chrome://reftest/content/forms/input/text/centering-1-ref.xhtml == chrome://reftest/content/forms/input/text/dynamic-height-1.xhtml chrome://reftest/content/forms/input/text/dynamic-height-1-ref.xhtml diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 0d9fb8c89c92..17c0689850bd 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -2662,17 +2662,17 @@ pref("font.size.monospace.x-math", 13); pref("font.name-list.serif.ar", "Times New Roman"); pref("font.name-list.sans-serif.ar", "Segoe UI, Tahoma, Arial"); - pref("font.name-list.monospace.ar", "Courier New"); + pref("font.name-list.monospace.ar", "Consolas"); pref("font.name-list.cursive.ar", "Comic Sans MS"); pref("font.name-list.serif.el", "Times New Roman"); pref("font.name-list.sans-serif.el", "Arial"); - pref("font.name-list.monospace.el", "Courier New"); + pref("font.name-list.monospace.el", "Consolas"); pref("font.name-list.cursive.el", "Comic Sans MS"); pref("font.name-list.serif.he", "Narkisim, David"); pref("font.name-list.sans-serif.he", "Arial"); - pref("font.name-list.monospace.he", "Fixed Miriam Transparent, Miriam Fixed, Rod, Courier New"); + pref("font.name-list.monospace.he", "Fixed Miriam Transparent, Miriam Fixed, Rod, Consolas, Courier New"); pref("font.name-list.cursive.he", "Guttman Yad, Ktav, Arial"); pref("font.name-list.serif.ja", "Yu Mincho, MS PMincho, MS Mincho, Meiryo, Yu Gothic, MS PGothic, MS Gothic"); @@ -2691,17 +2691,17 @@ pref("font.size.monospace.x-math", 13); pref("font.name-list.serif.x-cyrillic", "Times New Roman"); pref("font.name-list.sans-serif.x-cyrillic", "Arial"); - pref("font.name-list.monospace.x-cyrillic", "Courier New"); + pref("font.name-list.monospace.x-cyrillic", "Consolas"); pref("font.name-list.cursive.x-cyrillic", "Comic Sans MS"); pref("font.name-list.serif.x-unicode", "Times New Roman"); pref("font.name-list.sans-serif.x-unicode", "Arial"); - pref("font.name-list.monospace.x-unicode", "Courier New"); + pref("font.name-list.monospace.x-unicode", "Consolas"); pref("font.name-list.cursive.x-unicode", "Comic Sans MS"); pref("font.name-list.serif.x-western", "Times New Roman"); pref("font.name-list.sans-serif.x-western", "Arial"); - pref("font.name-list.monospace.x-western", "Courier New"); + pref("font.name-list.monospace.x-western", "Consolas"); pref("font.name-list.cursive.x-western", "Comic Sans MS"); pref("font.name-list.serif.zh-CN", "SimSun, MS Song, SimSun-ExtB"); @@ -2799,7 +2799,7 @@ pref("font.size.monospace.x-math", 13); pref("font.name-list.serif.x-math", "Latin Modern Math, STIX Two Math, XITS Math, Cambria Math, Libertinus Math, DejaVu Math TeX Gyre, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, STIXGeneral, DejaVu Serif, DejaVu Sans, Times New Roman"); pref("font.name-list.sans-serif.x-math", "Arial"); - pref("font.name-list.monospace.x-math", "Courier New"); + pref("font.name-list.monospace.x-math", "Consolas"); pref("font.name-list.cursive.x-math", "Comic Sans MS"); // ClearType tuning parameters for directwrite/d2d. diff --git a/testing/web-platform/meta/css/css-pseudo/selection-input-011.html.ini b/testing/web-platform/meta/css/css-pseudo/selection-input-011.html.ini index 53bf1a4ab143..47686227844a 100644 --- a/testing/web-platform/meta/css/css-pseudo/selection-input-011.html.ini +++ b/testing/web-platform/meta/css/css-pseudo/selection-input-011.html.ini @@ -1,6 +1,7 @@ [selection-input-011.html] expected: if os == "mac": PASS + if os == "win": PASS if os == "android" and non_native_theme: PASS FAIL bug: Test relies on on particular font metrics which are just right on Android. diff --git a/testing/web-platform/meta/css/css-pseudo/selection-textarea-011.html.ini b/testing/web-platform/meta/css/css-pseudo/selection-textarea-011.html.ini index 700fba21c13d..ef9a5eb081ca 100644 --- a/testing/web-platform/meta/css/css-pseudo/selection-textarea-011.html.ini +++ b/testing/web-platform/meta/css/css-pseudo/selection-textarea-011.html.ini @@ -1,7 +1,2 @@ [selection-textarea-011.html] - fuzzy: maxDifference=0-80;totalPixels=0-4 - expected: - if os == "linux": PASS - if os == "android": PASS - if os == "mac": PASS - FAIL + fuzzy: maxDifference=0-80;totalPixels=0-4 \ No newline at end of file diff --git a/testing/web-platform/meta/css/css-text-decor/text-emphasis-style-008.html.ini b/testing/web-platform/meta/css/css-text-decor/text-emphasis-style-008.html.ini new file mode 100644 index 000000000000..158d557ad4f3 --- /dev/null +++ b/testing/web-platform/meta/css/css-text-decor/text-emphasis-style-008.html.ini @@ -0,0 +1,4 @@ +[text-emphasis-style-008.html] + bug: Fuzz looks massive but it's just a dot antialiased differently + fuzzy: + if os == "win": maxDifference=0-47;totalPixels=0-54 diff --git a/testing/web-platform/meta/css/css-text/line-break/line-break-anywhere-001.html.ini b/testing/web-platform/meta/css/css-text/line-break/line-break-anywhere-001.html.ini new file mode 100644 index 000000000000..12791e4bcb17 --- /dev/null +++ b/testing/web-platform/meta/css/css-text/line-break/line-break-anywhere-001.html.ini @@ -0,0 +1,2 @@ +[line-break-anywhere-001.html] + fuzzy: maxDifference=0-184;totalPixels=0-8 diff --git a/testing/web-platform/meta/css/css-text/white-space/line-edge-white-space-collapse-001.html.ini b/testing/web-platform/meta/css/css-text/white-space/line-edge-white-space-collapse-001.html.ini deleted file mode 100644 index 788ae490e377..000000000000 --- a/testing/web-platform/meta/css/css-text/white-space/line-edge-white-space-collapse-001.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[line-edge-white-space-collapse-001.html] - expected: - [PASS, FAIL] diff --git a/testing/web-platform/meta/css/css-ui/text-overflow-027.html.ini b/testing/web-platform/meta/css/css-ui/text-overflow-027.html.ini deleted file mode 100644 index afed373a335b..000000000000 --- a/testing/web-platform/meta/css/css-ui/text-overflow-027.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[text-overflow-027.html] - expected: - if (os == "win"): FAIL diff --git a/testing/web-platform/meta/uievents/order-of-events/mouse-events/mousemove-between.html.ini b/testing/web-platform/meta/uievents/order-of-events/mouse-events/mousemove-between.html.ini index 215066aa4dc1..30bf44cd24e2 100644 --- a/testing/web-platform/meta/uievents/order-of-events/mouse-events/mousemove-between.html.ini +++ b/testing/web-platform/meta/uievents/order-of-events/mouse-events/mousemove-between.html.ini @@ -1,6 +1,5 @@ [mousemove-between.html] expected: if os == "mac": ERROR - if os == "win": ERROR [Mousemove events between elements should fire in the correct order.] expected: [PASS, FAIL] diff --git a/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-013.html b/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-013.html index d1431737352e..ca11f4208774 100644 --- a/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-013.html +++ b/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-013.html @@ -16,7 +16,7 @@ { font-family: monospace; font-size: 100px; - height: 2.8ch; + height: 3em; line-height: 1.5; /* computes to 150px */ width: 4ch; diff --git a/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-014.html b/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-014.html index ad1c94e16105..cbb752d625ec 100644 --- a/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-014.html +++ b/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-014.html @@ -7,7 +7,7 @@ - + diff --git a/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-017.html b/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-017.html index ebdcd04fcdbc..d6b6f83b3a5f 100644 --- a/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-017.html +++ b/testing/web-platform/tests/css/css-contain/contain-layout-ink-overflow-017.html @@ -7,7 +7,7 @@ - + diff --git a/testing/web-platform/tests/css/css-contain/reference/contain-layout-ink-overflow-013-ref.html b/testing/web-platform/tests/css/css-contain/reference/contain-layout-ink-overflow-013-ref.html index a2b75db3147c..27041414e4f1 100644 --- a/testing/web-platform/tests/css/css-contain/reference/contain-layout-ink-overflow-013-ref.html +++ b/testing/web-platform/tests/css/css-contain/reference/contain-layout-ink-overflow-013-ref.html @@ -11,7 +11,7 @@ { font-family: monospace; font-size: 100px; - height: 2.8ch; + height: 3em; overflow: scroll; width: 4ch; } diff --git a/testing/web-platform/tests/css/css-contain/reference/contain-layout-ink-overflow-014-ref.html b/testing/web-platform/tests/css/css-contain/reference/contain-layout-ink-overflow-014-ref.html new file mode 100644 index 000000000000..a2b75db3147c --- /dev/null +++ b/testing/web-platform/tests/css/css-contain/reference/contain-layout-ink-overflow-014-ref.html @@ -0,0 +1,24 @@ + + + + + CSS Reference Test + + + + + + + +

Test passes if there is no red. + +

diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-align-tracks-multi-001-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-align-tracks-multi-001-ref.html index 11ff5081ec1a..b0bf3578618d 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-align-tracks-multi-001-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-align-tracks-multi-001-ref.html @@ -9,7 +9,7 @@
supercalifragilisticexpialidocious - supercalifragi… + supercali…
diff --git a/testing/web-platform/tests/css/css-overflow/webkit-line-clamp-036.html b/testing/web-platform/tests/css/css-overflow/webkit-line-clamp-036.html index cc5fb5b13ede..b8d7b194f05d 100644 --- a/testing/web-platform/tests/css/css-overflow/webkit-line-clamp-036.html +++ b/testing/web-platform/tests/css/css-overflow/webkit-line-clamp-036.html @@ -8,7 +8,7 @@ display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - width: 150px; + width: 10ch; font: 16px / 32px monospace; background-color: yellow; padding: 4px;