diff --git a/layout/reftests/mathml/reftest.list b/layout/reftests/mathml/reftest.list deleted file mode 100644 index 0606464b18620..0000000000000 --- a/layout/reftests/mathml/reftest.list +++ /dev/null @@ -1,24 +0,0 @@ -# WARNING: This directory was used for MathML reftests and is only preserved for -# the ones that cannot be rewritten as web-platform-tests. -# If you want to add new tests for MathML, please instead consider adding them -# to `testing/web-platform/tests/mathml` (for MathML Core tests) or to -# `testing/web-platform/mozilla/tests/mathml/` (for Gecko-specific tests). - -# radicalbar*.html tests rely on reftest-zoom to verify the visibility of the -# radical bar at different zoom levels. There does not seem to be any equivalent -# way of testing that via WPT. See bug 1850661. -!= radicalbar-1.html about:blank -!= radicalbar-1a.html about:blank -!= radicalbar-1b.html about:blank -!= radicalbar-1c.html about:blank -!= radicalbar-1d.html about:blank -!= radicalbar-2.html about:blank -!= radicalbar-2a.html about:blank -!= radicalbar-2b.html about:blank -!= radicalbar-2c.html about:blank -!= radicalbar-2d.html about:blank -!= radicalbar-3.html about:blank -!= radicalbar-3a.html about:blank -!= radicalbar-3b.html about:blank -!= radicalbar-3c.html about:blank -!= radicalbar-3d.html about:blank diff --git a/layout/reftests/reftest.list b/layout/reftests/reftest.list index 9bdd99e75be89..9587c70798945 100644 --- a/layout/reftests/reftest.list +++ b/layout/reftests/reftest.list @@ -252,9 +252,6 @@ include line-breaking/reftest.list # list-item/ include list-item/reftest.list -# mathml/ -include mathml/reftest.list - # margin-collapsing include margin-collapsing/reftest.list diff --git a/testing/web-platform/mozilla/meta/infrastructure/reftest-zoom/clamp-full-zoom-001.html.ini b/testing/web-platform/mozilla/meta/infrastructure/reftest-zoom/clamp-full-zoom-001.html.ini new file mode 100644 index 0000000000000..961d8f37f4657 --- /dev/null +++ b/testing/web-platform/mozilla/meta/infrastructure/reftest-zoom/clamp-full-zoom-001.html.ini @@ -0,0 +1,2 @@ +[clamp-full-zoom-001.html] + prefs: [zoom.minPercent:50] diff --git a/testing/web-platform/mozilla/meta/infrastructure/reftest-zoom/clamp-full-zoom-002.html.ini b/testing/web-platform/mozilla/meta/infrastructure/reftest-zoom/clamp-full-zoom-002.html.ini new file mode 100644 index 0000000000000..fa35bd6413282 --- /dev/null +++ b/testing/web-platform/mozilla/meta/infrastructure/reftest-zoom/clamp-full-zoom-002.html.ini @@ -0,0 +1,2 @@ +[clamp-full-zoom-002.html] + prefs: [zoom.maxPercent:200] diff --git a/testing/web-platform/mozilla/tests/common/reftest-zoom.js b/testing/web-platform/mozilla/tests/common/reftest-zoom.js new file mode 100644 index 0000000000000..a20f2cc800ad7 --- /dev/null +++ b/testing/web-platform/mozilla/tests/common/reftest-zoom.js @@ -0,0 +1,29 @@ +// This JS file allows to emulate reftest-zoom. +// See https://firefox-source-docs.mozilla.org/layout/Reftest.html#zoom-tests-reftest-zoom-float + +// Retrieve reftest-zoom attribute. +const reftestZoom = "reftest-zoom"; +const root = document.documentElement; +if (!root.hasAttribute(reftestZoom)) { + throw new Error(`${reftestZoom} attribute not found on the root element.`); +} + +// Parse reftest-zoom value. +let zoom = parseFloat(root.getAttribute(reftestZoom)); +if (Number.isNaN(zoom)) { + throw new Error(`${reftestZoom} is not a float number.`); +} + +// Clamp reftest-zoom value. +let minZoom = SpecialPowers.getIntPref("zoom.minPercent") / 100; +let maxZoom = SpecialPowers.getIntPref("zoom.maxPercent") / 100; +zoom = Math.min(Math.max(zoom, minZoom), maxZoom); + +// Ensure the original zoom level is restored after the screenshot. +const originalZoom = SpecialPowers.getFullZoom(window); +window.addEventListener("beforeunload", () => { + SpecialPowers.setFullZoom(window, originalZoom); +}); + +// Set the zoom level to the specified value. +SpecialPowers.setFullZoom(window, zoom); diff --git a/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/clamp-full-zoom-001-ref.html b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/clamp-full-zoom-001-ref.html new file mode 100644 index 0000000000000..1b394e0d4f2d1 --- /dev/null +++ b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/clamp-full-zoom-001-ref.html @@ -0,0 +1,4 @@ + + +
+ diff --git a/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/clamp-full-zoom-001.html b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/clamp-full-zoom-001.html new file mode 100644 index 0000000000000..83fc95510f2ed --- /dev/null +++ b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/clamp-full-zoom-001.html @@ -0,0 +1,9 @@ + + + + + + + +
+ diff --git a/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/clamp-full-zoom-002-ref.html b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/clamp-full-zoom-002-ref.html new file mode 100644 index 0000000000000..e2dd42fc86f30 --- /dev/null +++ b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/clamp-full-zoom-002-ref.html @@ -0,0 +1,4 @@ + + +
+ diff --git a/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/clamp-full-zoom-002.html b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/clamp-full-zoom-002.html new file mode 100644 index 0000000000000..4fbe7edca1996 --- /dev/null +++ b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/clamp-full-zoom-002.html @@ -0,0 +1,9 @@ + + + + + + + +
+ diff --git a/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-001-ref.html b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-001-ref.html new file mode 100644 index 0000000000000..1b394e0d4f2d1 --- /dev/null +++ b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-001-ref.html @@ -0,0 +1,4 @@ + + +
+ diff --git a/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-001.html b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-001.html new file mode 100644 index 0000000000000..15c07de20d8b8 --- /dev/null +++ b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-001.html @@ -0,0 +1,8 @@ + + + + + + +
+ diff --git a/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-002-ref.html b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-002-ref.html new file mode 100644 index 0000000000000..e2dd42fc86f30 --- /dev/null +++ b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-002-ref.html @@ -0,0 +1,4 @@ + + +
+ diff --git a/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-002.html b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-002.html new file mode 100644 index 0000000000000..f5d5e6a777672 --- /dev/null +++ b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-002.html @@ -0,0 +1,8 @@ + + + + + + +
+ diff --git a/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-003-ref.html b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-003-ref.html new file mode 100644 index 0000000000000..ab500f2a2e7d2 --- /dev/null +++ b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-003-ref.html @@ -0,0 +1,4 @@ + + +
+ diff --git a/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-003.html b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-003.html new file mode 100644 index 0000000000000..b4bf803a896b6 --- /dev/null +++ b/testing/web-platform/mozilla/tests/infrastructure/reftest-zoom/set-full-zoom-003.html @@ -0,0 +1,9 @@ + + + + + +
+ diff --git a/testing/web-platform/mozilla/tests/mathml/README.md b/testing/web-platform/mozilla/tests/mathml/README.md index 9ef8f4bf407b1..d579f67987272 100644 --- a/testing/web-platform/mozilla/tests/mathml/README.md +++ b/testing/web-platform/mozilla/tests/mathml/README.md @@ -66,3 +66,5 @@ any specification: [whitespace trimming in token elements](https://www.w3.org/TR/MathML3/chapter2.html#fund.collapse) which is not described in the initial version of MathML Core. See [issue 149](https://github.com/w3c/mathml-core/issues/149). + +- `zoom`: Tests to check MathML rendering at different zoom levels. diff --git a/layout/reftests/mathml/radicalbar-1.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1.html similarity index 88% rename from layout/reftests/mathml/radicalbar-1.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1.html index 326164c0fa555..1882b78275316 100644 --- a/layout/reftests/mathml/radicalbar-1.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1.html @@ -1,13 +1,15 @@ - + + + diff --git a/layout/reftests/mathml/radicalbar-1a.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1a.html similarity index 84% rename from layout/reftests/mathml/radicalbar-1a.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1a.html index bf2e5147ae5fb..9d48a0971f9f5 100644 --- a/layout/reftests/mathml/radicalbar-1a.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1a.html @@ -1,13 +1,16 @@ - + + + + diff --git a/layout/reftests/mathml/radicalbar-1b.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1b.html similarity index 84% rename from layout/reftests/mathml/radicalbar-1b.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1b.html index a469943e79067..d72cb252c792a 100644 --- a/layout/reftests/mathml/radicalbar-1b.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1b.html @@ -1,13 +1,16 @@ - + + + + diff --git a/layout/reftests/mathml/radicalbar-1c.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1c.html similarity index 84% rename from layout/reftests/mathml/radicalbar-1c.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1c.html index 0485fe4136f24..d0708973f0ce1 100644 --- a/layout/reftests/mathml/radicalbar-1c.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1c.html @@ -1,13 +1,16 @@ - + + + + diff --git a/layout/reftests/mathml/radicalbar-1d.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1d.html similarity index 84% rename from layout/reftests/mathml/radicalbar-1d.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1d.html index f89db4ded3ac2..91004d1acd464 100644 --- a/layout/reftests/mathml/radicalbar-1d.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-1d.html @@ -1,13 +1,16 @@ - + + + + diff --git a/layout/reftests/mathml/radicalbar-2.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2.html similarity index 88% rename from layout/reftests/mathml/radicalbar-2.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2.html index 1870493cb4d64..2b5df8e97bfb0 100644 --- a/layout/reftests/mathml/radicalbar-2.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2.html @@ -1,13 +1,15 @@ - + + + diff --git a/layout/reftests/mathml/radicalbar-2a.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2a.html similarity index 84% rename from layout/reftests/mathml/radicalbar-2a.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2a.html index 9856fa868cd6c..33368521ad410 100644 --- a/layout/reftests/mathml/radicalbar-2a.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2a.html @@ -1,13 +1,16 @@ - + + + + diff --git a/layout/reftests/mathml/radicalbar-2b.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2b.html similarity index 84% rename from layout/reftests/mathml/radicalbar-2b.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2b.html index 7df074c40eab8..b88f094c79877 100644 --- a/layout/reftests/mathml/radicalbar-2b.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2b.html @@ -1,13 +1,16 @@ - + + + + diff --git a/layout/reftests/mathml/radicalbar-2c.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2c.html similarity index 84% rename from layout/reftests/mathml/radicalbar-2c.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2c.html index 138bad31ab0c7..b9c83c19a3f32 100644 --- a/layout/reftests/mathml/radicalbar-2c.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2c.html @@ -1,13 +1,16 @@ - + + + + diff --git a/layout/reftests/mathml/radicalbar-2d.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2d.html similarity index 84% rename from layout/reftests/mathml/radicalbar-2d.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2d.html index 7f128824224cc..836f12b4e98b1 100644 --- a/layout/reftests/mathml/radicalbar-2d.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-2d.html @@ -1,13 +1,16 @@ - + + + + diff --git a/layout/reftests/mathml/radicalbar-3.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3.html similarity index 88% rename from layout/reftests/mathml/radicalbar-3.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3.html index 12fa3ae050383..245a1d6b6b04a 100644 --- a/layout/reftests/mathml/radicalbar-3.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3.html @@ -1,13 +1,15 @@ - + + + diff --git a/layout/reftests/mathml/radicalbar-3a.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3a.html similarity index 84% rename from layout/reftests/mathml/radicalbar-3a.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3a.html index 24ebfec8e5ee9..30017437e5a47 100644 --- a/layout/reftests/mathml/radicalbar-3a.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3a.html @@ -1,13 +1,16 @@ - + + + + diff --git a/layout/reftests/mathml/radicalbar-3b.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3b.html similarity index 84% rename from layout/reftests/mathml/radicalbar-3b.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3b.html index 1aeafb6cb71ab..2f6ac92624bee 100644 --- a/layout/reftests/mathml/radicalbar-3b.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3b.html @@ -1,13 +1,16 @@ - + + + + diff --git a/layout/reftests/mathml/radicalbar-3c.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3c.html similarity index 84% rename from layout/reftests/mathml/radicalbar-3c.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3c.html index e9e7e7ae55329..5886cfeb63f14 100644 --- a/layout/reftests/mathml/radicalbar-3c.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3c.html @@ -1,13 +1,16 @@ - + + + + diff --git a/layout/reftests/mathml/radicalbar-3d.html b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3d.html similarity index 84% rename from layout/reftests/mathml/radicalbar-3d.html rename to testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3d.html index 7d780af44cd52..2802cb343e990 100644 --- a/layout/reftests/mathml/radicalbar-3d.html +++ b/testing/web-platform/mozilla/tests/mathml/zoom/radicalbar-3d.html @@ -1,13 +1,16 @@ - + + + +