diff options
Diffstat (limited to 'testing/web-platform/mozilla/tests/mathml/fonts')
31 files changed, 3189 insertions, 0 deletions
diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/README b/testing/web-platform/mozilla/tests/mathml/fonts/README new file mode 100644 index 0000000000..ad19f66228 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/README @@ -0,0 +1,6 @@ +The fonts in this directory are autogenerated with FontForge using the Python +script generate.py. See the comments in that file for more information on how +to run the script. + +These fonts are intended to test the The MATH table and OpenType Features used +in MathML. See layout/reftests/mathml/ and layout/mathml/tests. diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/axis-height-1.otf b/testing/web-platform/mozilla/tests/mathml/fonts/axis-height-1.otf Binary files differnew file mode 100644 index 0000000000..2d6cc2fa0a --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/axis-height-1.otf diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/axis-height-2.otf b/testing/web-platform/mozilla/tests/mathml/fonts/axis-height-2.otf Binary files differnew file mode 100644 index 0000000000..fdb7c97ce0 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/axis-height-2.otf diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/default-font-ref.html b/testing/web-platform/mozilla/tests/mathml/fonts/default-font-ref.html new file mode 100644 index 0000000000..9917f14b6f --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/default-font-ref.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> + <head> + <title>default font</title> + <meta charset="utf-8"/> + </head> + <body style="font: 20px monospace;"> + + <math style="font-family: serif; font-size: 40px;"> + <mn>x-math language</mn> + </math> + + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/default-font.html b/testing/web-platform/mozilla/tests/mathml/fonts/default-font.html new file mode 100644 index 0000000000..6fead9cbce --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/default-font.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html> + <head> + <title>default font</title> + <meta charset="utf-8"/> + <link rel="match" href="default-font-ref.html"/> + </head> + <body style="font: 20px monospace;"> + + <!-- font.minimum-size.x-math set to 40 --> + <math> + <mn>x-math language</mn> + </math> + + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/dtls-1-ref.html b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-1-ref.html new file mode 100644 index 0000000000..61f5e9c2f6 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-1-ref.html @@ -0,0 +1,132 @@ +<!DOCTYPE html> +<head> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "dtls-1"; + src: url(dtls-1.otf); + } + math { + font-family: dtls-1; + } + </style> +</head> +<body> + <math> + <mover accent="true"> + <mn>b</mn> + <mn>c</mn> + </mover> + <munder accentunder="true"> + <mn>c</mn> + <mn>c</mn> + </munder> + <munderover accent="true" accentunder="true"> + <mn>b</mn> + <mn>c</mn> + <mn>c</mn> + </munderover> + </math> + + <p> + + <math> + <mover accent="true"> + <mover accent="true"> + <mn>b</mn> + <mn>b</mn> + </mover> + <mn>c</mn> + </mover> + <mover accent="true"> + <mover accent="true"> + <mn>b</mn> + <mn>b</mn> + </mover> + <mover accent="true"> + <mn>b</mn> + <mn>c</mn> + </mover> + </mover> + <munderover accent="true" accentunder="true"> + <munderover accent="true" accentunder="true"> + <mn>b</mn> + <mn>b</mn> + <mn>b</mn> + </munderover> + <mn>c</mn> + <mn>c</mn> + </munderover> + <munderover accent="true" accentunder="true"> + <munderover accent="true" accentunder="true"> + <mn>b</mn> + <mn>b</mn> + <mn>b</mn> + </munderover> + <munderover accent="true" accentunder="true"> + <mn>b</mn> + <mn>c</mn> + <mn>c</mn> + </munderover> + <munderover accent="true" accentunder="true"> + <mn>b</mn> + <mn>c</mn> + <mn>c</mn> + </munderover> + </munderover> + </math> + + <p> + + <math> + <mover accent="true"> + <mn>c</mn> + <mn>c</mn> + </mover> + <munder accentunder="true"> + <mn>c</mn> + <mn>c</mn> + </munder> + <munderover accent="true" accentunder="true"> + <mn>c</mn> + <mn>c</mn> + <mn>c</mn> + </munderover> + </math> + + <p> + + <math> + <mover accent="false"> + <mn>c</mn> + <mn>c</mn> + </mover> + <munderover accent="false" accentunder="false"> + <mn>c</mn> + <mn>c</mn> + <mn>c</mn> + </munderover> + </math> + + <p> + + <math> + <mover> + <mo movablelimits="true">c</mo> + <mo>c</mo> + </mover> + <munderover> + <mo movablelimits="true">c</mo> + <mo>c</mo> + <mo>c</mo> + </munderover> + <mover accent="true"> + <mo movablelimits="true">c</mo> + <mo>c</mo> + </mover> + <munderover accent="true"> + <mo movablelimits="true">c</mo> + <mo>c</mo> + <mo>c</mo> + </munderover> + </math> +</body> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/dtls-1.html b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-1.html new file mode 100644 index 0000000000..4e76a658e7 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-1.html @@ -0,0 +1,135 @@ +<!DOCTYPE html> +<head> + <link rel="match" href="dtls-1-ref.html"/> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "dtls-1"; + src: url(dtls-1.otf); + } + math { + font-family: dtls-1; + } + </style> +</head> +<body> + <math> + <mover accent="true"> + <mn>a</mn> + <mn>a</mn> + </mover> + <munder accentunder="true"> + <mn>a</mn> + <mn>a</mn> + </munder> + <munderover accent="true" accentunder="true"> + <mn>a</mn> + <mn>a</mn> + <mn>a</mn> + </munderover> + </math> + + <p> + + <math> + <mover accent="true"> + <mover accent="true"> + <mn>a</mn> + <mn>a</mn> + </mover> + <mn>a</mn> + </mover> + <mover accent="true"> + <mover accent="true"> + <mn>a</mn> + <mn>a</mn> + </mover> + <mover accent="true"> + <mn>a</mn> + <mn>a</mn> + </mover> + </mover> + <munderover accent="true" accentunder="true"> + <munderover accent="true" accentunder="true"> + <mn>a</mn> + <mn>a</mn> + <mn>a</mn> + </munderover> + <mn>a</mn> + <mn>a</mn> + </munderover> + <munderover accent="true" accentunder="true"> + <munderover accent="true" accentunder="true"> + <mn>a</mn> + <mn>a</mn> + <mn>a</mn> + </munderover> + <munderover accent="true" accentunder="true"> + <mn>a</mn> + <mn>a</mn> + <mn>a</mn> + </munderover> + <munderover accent="true" accentunder="true"> + <mn>a</mn> + <mn>a</mn> + <mn>a</mn> + </munderover> + </munderover> + </math> + + <p> + + <math> + <mstyle style="font-feature-settings: 'dtls' 0"> + <mover accent="true"> + <mn>a</mn> + <mn>a</mn> + </mover> + <munder accentunder="true"> + <mn>a</mn> + <mn>a</mn> + </munder> + <munderover accent="true" accentunder="true"> + <mn>a</mn> + <mn>a</mn> + <mn>a</mn> + </munderover> + </mstyle> + </math> + + <p> + + <math> + <mover accent="false"> + <mn>a</mn> + <mn>a</mn> + </mover> + <munderover accent="false" accentunder="false"> + <mn>a</mn> + <mn>a</mn> + <mn>a</mn> + </munderover> + </math> + + <p> + + <math> + <mover> + <mo movablelimits="true">a</mo> + <mo>a</mo> + </mover> + <munderover> + <mo movablelimits="true">a</mo> + <mo>a</mo> + <mo>a</mo> + </munderover> + <mover accent="true"> + <mo movablelimits="true">a</mo> + <mo>a</mo> + </mover> + <munderover accent="true"> + <mo movablelimits="true">a</mo> + <mo>a</mo> + <mo>a</mo> + </munderover> + </math> +</body> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/dtls-1.otf b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-1.otf Binary files differnew file mode 100644 index 0000000000..1ffbe24427 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-1.otf diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/dtls-2-ref.html b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-2-ref.html new file mode 100644 index 0000000000..49342c1aa7 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-2-ref.html @@ -0,0 +1,175 @@ +<!DOCTYPE html> +<html> + <head> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "dtls-1"; + src: url(dtls-1.otf); + } + </style> + </head> + <body> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo>b</mo> + <mo>c</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo>b</mo> + <mo>c</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo>a</mo> + <!-- deliberately invalid --> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mo>c</mo> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mover accent="true"> + <mn>a</mn> + <mn>a</mn> + </mover> + <mover accent="true"> + <mn>a</mn> + <mn>a</mn> + </mover> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mrow> + <mrow> + <mrow> + <mo>b</mo> + </mrow> + </mrow> + </mrow> + <mo>c</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style ="font-family: 'dtls-1';"> + <mover accent="true"> + <mover accent="true"> + <mo>b</mo> + <mo>c</mo> + </mover> + <mover accent="true"> + <mo>b</mo> + <mo>c</mo> + </mover> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle id="mstyle5" style ="font-family: 'dtls-1'; font-feature-settings: 'dtls' 0"> + <mover accent="true"> + <mover accent="true"> + <mo>c</mo> + <mo>c</mo> + </mover> + <mover accent="true"> + <mo>c</mo> + <mo>c</mo> + </mover> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover id="mover1" accent="true"> + <mo>b</mo> + <mo>c</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="false" id="mover2"> + <mo>c</mo> + <mo>c</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover id="mover3"> + <mo>c</mo> + <mo>c</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo movablelimits="true">c</mo> + <mo>c</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo>b</mo> + <mo>c</mo> + </mover> + </mstyle> + </math> + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/dtls-2.html b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-2.html new file mode 100644 index 0000000000..63a42d4a22 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-2.html @@ -0,0 +1,214 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <link rel="match" href="dtls-2-ref.html"/> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "dtls-1"; + src: url(dtls-1.otf); + } + </style> + </head> + <body> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true" id="mover0"> + <mo>a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo>a</mo> + <mo id="mo0"></mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo>a</mo> + <mo id="mo1">a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';" id="mstyle0"> + </mstyle> + </math> + + <p> + + <math> + <mstyle id="mstyle1"> + <mover accent="true"> + <mover accent="true"> + <mn>a</mn> + <mn>a</mn> + </mover> + <mover accent="true"> + <mn>a</mn> + <mn>a</mn> + </mover> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mrow> + <mrow> + <mrow id="mrow0"> + </mrow> + </mrow> + </mrow> + <mo>a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle id="mstyle4" style ="font-family: 'dtls-1'; font-feature-settings: 'dtls' 0"> + <mover accent="true"> + <mover accent="true"> + <mo>a</mo> + <mo>a</mo> + </mover> + <mover accent="true"> + <mo>a</mo> + <mo>a</mo> + </mover> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle id="mstyle5" style ="font-family: 'dtls-1';"> + <mover accent="true"> + <mover accent="true"> + <mo>a</mo> + <mo>a</mo> + </mover> + <mover accent="true"> + <mo>a</mo> + <mo>a</mo> + </mover> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover id="mover1"> + <mo>a</mo> + <mo>a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true" id="mover2"> + <mo>a</mo> + <mo>a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true" id="mover3"> + <mo>a</mo> + <mo>a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo id="mo2">a</mo> + <mo>a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo id="mo3" movablelimits="true">a</mo> + <mo>a</mo> + </mover> + </mstyle> + </math> + + <script> + function doTest() + { + var mo = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mo"); + mo.innerHTML = "a"; + // An added child gets dtls font feature + document.getElementById("mover0").appendChild(mo); + // A child with changed text gets dtls font feature + document.getElementById("mo0").innerHTML = "a"; + // A relocated child loses dtls font feature setting + document.getElementById("mstyle0").appendChild(document.getElementById("mo1")); + // A change in style + document.getElementById("mstyle1").setAttribute("style", "font-family: 'dtls-1';"); + + // dtls gets added to descendants as well + var mo1 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mo"); + mo1.innerHTML = "a"; + document.getElementById("mrow0").appendChild(mo1); + // removing explicit dtls setting works + document.getElementById("mstyle4").setAttribute( + "style", "font-family: 'dtls-1';") + // setting an explicit dtls font feature + document.getElementById("mstyle5").setAttribute( + "style" , "font-family: 'dtls-1'; font-feature-settings: 'dtls' 0"); + + // Adding accent="true" applies dtls font feature + document.getElementById("mover1").setAttribute("accent", "true"); + // Changing accent="true" to false removes dtls font feature + document.getElementById("mover2").setAttribute("accent", "false"); + // Removing accent="true" removes dtls font feature + document.getElementById("mover3").removeAttribute("accent"); + + // Movablelimits disables dtls font feature + document.getElementById("mo2").setAttribute("movablelimits", "true"); + // Removing movablelimits restores dtls font feature + document.getElementById("mo3").removeAttribute("movablelimits"); + + document.documentElement.removeAttribute("class"); + } + document.documentElement.addEventListener("TestRendered", doTest); + </script> + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/dtls-3-ref.html b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-3-ref.html new file mode 100644 index 0000000000..ce5e5c6122 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-3-ref.html @@ -0,0 +1,175 @@ +<!DOCTYPE html> +<html> + <head> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "dtls-1"; + src: url(dtls-1.otf); + } + </style> + </head> + <body> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo>𝔟</mo> + <mo>𝔠</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo>𝔟</mo> + <mo>𝔠</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo mathvariant="fraktur">a</mo> + <!-- deliberately invalid --> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mo>𝔠</mo> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mover accent="true"> + <mo>𝔟</mo> + <mo>𝔟</mo> + </mover> + <mover accent="true"> + <mo>𝔟</mo> + <mo>𝔠</mo> + </mover> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mrow> + <mrow> + <mrow> + <mo>𝔟</mo> + </mrow> + </mrow> + </mrow> + <mo>𝔠</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style ="font-family: 'dtls-1';"> + <mover accent="true"> + <mover accent="true"> + <mo>𝔟</mo> + <mo>𝔠</mo> + </mover> + <mover accent="true"> + <mo>𝔟</mo> + <mo>𝔠</mo> + </mover> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle id="mstyle5" style ="font-family: 'dtls-1'; font-feature-settings: 'dtls' 0"> + <mover accent="true"> + <mover accent="true"> + <mo>𝔠</mo> + <mo>𝔠</mo> + </mover> + <mover accent="true"> + <mo>𝔠</mo> + <mo>𝔠</mo> + </mover> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover id="mover1" accent="true"> + <mo>𝔟</mo> + <mo>𝔠</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="false" id="mover2"> + <mo>𝔠</mo> + <mo>𝔠</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover id="mover3"> + <mo>𝔠</mo> + <mo>𝔠</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo>𝔞</mo> + <mo>c</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo>b</mo> + <mo>c</mo> + </mover> + </mstyle> + </math> + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/dtls-3.html b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-3.html new file mode 100644 index 0000000000..50eb56b28f --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/dtls-3.html @@ -0,0 +1,217 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <link rel="match" href="dtls-3-ref.html"/> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "dtls-1"; + src: url(dtls-1.otf); + } + </style> + </head> + <body> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true" id="mover0"> + <mo mathvariant="fraktur">a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo mathvariant="fraktur">a</mo> + <mo mathvariant="fraktur" id="mo0"></mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo mathvariant="fraktur">a</mo> + <mo mathvariant="fraktur" id="mo1">a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';" id="mstyle0"> + </mstyle> + </math> + + <p> + + <math> + <mstyle id="mstyle1"> + <mover accent="true"> + <mover accent="true"> + <mn mathvariant="fraktur">a</mn> + <mn mathvariant="fraktur">a</mn> + </mover> + <mover accent="true"> + <mn mathvariant="fraktur">a</mn> + <mn mathvariant="fraktur">a</mn> + </mover> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mrow> + <mrow> + <mrow id="mrow0"> + </mrow> + </mrow> + </mrow> + <mo mathvariant="fraktur">a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle id="mstyle4" style ="font-family: 'dtls-1'; font-feature-settings: 'dtls' 0"> + <mover accent="true"> + <mover accent="true"> + <mo mathvariant="fraktur">a</mo> + <mo mathvariant="fraktur">a</mo> + </mover> + <mover accent="true"> + <mo mathvariant="fraktur">a</mo> + <mo mathvariant="fraktur">a</mo> + </mover> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle id="mstyle5" style ="font-family: 'dtls-1';"> + <mover accent="true"> + <mover accent="true"> + <mo mathvariant="fraktur">a</mo> + <mo mathvariant="fraktur">a</mo> + </mover> + <mover accent="true"> + <mo mathvariant="fraktur">a</mo> + <mo mathvariant="fraktur">a</mo> + </mover> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover id="mover1"> + <mo mathvariant="fraktur">a</mo> + <mo mathvariant="fraktur">a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true" id="mover2"> + <mo mathvariant="fraktur">a</mo> + <mo mathvariant="fraktur">a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true" id="mover3"> + <mo mathvariant="fraktur">a</mo> + <mo mathvariant="fraktur">a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo id="mo2">a</mo> + <mo>a</mo> + </mover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'dtls-1';"> + <mover accent="true"> + <mo mathvariant="fraktur" id="mo3">a</mo> + <mo>a</mo> + </mover> + </mstyle> + </math> + + <script> + function doTest() + { + var mo = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mo"); + mo.innerHTML = "a"; + mo.setAttribute("mathvariant", "fraktur"); + // An added child gets dtls font feature + document.getElementById("mover0").appendChild(mo); + // A child with changed text gets dtls font feature + document.getElementById("mo0").innerHTML = "a"; + // A relocated child loses dtls font feature setting + document.getElementById("mstyle0").appendChild(document.getElementById("mo1")); + // A change in style + document.getElementById("mstyle1").setAttribute("style", "font-family: 'dtls-1';"); + + // dtls gets added to descendants as well + var mo1 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mo"); + mo1.innerHTML = "a"; + mo1.setAttribute("mathvariant", "fraktur"); + document.getElementById("mrow0").appendChild(mo1); + // removing explicit dtls setting works + document.getElementById("mstyle4").setAttribute( + "style", "font-family: 'dtls-1';") + // setting an explicit dtls font feature + document.getElementById("mstyle5").setAttribute( + "style" , "font-family: 'dtls-1'; font-feature-settings: 'dtls' 0"); + + // Adding accent="true" applies dtls font feature + document.getElementById("mover1").setAttribute("accent", "true"); + // Changing accent="true" to false removes dtls font feature + document.getElementById("mover2").setAttribute("accent", "false"); + // Removing accent="true" removes dtls font feature + document.getElementById("mover3").removeAttribute("accent"); + + // dtls applies when mathvariant is set + document.getElementById("mo2").setAttribute("mathvariant", "fraktur"); + + // dtls still applies when mathvariant is removed + document.getElementById("mo3").removeAttribute("mathvariant"); + + document.documentElement.removeAttribute("class"); + } + document.documentElement.addEventListener("TestRendered", doTest); + </script> + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/font-inflation-1-ref.html b/testing/web-platform/mozilla/tests/mathml/fonts/font-inflation-1-ref.html new file mode 100644 index 0000000000..a7716454ec --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/font-inflation-1-ref.html @@ -0,0 +1,74 @@ +<!DOCTYPE html> +<html> + <head> + <title>Font Inflation</title> + <meta charset="utf-8"/> + <style> + @font-face { + font-family: "dtls-1"; + src: url(dtls-1.otf); + } + p, math { + font-family: serif; + } + </style> + </head> + <body> + +<p>The text +'<math> + <mrow id="ref"> + <mtext style="font-family: dtls-1">𝔞</mtext> + <mtext>+</mtext> + </mrow> + </math>' +should have the same size as inline math +'<math> + <mrow id="inline"> + <mtext style="font-family: dtls-1">𝔞<!-- MATHEMATICAL FRAKTUR SMALL A--></mtext> + <mo>+</mo> + </mrow> + </math>' +or math in a table: '<math><mtable><mtr> + <mtd> + <mrow id="cell"> + <mtext style="font-family: dtls-1">𝔞<!-- MATHEMATICAL FRAKTUR SMALL A--></mtext> + <mo>+</mo> + </mrow> + </mtd> + </mtr></mtable></math>' +(but not necessarily the same size as block-level math +<math display="block"> + <mrow id="display"> + <mtext style="font-family: dtls-1">𝔞<!-- MATHEMATICAL FRAKTUR SMALL A--></mtext> + <mo>+</mo> + </mrow> + </math> +because it forms a BFC and hence is its own inflation container.) +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod +tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, +quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo +consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse +cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non +proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem +ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor +incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis +nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore +eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt +in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor +sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut +labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis +aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu +fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in +culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit +amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore +et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation +ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor +in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui +officia deserunt mollit anim id est laborum.</p> + + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/font-inflation-1.html b/testing/web-platform/mozilla/tests/mathml/fonts/font-inflation-1.html new file mode 100644 index 0000000000..3af93b2fc1 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/font-inflation-1.html @@ -0,0 +1,108 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <head> + <title>Font Inflation</title> + <meta charset="utf-8"/> + <link rel="match" href="font-inflation-1-ref.html"/> + <style> + @font-face { + font-family: "dtls-1"; + src: url(dtls-1.otf); + } + p, math { + font-family: serif; + } + </style> + <script type="text/javascript"> + function almostEqual(aX, aY) { + var epsilon = 2.6; + return Math.abs(aX - aY) < epsilon; + } + + function verifySize(aElement, aReference) { + /* Verify if the size of the element matches the reference, and + otherwise paint the element in red. */ + if (!almostEqual(aElement.getBoundingClientRect().height, + aReference.getBoundingClientRect().height) || + !almostEqual(aElement.getBoundingClientRect().width, + aReference.getBoundingClientRect().width)) { + aElement.setAttribute("mathcolor", "red"); + } + } + + function verifySizes() { + /* Compare the size of the elements in the inline and display equations + against the reference mtext elements. */ + var ref = document.getElementById("ref"); + var inline = document.getElementById("inline"); + var cell = document.getElementById("cell"); + for (var i = 0; i < ref.children.length; i++) { + verifySize(inline.children[i], ref.children[i]); + verifySize(cell.children[i], ref.children[i]); + } + + document.documentElement.removeAttribute("class"); + } + + document.documentElement.addEventListener("TestRendered", verifySizes); + </script> + </head> + <body> + +<p>The text +'<math> + <mrow id="ref"> + <mtext style="font-family: dtls-1">𝔞</mtext> + <mtext>+</mtext> + </mrow> + </math>' +should have the same size as inline math +'<math> + <mrow id="inline"> + <mtext style="font-family: dtls-1">𝔞<!-- MATHEMATICAL FRAKTUR SMALL A--></mtext> + <mo>+</mo> + </mrow> + </math>' +or math in a table: '<math><mtable><mtr> + <mtd> + <mrow id="cell"> + <mtext style="font-family: dtls-1">𝔞<!-- MATHEMATICAL FRAKTUR SMALL A--></mtext> + <mo>+</mo> + </mrow> + </mtd> + </mtr></mtable></math>' +(but not necessarily the same size as block-level math +<math display="block"> + <mrow id="display"> + <mtext style="font-family: dtls-1">𝔞<!-- MATHEMATICAL FRAKTUR SMALL A--></mtext> + <mo>+</mo> + </mrow> + </math> +because it forms a BFC and hence is its own inflation container.) +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod +tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, +quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo +consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse +cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non +proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem +ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor +incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis +nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore +eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt +in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor +sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut +labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud +exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis +aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu +fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in +culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit +amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore +et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation +ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor +in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui +officia deserunt mollit anim id est laborum.</p> + + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/generate.py b/testing/web-platform/mozilla/tests/mathml/fonts/generate.py new file mode 100644 index 0000000000..6f5008c898 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/generate.py @@ -0,0 +1,320 @@ +#!/usr/bin/python +# vim: set shiftwidth=4 tabstop=8 autoindent expandtab: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# For general fontforge documentation, see: +# http://fontforge.sourceforge.net/ +# For fontforge scripting documentation, see: +# http://fontforge.sourceforge.net/scripting-tutorial.html +# http://fontforge.sourceforge.net/scripting.html +# and most importantly: +# http://fontforge.sourceforge.net/python.html + +# To install what you need, on Ubuntu, +# sudo apt-get install python-fontforge + +import fontforge + +em = 1000 + + +def newMathFont(aName): + print("Generating %s.otf..." % aName, end="") + mathFont = fontforge.font() + mathFont.fontname = aName + mathFont.familyname = aName + mathFont.fullname = aName + mathFont.copyright = "Copyright (c) 2014 Mozilla Corporation" + mathFont.encoding = "UnicodeFull" + + # Create a space character. Also force the creation of some MATH subtables + # so that OTS will not reject the MATH table. + g = mathFont.createChar(ord(" "), "space") + g.width = em + g.italicCorrection = 0 + g.topaccent = 0 + g.mathKern.bottomLeft = tuple([(0, 0)]) + g.mathKern.bottomRight = tuple([(0, 0)]) + g.mathKern.topLeft = tuple([(0, 0)]) + g.mathKern.topRight = tuple([(0, 0)]) + mathFont[ord(" ")].horizontalVariants = "space" + mathFont[ord(" ")].verticalVariants = "space" + return mathFont + + +def saveMathFont(aFont): + aFont.em = em + aFont.ascent = aFont.descent = em / 2 + aFont.hhea_ascent = aFont.os2_typoascent = aFont.os2_winascent = em / 2 + aFont.descent = aFont.hhea_descent = em / 2 + aFont.os2_typodescent = aFont.os2_windescent = em / 2 + aFont.hhea_ascent_add = aFont.hhea_descent_add = 0 + aFont.os2_typoascent_add = aFont.os2_typodescent_add = 0 + aFont.os2_winascent_add = aFont.os2_windescent_add = 0 + aFont.os2_use_typo_metrics = True + aFont.generate(aFont.fontname + ".otf") + print(" done.") + + +def createSquareGlyph(aFont, aCodePoint): + g = aFont.createChar(aCodePoint) + p = g.glyphPen() + p.moveTo(0, 0) + p.lineTo(em, 0) + p.lineTo(em, em) + p.lineTo(0, em) + p.closePath() + + +def createLLTriangleGlyph(aFont, aCodePoint): + g = aFont.createChar(aCodePoint) + p = g.glyphPen() + p.moveTo(0, 0) + p.lineTo(em, 0) + p.lineTo(0, em) + p.closePath() + + +def createURTriangleGlyph(aFont, aCodePoint): + g = aFont.createChar(aCodePoint) + p = g.glyphPen() + p.moveTo(em, 0) + p.lineTo(em, em) + p.lineTo(0, em) + p.closePath() + + +def createDiamondGlyph(aFont, aCodePoint): + g = aFont.createChar(aCodePoint) + p = g.glyphPen() + p.moveTo(0, em / 2) + p.lineTo(em / 2, 0) + p.lineTo(em, em / 2) + p.lineTo(em / 2, em) + p.closePath() + + +################################################################################ +# Glyph variants and constructions +f = newMathFont("stretchy") +nvariants = 3 + +# Draw boxes for the size variants and glues +for i in range(0, nvariants): + s = em * (i + 1) + + g = f.createChar(-1, "h%d" % i) + p = g.glyphPen() + p.moveTo(0, -em) + p.lineTo(0, em) + p.lineTo(s, em) + p.lineTo(s, -em) + p.closePath() + g.width = s + + g = f.createChar(-1, "v%d" % i) + p = g.glyphPen() + p.moveTo(0, 0) + p.lineTo(0, s) + p.lineTo(2 * em, s) + p.lineTo(2 * em, 0) + p.closePath() + g.width = 2 * em + +# Draw some pieces for stretchy operators +s = em * nvariants + +g = f.createChar(-1, "left") +p = g.glyphPen() +p.moveTo(0, -2 * em) +p.lineTo(0, 2 * em) +p.lineTo(s, em) +p.lineTo(s, -em) +p.closePath() +g.width = s + +g = f.createChar(-1, "right") +p = g.glyphPen() +p.moveTo(0, -em) +p.lineTo(0, em) +p.lineTo(s, 2 * em) +p.lineTo(s, -2 * em) +p.closePath() +g.width = s + +g = f.createChar(-1, "hmid") +p = g.glyphPen() +p.moveTo(0, -em) +p.lineTo(0, em) +p.lineTo(s, 2 * em) +p.lineTo(2 * s, em) +p.lineTo(2 * s, -em) +p.lineTo(s, -2 * em) +p.closePath() +g.width = 2 * s + +g = f.createChar(-1, "bottom") +p = g.glyphPen() +p.moveTo(0, 0) +p.lineTo(0, s) +p.lineTo(2 * em, s) +p.lineTo(4 * em, 0) +p.closePath() +g.width = 4 * em + +g = f.createChar(-1, "top") +p = g.glyphPen() +p.moveTo(0, 0) +p.lineTo(4 * em, 0) +p.lineTo(2 * em, -s) +p.lineTo(0, -s) +p.closePath() +g.width = 4 * em + +g = f.createChar(-1, "vmid") +p = g.glyphPen() +p.moveTo(0, s) +p.lineTo(2 * em, s) +p.lineTo(4 * em, 0) +p.lineTo(2 * em, -s) +p.lineTo(0, -s) +p.closePath() +g.width = 3 * em + +# Create small rectangle of various size for some exotic arrows that are +# unlikely to be stretchable with standard fonts. +hstretchy = [ + 0x219C, # leftwards wave arrow + 0x219D, # rightwards wave arrow + 0x219E, # leftwards two headed arrow + 0x21A0, # rightwards two headed arrow + 0x21A2, # leftwards arrow with tail +] +vstretchy = [ + 0x219F, # upwards two headed arrow + 0x21A1, # downwards two headed arrow + 0x21A5, # upwards arrow from bar + 0x21A7, # downwards arrow from bar + 0x21A8, # up down arrow with base +] +for i in range(0, 1 + nvariants + 1): + s = (i + 1) * em / 10 + + g = f.createChar(hstretchy[i]) + p = g.glyphPen() + p.moveTo(0, -em / 10) + p.lineTo(0, em / 10) + p.lineTo(s, em / 10) + p.lineTo(s, -em / 10) + p.closePath() + g.width = s + + g = f.createChar(vstretchy[i]) + p = g.glyphPen() + p.moveTo(0, 0) + p.lineTo(0, s) + p.lineTo(2 * em / 10, s) + p.lineTo(2 * em / 10, 0) + p.closePath() + g.width = 2 * em / 10 + +# hstretchy[0] and vstretchy[0] have all the variants and the components. The others only have one of them. +s = em * nvariants + +f[hstretchy[0]].horizontalVariants = "uni219C h0 h1 h2" +f[hstretchy[0]].horizontalComponents = ( + ("left", False, 0, 0, s), + ("h2", True, 0, 0, s), + ("hmid", False, 0, 0, 2 * s), + ("h2", True, 0, 0, s), + ("right", False, 0, 0, s), +) + +f[hstretchy[1]].horizontalVariants = "uni219D h0" +f[hstretchy[2]].horizontalVariants = "uni219E h1" +f[hstretchy[3]].horizontalVariants = "uni21A0 h2" +f[hstretchy[4]].horizontalVariants = "uni21A2 h2" +f[hstretchy[4]].horizontalComponents = f[hstretchy[0]].horizontalComponents + +f[vstretchy[0]].verticalVariants = "uni219F v0 v1 v2" +f[vstretchy[0]].verticalComponents = ( + ("bottom", False, 0, 0, s), + ("v2", True, 0, 0, s), + ("vmid", False, 0, 0, 2 * s), + ("v2", True, 0, 0, s), + ("top", False, 0, 0, s), +) + +f[vstretchy[1]].verticalVariants = "uni21A1 v0" +f[vstretchy[2]].verticalVariants = "uni21A5 v1" +f[vstretchy[3]].verticalVariants = "uni21A7 v2" +f[vstretchy[4]].verticalVariants = "uni21A8" +f[vstretchy[4]].verticalComponents = f[vstretchy[0]].verticalComponents + +################################################################################ +# Testing DisplayOperatorMinHeight +f.math.DisplayOperatorMinHeight = 8 * em +largeop = [0x2A1B, 0x2A1C] # integral with overbar/underbar + +# Draw boxes of size 1, 2, 7, 8, 9em. +for i in [1, 2, 7, 8, 9]: + s = em * i + if i == 1 or i == 2: + g = f.createChar(largeop[i - 1]) + else: + g = f.createChar(-1, "L%d" % i) + p = g.glyphPen() + p.moveTo(0, 0) + p.lineTo(0, s) + p.lineTo(s, s) + p.lineTo(s, 0) + p.closePath() + g.width = s + +f[largeop[0]].verticalVariants = "uni2A1B L7 L8 L9" +f[largeop[1]].verticalVariants = "uni2A1C L8" + +saveMathFont(f) + +################################################################################ +# Testing AxisHeight +f = newMathFont("axis-height-1") +f.math.AxisHeight = 0 +createSquareGlyph(f, ord("+")) +saveMathFont(f) + +f = newMathFont("axis-height-2") +f.math.AxisHeight = 20 * em +createSquareGlyph(f, ord("+")) +saveMathFont(f) + +################################################################################ +# Testing Limits Parameters +f = newMathFont("limits-5") +f.math.UpperLimitGapMin = 0 +f.math.UpperLimitBaselineRiseMin = 0 +f.math.LowerLimitGapMin = 0 +f.math.LowerLimitBaselineDropMin = 0 +f.math.AccentBaseHeight = 6 * em +f.math.FlattenedAccentBaseHeight = 3 * em +createSquareGlyph(f, ord("~")) +saveMathFont(f) + +f = newMathFont("dtls-1") +createSquareGlyph(f, ord("a")) +createLLTriangleGlyph(f, ord("b")) +createSquareGlyph(f, ord("c")) +createDiamondGlyph(f, 0x1D51E) # mathvariant=fraktur a +createURTriangleGlyph(f, 0x1D51F) # mathvariant=fraktur b +createDiamondGlyph(f, 0x1D520) # mathvariant=fraktur c +f.addLookup("gsub", "gsub_single", (), (("dtls", (("latn", ("dflt")),)),)) +f.addLookupSubtable("gsub", "gsub_n") +glyph = f["a"] +glyph.addPosSub("gsub_n", "b") +glyph2 = f[0x1D51F] +glyph2.glyphname = "urtriangle" +glyph3 = f[0x1D51E] +glyph3.addPosSub("gsub_n", "urtriangle") +saveMathFont(f) diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/limits-5.otf b/testing/web-platform/mozilla/tests/mathml/fonts/limits-5.otf Binary files differnew file mode 100644 index 0000000000..fb8e9ec4fc --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/limits-5.otf diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/mathscript-1-ref.html b/testing/web-platform/mozilla/tests/mathml/fonts/mathscript-1-ref.html new file mode 100644 index 0000000000..d591150929 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/mathscript-1-ref.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<head> + + <!-- This font only has glyphs defined for 'A', 'B', 'C' and 'D', and is + designed purely for testing ssty and OpenType 'math' script + functionality + The glyphs for 'A' and 'D' are identical, the difference between them is + that 'A' supports the ssty font feature. + 'A' with ssty = 1 maps to 'B' + 'A' with ssty = 2 maps to 'C' + The difference between this font and ssty.woff is that the font feature + is contained within the OpenType 'math' script. --> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "mathssty"; + src: url("mathssty.woff"); + } + </style> +</head> +<body> + + <!-- Demonstrate that it has no effect outside MathML --> + <div style="font-family: 'mathssty';">D</div> + <div style="font-family: 'mathssty';">D</div> + + <!-- Demonstrate that it works within MathML --> + <math> + <mstyle style="font-family: 'mathssty';"> + <mrow> + <mo>D</mo> + <mo>B</mo> + <mo>C</mo> + </mrow> + </mstyle> + </math> + <p> + <!-- verify it works for the other elements except mtext --> + <math> + <mstyle style="font-family: 'mathssty';"> + <mi mathvariant="normal">C</mi> + <mn>C</mn> + <mtext>D</mtext> + </mstyle> + </math> +</body> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/mathscript-1.html b/testing/web-platform/mozilla/tests/mathml/fonts/mathscript-1.html new file mode 100644 index 0000000000..808c27d030 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/mathscript-1.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<head> + <link rel="match" href="mathscript-1-ref.html"/> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "mathssty"; + src: url("mathssty.woff"); + } + </style> +</head> +<body> + + <!-- Demonstrate that it has no effect outside MathML --> + <div style="font-family: 'mathssty'; + font-feature-settings: 'ssty' 1">A</div> + <div style="font-family: 'mathssty'; + font-feature-settings: 'ssty' 2">A</div> + + <!-- Demonstrate that it works within MathML --> + <math> + <mstyle style="font-family: 'mathssty';"> + <mrow> + <mo style="font-feature-settings: 'ssty' 0">A</mo> + <mo style="font-feature-settings: 'ssty' 1">A</mo> + <mo style="font-feature-settings: 'ssty' 2">A</mo> + </mrow> + </mstyle> + </math> + <p> + <!-- verify it works for the other elements except mtext --> + <math> + <mstyle style="font-family: 'mathssty'; font-feature-settings: 'ssty' 2"> + <mi mathvariant="normal">A</mi> + <mn>A</mn> + <mtext>A</mtext> + </mstyle> + </math> +</body> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/mathscript-2-ref.html b/testing/web-platform/mozilla/tests/mathml/fonts/mathscript-2-ref.html new file mode 100644 index 0000000000..6681292474 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/mathscript-2-ref.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html> + <head> + <title>Dynamic OpenType 'math' script tests</title> + <!-- See mathscript-1-ref.html for an explanation of this font --> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "mathssty"; + src: url("mathssty.woff"); + } + </style> + </head> + <body> + + <!-- Demonstrate that it has no effect outside MathML --> + <div style="font-family: 'mathssty';" >DD</div> + + <!-- Demonstrate that it works within MathML --> + <math> + <mstyle style="font-family: 'mathssty';"> + <mo>CC</mo> + </mstyle> + </math> + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/mathscript-2.html b/testing/web-platform/mozilla/tests/mathml/fonts/mathscript-2.html new file mode 100644 index 0000000000..1a1ea1599e --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/mathscript-2.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <head> + <title>Dynamic OpenType 'math' script tests</title> + <link rel="match" href="mathscript-2-ref.html"/> + <!-- See mathscript-1-ref.html for an explanation of this font --> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "mathssty"; + src: url("mathssty.woff"); + } + </style> + </head> + <body> + + <!-- Demonstrate that it has no effect outside MathML --> + <div style="font-family: 'mathssty'; + font-feature-settings: 'ssty' " id="div0">A</div> + + <!-- Demonstrate that it works within MathML --> + <math> + <mstyle style="font-family: 'mathssty'; font-feature-settings: 'ssty' 2"> + <mo id="mo0">A</mo> + </mstyle> + </math> + + <script> + function doTest() + { + // Does nothing to non-MathML + document.getElementById("div0").appendChild(document.createTextNode("A")); + // Does something to MathML + document.getElementById("mo0").appendChild(document.createTextNode("A")); + document.documentElement.removeAttribute("class"); + } + document.documentElement.addEventListener("TestRendered", doTest); + </script> + + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/mathssty.woff b/testing/web-platform/mozilla/tests/mathml/fonts/mathssty.woff Binary files differnew file mode 100644 index 0000000000..eb6a667753 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/mathssty.woff diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/opentype-axis-height.html b/testing/web-platform/mozilla/tests/mathml/fonts/opentype-axis-height.html new file mode 100644 index 0000000000..8a7050ad4b --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/opentype-axis-height.html @@ -0,0 +1,51 @@ +<!doctype html> +<html> + <head> + <title>Open Type MATH - axis-height</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=961365"/> + <meta charset="utf-8"/> + <style type="text/css"> + math { + font-size: 10px; + } + @font-face { + font-family: axis-height-1; + src: url(axis-height-1.otf); + } + @font-face { + font-family: axis-height-2; + src: url(axis-height-2.otf); + } + </style> + <script type="application/javascript"> + setup({explicit_done : true}); + + var epsilon = 5; + + function getBox(aId) { + return document.getElementById(aId).getBoundingClientRect(); + } + + function doTest() { + test(function() { + assert_approx_equals(getBox("plus1").top - getBox("plus2").top, 10 * 20, epsilon); + }, "AxisHeight"); + done(); + } + </script> + </head> + <body onload="doTest()"> + + <p> + <math style="font-family: axis-height-1;"> + <mo id="plus1">+</mo> + </math> + <math style="font-family: axis-height-2;"> + <mo id="plus2">+</mo> + </math> + </p> + + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/opentype-limits.html b/testing/web-platform/mozilla/tests/mathml/fonts/opentype-limits.html new file mode 100644 index 0000000000..575dfefc11 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/opentype-limits.html @@ -0,0 +1,60 @@ +<!doctype html> +<html> + <head> + <title>Open Type MATH - limits</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=961365"/> + <meta charset="utf-8"/> + <style type="text/css"> + math { + font-size: 10px; + } + @font-face { + font-family: limits-5; + src: url(limits-5.otf); + } + </style> + <script type="text/javascript"> + setup({explicit_done : true}); + + var epsilon = 5; + + function getBox(aId) { + return document.getElementById(aId).getBoundingClientRect(); + } + + function doTest() { + test(function() { + assert_approx_equals(getBox("base9").top - getBox("over9").bottom, + (6 - 2) * 10, epsilon); + assert_approx_equals(getBox("base10").top - getBox("over10").bottom, + (6 - 2) * 10, epsilon); + }, "AccentBaseHeight"); + done(); + } + </script> + </head> + <body onload="doTest()"> + + <p> + <math style="font-family: limits-5;" displaystyle="true"> + <mspace id="ref5" height="1em" width="1em" mathbackground="green"/> + </math> + <math style="font-family: limits-5;" displaystyle="true"> + <mover> + <mspace id="base9" height="2em" width="2em" mathbackground="blue"/> + <mo id="over9" stretchy="false">~</mo> + </mover> + </math> + <math style="font-family: limits-5;" displaystyle="true"> + <munderover> + <mspace id="base10" height="2em" width="2em" mathbackground="blue"/> + <mspace id="under10" height="1em" width="1em" mathbackground="red"/> + <mo id="over10" stretchy="false">~</mo> + </munderover> + </math> + </p> + + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/opentype-stretchy-ref.html b/testing/web-platform/mozilla/tests/mathml/fonts/opentype-stretchy-ref.html new file mode 100644 index 0000000000..7de372170d --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/opentype-stretchy-ref.html @@ -0,0 +1,69 @@ +<!DOCTYPE html> +<html> + <head> + <title>Open Type MATH - stretchy operator</title> + <meta charset="utf-8"/> + <style type="text/css"> + @font-face { + font-family: stretchy; + src: url(stretchy.otf); + } + math { + font-family: stretchy; + font-size: 10px; + } + </style> + </head> + <body> + +<!-- +hstretchy = [ + 0x219C, # leftwards wave arrow + 0x219D, # rightwards wave arrow + 0x219E, # leftwards two headed arrow + 0x21A0, # rightwards two headed arrow + 0x21A2 # leftwards arrow with tail +] +vstretchy = [ + 0x219F, # upwards two headed arrow + 0x21A1, # downwards two headed arrow + 0x21A5, # upwards arrow from bar + 0x21A7, # downwards arrow from bar + 0x21A8 # up down arrow with base +] + +hstretchy[0] and vstretchy[0] have all the variants and the components. The others only have one of them. +--> + + <p> + <math> + <mstyle> + <mover><mo stretchy="true">↝</mo><mspace width="1em" height="1px" mathbackground="red"/></mover> + <mover><mo stretchy="true">↞</mo><mspace width="2em" height="1px" mathbackground="red"/></mover> + <mover><mo stretchy="true">↠</mo><mspace width="3em" height="1px" mathbackground="red"/></mover> + <mover><mo stretchy="true">↢</mo><mspace width="15em" height="1px" mathbackground="red"/></mover> + </mstyle> + </math> + </p> + + <p> + <math><mrow><mo symmetric="false" stretchy="true" minsize="1em">↡</mo></mrow></math> + <math><mrow><mo symmetric="false" stretchy="true" minsize="2em">↥</mo></mrow></math> + <math><mrow><mo symmetric="false" stretchy="true" minsize="3em">↧</mo></mrow></math> + <math><mrow><mo symmetric="false" stretchy="true" minsize="15em">↨</mo></mrow></math> + </p> + +<!-- +DisplayOperatorMinHeight = 8em +largeop = [0x2A1B, 0x2A1C] # integral with overbar/underbar +largeop[0] has variants of size 7, 8, 9em +largeop[1] has one variant of size 8em. +--> + <p> + <math displaystyle="true"> + <mrow><mo>⨜</mo></mrow> + </math> + </p> + + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/opentype-stretchy.html b/testing/web-platform/mozilla/tests/mathml/fonts/opentype-stretchy.html new file mode 100644 index 0000000000..50bccf9b02 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/opentype-stretchy.html @@ -0,0 +1,70 @@ +<!DOCTYPE html> +<html> + <head> + <title>Open Type MATH - stretchy operator</title> + <link rel="match" href="opentype-stretchy-ref.html"/> + <meta charset="utf-8"/> + <style type="text/css"> + @font-face { + font-family: stretchy; + src: url(stretchy.otf); + } + math { + font-family: stretchy; + font-size: 10px; + } + </style> + </head> + <body> + +<!-- +hstretchy = [ + 0x219C, # leftwards wave arrow + 0x219D, # rightwards wave arrow + 0x219E, # leftwards two headed arrow + 0x21A0, # rightwards two headed arrow + 0x21A2 # leftwards arrow with tail +] +vstretchy = [ + 0x219F, # upwards two headed arrow + 0x21A1, # downwards two headed arrow + 0x21A5, # upwards arrow from bar + 0x21A7, # downwards arrow from bar + 0x21A8 # up down arrow with base +] + +hstretchy[0] and vstretchy[0] have all the variants and the components. The others only have one of them. +--> + + <p> + <math> + <mstyle> + <mover><mo stretchy="true">↜</mo><mspace width="1em" height="1px" mathbackground="red"/></mover> + <mover><mo stretchy="true">↜</mo><mspace width="2em" height="1px" mathbackground="red"/></mover> + <mover><mo stretchy="true">↜</mo><mspace width="3em" height="1px" mathbackground="red"/></mover> + <mover><mo stretchy="true">↜</mo><mspace width="15em" height="1px" mathbackground="red"/></mover> + </mstyle> + </math> + </p> + + <p> + <math><mrow><mo symmetric="false" stretchy="true" minsize="1em">↟</mo></mrow></math> + <math><mrow><mo symmetric="false" stretchy="true" minsize="2em">↟</mo></mrow></math> + <math><mrow><mo symmetric="false" stretchy="true" minsize="3em">↟</mo></mrow></math> + <math><mrow><mo symmetric="false" stretchy="true" minsize="15em">↟</mo></mrow></math> + </p> + +<!-- +DisplayOperatorMinHeight = 8em +largeop = [0x2A1B, 0x2A1C] # integral with overbar/underbar +largeop[0] has variants of size 7, 8, 9em +largeop[1] has one variant of size 8em. +--> + <p> + <math displaystyle="true"> + <mrow><mo>⨛</mo></mrow> + </math> + </p> + + </body> +</html> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/ssty-1-ref.html b/testing/web-platform/mozilla/tests/mathml/fonts/ssty-1-ref.html new file mode 100644 index 0000000000..d01b0e5b08 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/ssty-1-ref.html @@ -0,0 +1,337 @@ +<!DOCTYPE html> +<head> + + <!-- This font only has glyphs defined for 'A', 'B', 'C' and 'D', and is + designed purely for testing ssty functionality + The glyphs for 'A' and 'D' are identical, the difference between them is + that 'A' supports the ssty font feature. + 'A' with ssty = 1 maps to 'B' + 'A' with ssty = 2 maps to 'C'--> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "sstyfont"; + src: url("ssty.woff"); + } + </style> +</head> +<body> + + <!-- Test whether the ssty font feature setting is used appropriately for + supscripts et al. + Assumes kMathMLDefaultScriptSizeMultiplier is 0.71--> + + <math> + <mstyle style="font-family: 'sstyfont';"> + <msup> + <mo>D</mo> + <msup> + <mo>B</mo> + <msup> + <mo>C</mo> + <mo>C</mo> <!-- ssty value capped at 2 --> + </msup> + </msup> + </msup> + + <msub> + <mo>D</mo> + <msub> + <mo>B</mo> + <msub> + <mo>C</mo> + <mo>C</mo> + </msub> + </msub> + </msub> + + <msubsup> + <mo>D</mo> + <msubsup> + <mo>B</mo> + <msubsup> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + <msubsup> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + </msubsup> + <msubsup> + <mo>B</mo> + <msubsup> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + <msubsup> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + </msubsup> + </msubsup> + + <mmultiscripts> + <mo>D</mo> + <mmultiscripts> + <mo>B</mo> + <mmultiscripts> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + <mmultiscripts> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + </mmultiscripts> + <mmultiscripts> + <mo>B</mo> + <mmultiscripts> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + <mmultiscripts> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + </mmultiscripts> + </mmultiscripts> + </mstyle> + </math> + + <p> + + <!-- Automatically set ssty ignores user set scriptlevel --> + <math> + <mstyle style="font-family: 'sstyfont';" scriptlevel="-3"> + <msup> + <mo>D</mo> + <msup> + <mo>B</mo> + <msup> + <mo>C</mo> + <mo>C</mo> <!-- ssty value capped at 2 --> + </msup> + </msup> + </msup> + + <msub> + <mo>D</mo> + <msub> + <mo>B</mo> + <msub> + <mo>C</mo> + <mo>C</mo> + </msub> + </msub> + </msub> + + <msubsup> + <mo>D</mo> + <msubsup> + <mo>B</mo> + <msubsup> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + <msubsup> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + </msubsup> + <msubsup> + <mo>B</mo> + <msubsup> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + <msubsup> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + </msubsup> + </msubsup> + + <mmultiscripts> + <mo>D</mo> + <mmultiscripts> + <mo>B</mo> + <mmultiscripts> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + <mmultiscripts> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + </mmultiscripts> + <mmultiscripts> + <mo>B</mo> + <mmultiscripts> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + <mmultiscripts> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + </mmultiscripts> + </mmultiscripts> + </mstyle> + </math> + + <p> + + <!-- Automatically set ssty ignores user set scriptlevel --> + <math> + <mstyle style="font-family: 'sstyfont';" scriptlevel="1"> + <msup> + <mo>D</mo> + <msup> + <mo>B</mo> + <msup> + <mo>C</mo> + <mo>C</mo> <!-- ssty value capped at 2 --> + </msup> + </msup> + </msup> + + <msub> + <mo>D</mo> + <msub> + <mo>B</mo> + <msub> + <mo>C</mo> + <mo>C</mo> + </msub> + </msub> + </msub> + + <msubsup> + <mo>D</mo> + <msubsup> + <mo>B</mo> + <msubsup> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + <msubsup> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + </msubsup> + <msubsup> + <mo>B</mo> + <msubsup> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + <msubsup> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + </msubsup> + </msubsup> + + <mmultiscripts> + <mo>D</mo> + <mmultiscripts> + <mo>B</mo> + <mmultiscripts> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + <mmultiscripts> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + </mmultiscripts> + <mmultiscripts> + <mo>B</mo> + <mmultiscripts> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + <mmultiscripts> + <mo>C</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + </mmultiscripts> + </mmultiscripts> + </mstyle> + </math> + + <p> + + <!-- User set ssty font feature setting overrides automatically set ssty, but + only for affected elements --> + <math> + <mstyle style="font-family: 'sstyfont';"> + <msup> + <mo>D</mo> + <msup> + <mo>D</mo> + <mo>C</mo> + </msup> + </msup> + + <msub> + <mo>D</mo> + <msub> + <mo>D</mo> + <mo>C</mo> + </msub> + </msub> + + <msubsup> + <mo>D</mo> + <msubsup> + <mo>D</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + <msubsup> + <mo>D</mo> + <mo>C</mo> + <mo>C</mo> + </msubsup> + </msubsup> + + <mmultiscripts> + <mo>D</mo> + <mmultiscripts> + <mo>D</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + <mmultiscripts> + <mo>D</mo> + <mo>C</mo> + <mo>C</mo> + </mmultiscripts> + </mmultiscripts> + </mstyle> + </math> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/ssty-1.html b/testing/web-platform/mozilla/tests/mathml/fonts/ssty-1.html new file mode 100644 index 0000000000..f918b9c6d2 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/ssty-1.html @@ -0,0 +1,325 @@ +<!DOCTYPE html> +<head> + <link rel="match" href="ssty-1-ref.html"/> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "sstyfont"; + src: url("ssty.woff"); + } + </style> +</head> +<body> + <math> + <mstyle style="font-family: 'sstyfont';"> + <msup> + <mo>A</mo> + <msup> + <mo>A</mo> + <msup> + <mo>A</mo> + <mo>A</mo> <!-- ssty value capped at 2 --> + </msup> + </msup> + </msup> + + <msub> + <mo>A</mo> + <msub> + <mo>A</mo> + <msub> + <mo>A</mo> + <mo>A</mo> + </msub> + </msub> + </msub> + + <msubsup> + <mo>A</mo> + <msubsup> + <mo>A</mo> + <msubsup> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + <msubsup> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + </msubsup> + <msubsup> + <mo>A</mo> + <msubsup> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + <msubsup> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + </msubsup> + </msubsup> + + <mmultiscripts> + <mo>A</mo> + <mmultiscripts> + <mo>A</mo> + <mmultiscripts> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + <mmultiscripts> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + </mmultiscripts> + <mmultiscripts> + <mo>A</mo> + <mmultiscripts> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + <mmultiscripts> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + </mmultiscripts> + </mmultiscripts> + </mstyle> + </math> + + <p> + + <!-- Automatically set ssty ignores scriptlevel --> + <math> + <mstyle style="font-family: 'sstyfont';" scriptlevel="-3"> + <msup> + <mo>A</mo> + <msup> + <mo>A</mo> + <msup> + <mo>A</mo> + <mo>A</mo> <!-- ssty value capped at 2 --> + </msup> + </msup> + </msup> + + <msub> + <mo>A</mo> + <msub> + <mo>A</mo> + <msub> + <mo>A</mo> + <mo>A</mo> + </msub> + </msub> + </msub> + + <msubsup> + <mo>A</mo> + <msubsup> + <mo>A</mo> + <msubsup> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + <msubsup> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + </msubsup> + <msubsup> + <mo>A</mo> + <msubsup> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + <msubsup> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + </msubsup> + </msubsup> + + <mmultiscripts> + <mo>A</mo> + <mmultiscripts> + <mo>A</mo> + <mmultiscripts> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + <mmultiscripts> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + </mmultiscripts> + <mmultiscripts> + <mo>A</mo> + <mmultiscripts> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + <mmultiscripts> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + </mmultiscripts> + </mmultiscripts> + </mstyle> + </math> + + <p> + + <!-- Automatically set ssty ignores scriptlevel --> + <math> + <mstyle style="font-family: 'sstyfont';" scriptlevel="1"> + <msup> + <mo>A</mo> + <msup> + <mo>A</mo> + <msup> + <mo>A</mo> + <mo>A</mo> <!-- ssty value capped at 2 --> + </msup> + </msup> + </msup> + + <msub> + <mo>A</mo> + <msub> + <mo>A</mo> + <msub> + <mo>A</mo> + <mo>A</mo> + </msub> + </msub> + </msub> + + <msubsup> + <mo>A</mo> + <msubsup> + <mo>A</mo> + <msubsup> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + <msubsup> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + </msubsup> + <msubsup> + <mo>A</mo> + <msubsup> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + <msubsup> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + </msubsup> + </msubsup> + + <mmultiscripts> + <mo>A</mo> + <mmultiscripts> + <mo>A</mo> + <mmultiscripts> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + <mmultiscripts> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + </mmultiscripts> + <mmultiscripts> + <mo>A</mo> + <mmultiscripts> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + <mmultiscripts> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + </mmultiscripts> + </mmultiscripts> + </mstyle> + </math> + + <p> + + <!-- User set ssty font feature setting overrides automatically set ssty --> + <math> + <mstyle style="font-family: 'sstyfont';"> + <msup> + <mo>A</mo> + <msup> + <mo style="font-feature-settings: 'ssty' 0">A</mo> + <mo>A</mo> + </msup> + </msup> + + <msub> + <mo>A</mo> + <msub> + <mo style="font-feature-settings: 'ssty' 0">A</mo> + <mo>A</mo> + </msub> + </msub> + + <msubsup> + <mo>A</mo> + <msubsup> + <mo style="font-feature-settings: 'ssty' 0">A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + <msubsup> + <mo style="font-feature-settings: 'ssty' 0">A</mo> + <mo>A</mo> + <mo>A</mo> + </msubsup> + </msubsup> + + <mmultiscripts> + <mo>A</mo> + <mmultiscripts> + <mo style="font-feature-settings: 'ssty' 0">A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + <mmultiscripts> + <mo style="font-feature-settings: 'ssty' 0">A</mo> + <mo>A</mo> + <mo>A</mo> + </mmultiscripts> + </mmultiscripts> + </mstyle> + </math> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/ssty-2-ref.html b/testing/web-platform/mozilla/tests/mathml/fonts/ssty-2-ref.html new file mode 100644 index 0000000000..c11c328f38 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/ssty-2-ref.html @@ -0,0 +1,275 @@ +<!DOCTYPE html> +<head> + <!-- See ssty-1-ref.html for an explanation of this font --> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "sstyfont"; + src: url("ssty.woff"); + } + </style> +</head> +<body> + <!-- Test whether the ssty font feature setting is used appropriately for + mroot, mfrac, munderover et al. + Assumes kMathMLDefaultScriptSizeMultiplier is 0.71--> + <math> + <mstyle style="font-family: 'sstyfont';"> + <mroot> + <mo>D</mo> + <mo>C</mo> + </mroot> + + <mfrac> + <mo>B</mo> + <mo>B</mo> + </mfrac> + + <mfrac> + <mfrac> + <mo>C</mo> + <mo>C</mo> + </mfrac> + <mfrac> + <mo>C</mo> + <mo>C</mo> + </mfrac> + </mfrac> + + <mfrac> + <mroot> + <mo>B</mo> + <mo>C</mo> + </mroot> + <mo>B</mo> + </mfrac> + + <mover> + <mo>D</mo> + <mover> + <mo>B</mo> + <mo>C</mo> + </mover> + </mover> + + <munder> + <mo>D</mo> + <munder> + <mo>B</mo> + <mo>C</mo> + </munder> + </munder> + + <munderover> + <mo>D</mo> + <munderover> + <mo>B</mo> + <mo>C</mo> + <mo>C</mo> + </munderover> + <munderover> + <mo>B</mo> + <mo>C</mo> + <mo>C</mo> + </munderover> + </munderover> + + </mstyle> + </math> + + <p> + <!-- ssty font feature not set on mfrac et al when displaystyle is + set (still allowed on mroot, mover et al.)--> + <math> + <mstyle style="font-family: 'sstyfont';" displaystyle="true"> + <mroot> + <mo>D</mo> + <mo>C</mo> + </mroot> + + <mfrac> + <mo>D</mo> + <mo>D</mo> + </mfrac> + + <mfrac> + <mfrac> + <!-- ssty gets set as script level incremented because displaystyle + is now false --> + <mo>B</mo> + <mo>B</mo> + </mfrac> + <mfrac> + <mo>B</mo> + <mo>B</mo> + </mfrac> + </mfrac> + + <mfrac> + <mroot> + <mo>D</mo> + <mo>C</mo> + </mroot> + <mo>D</mo> + </mfrac> + + <mover> + <mo>D</mo> + <mover> + <mo>B</mo> + <mo>C</mo> + </mover> + </mover> + + <munder> + <mo>D</mo> + <munder> + <mo>B</mo> + <mo>C</mo> + </munder> + </munder> + + <munderover> + <mo>D</mo> + <munderover> + <mo>B</mo> + <mo>C</mo> + <mo>C</mo> + </munderover> + <munderover> + <mo>B</mo> + <mo>C</mo> + <mo>C</mo> + </munderover> + </munderover> + </mstyle> + </math> + + <p> + + <math> + <!-- scriptlevel is not incremented when accent for overframes and + accentunder for underframes are true, so there shouldn't be a + change in the ssty value --> + <mstyle style="font-family: 'sstyfont';"> + <mover accent="true"> + <mo>D</mo> + <mover accent="true"> + <mo>D</mo> + <mo>D</mo> + </mover> + </mover> + + <munder accentunder="true"> + <mo>D</mo> + <munder accentunder="true"> + <mo>D</mo> + <mo>D</mo> + </munder> + </munder> + + <munderover accentunder="true" accent="true"> + <mo>D</mo> + <munderover accentunder="true" accent="true"> + <mo>D</mo> + <mo>D</mo> + <mo>D</mo> + </munderover> + <munderover accentunder="true" accent="true"> + <mo>D</mo> + <mo>D</mo> + <mo>D</mo> + </munderover> + </munderover> + + <mover accent="true"> + <mo>D</mo> + <mover accent="false"> + <mo>D</mo> + <mo>B</mo> + </mover> + </mover> + + <munder accentunder="true"> + <mo>D</mo> + <munder accentunder="false"> + <mo>D</mo> + <mo>B</mo> + </munder> + </munder> + + <munderover accentunder="true" accent="true"> + <mo>D</mo> + <munderover accentunder="false" accent="false"> + <mo>D</mo> + <mo>B</mo> + <mo>B</mo> + </munderover> + <munderover accentunder="false" accent="false"> + <mo>D</mo> + <mo>B</mo> + <mo>B</mo> + </munderover> + </munderover> + + <mover accentunder="false" accent="false"> + <mo>D</mo> + <mover accentunder="true" accent="true"> + <mo>B</mo> + <mo>B</mo> + </mover> + </mover> + + <munder accentunder="false" accent="false"> + <mo>D</mo> + <munder accentunder="true" accent="true"> + <mo>B</mo> + <mo>B</mo> + </munder> + </munder> + + <munderover accentunder="false" accent="false"> + <mo>D</mo> + <munderover accentunder="true" accent="true"> + <mo>B</mo> + <mo>B</mo> + <mo>B</mo> + </munderover> + <munderover accentunder="true" accent="true"> + <mo>B</mo> + <mo>B</mo> + <mo>B</mo> + </munderover> + </munderover> + + <munderover accentunder="false" accent="true"> + <mo>D</mo> + <munderover accentunder="false" accent="true"> + <mo>B</mo> + <mo>C</mo> + <mo>B</mo> + </munderover> + <munderover accentunder="false" accent="true"> + <mo>D</mo> + <mo>B</mo> + <mo>D</mo> + </munderover> + </munderover> + + <munderover accentunder="true" accent="false"> + <mo>D</mo> + <munderover accentunder="true" accent="false"> + <mo>D</mo> + <mo>D</mo> + <mo>B</mo> + </munderover> + <munderover accentunder="true" accent="false"> + <mo>B</mo> + <mo>B</mo> + <mo>C</mo> + </munderover> + </munderover> + + </mstyle> + </math> + +</body> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/ssty-2.html b/testing/web-platform/mozilla/tests/mathml/fonts/ssty-2.html new file mode 100644 index 0000000000..c4ffe1bd8b --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/ssty-2.html @@ -0,0 +1,268 @@ +<!DOCTYPE html> +<head> + <link rel="match" href="ssty-2-ref.html"/> + <!-- See ssty-1-ref.html for an explanation of this font --> + <style type="text/css" media="screen, print"> + @font-face { + font-family: "sstyfont"; + src: url("ssty.woff"); + } + </style> +</head> +<body> + <math> + <mstyle style="font-family: 'sstyfont';"> + <mroot> + <mo>A</mo> + <mo>A</mo> + </mroot> + + <mfrac> + <mo>A</mo> + <mo>A</mo> + </mfrac> + + <mfrac> + <mfrac> + <mo>A</mo> + <mo>A</mo> + </mfrac> + <mfrac> + <mo>A</mo> + <mo>A</mo> + </mfrac> + </mfrac> + + <mfrac> + <mroot> + <mo>A</mo> + <mo>A</mo> + </mroot> + <mo>A</mo> + </mfrac> + + <mover> + <mo>A</mo> + <mover> + <mo>A</mo> + <mo>A</mo> + </mover> + </mover> + + <munder> + <mo>A</mo> + <munder> + <mo>A</mo> + <mo>A</mo> + </munder> + </munder> + + <munderover> + <mo>A</mo> + <munderover> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + <munderover> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + </munderover> + + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'sstyfont';" displaystyle="true"> + <mroot> + <mo>A</mo> + <mo>A</mo> + </mroot> + + <mfrac> + <mo>A</mo> + <mo>A</mo> + </mfrac> + + <mfrac> + <mfrac> + <mo>A</mo> + <mo>A</mo> + </mfrac> + <mfrac> + <mo>A</mo> + <mo>A</mo> + </mfrac> + </mfrac> + + <mfrac> + <mroot> + <mo>A</mo> + <mo>A</mo> + </mroot> + <mo>A</mo> + </mfrac> + + <mover> + <mo>A</mo> + <mover> + <mo>A</mo> + <mo>A</mo> + </mover> + </mover> + + <munder> + <mo>A</mo> + <munder> + <mo>A</mo> + <mo>A</mo> + </munder> + </munder> + + <munderover> + <mo>A</mo> + <munderover> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + <munderover> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + </munderover> + </mstyle> + </math> + + <p> + + <math> + <mstyle style="font-family: 'sstyfont';"> + + <mover accent="true"> + <mo>A</mo> + <mover accent="true"> + <mo>A</mo> + <mo>A</mo> + </mover> + </mover> + + <munder accentunder="true"> + <mo>A</mo> + <munder accentunder="true"> + <mo>A</mo> + <mo>A</mo> + </munder> + </munder> + + <munderover accentunder="true" accent="true"> + <mo>A</mo> + <munderover accentunder="true" accent="true"> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + <munderover accentunder="true" accent="true"> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + </munderover> + + <mover accentunder="true" accent="true"> + <mo>A</mo> + <mover accentunder="false" accent="false"> + <mo>A</mo> + <mo>A</mo> + </mover> + </mover> + + <munder accentunder="true" accent="true"> + <mo>A</mo> + <munder accentunder="false" accent="false"> + <mo>A</mo> + <mo>A</mo> + </munder> + </munder> + + <munderover accentunder="true" accent="true"> + <mo>A</mo> + <munderover accentunder="false" accent="false"> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + <munderover accentunder="false" accent="false"> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + </munderover> + + <mover accent="false"> + <mo>A</mo> + <mover accent="true"> + <mo>A</mo> + <mo>A</mo> + </mover> + </mover> + + <munder accentunder="false"> + <mo>A</mo> + <munder accentunder="true"> + <mo>A</mo> + <mo>A</mo> + </munder> + </munder> + + <munderover accentunder="false" accent="false"> + <mo>A</mo> + <munderover accentunder="true" accent="true"> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + <munderover accentunder="true" accent="true"> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + </munderover> + + <munderover accentunder="false" accent="true"> + <mo>A</mo> + <munderover accentunder="false" accent="true"> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + <munderover accentunder="false" accent="true"> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + </munderover> + + <munderover accentunder="true" accent="false"> + <mo>A</mo> + <munderover accentunder="true" accent="false"> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + <munderover accentunder="true" accent="false"> + <mo>A</mo> + <mo>A</mo> + <mo>A</mo> + </munderover> + </munderover> + + </mstyle> + </math> + +</body> diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/ssty.woff b/testing/web-platform/mozilla/tests/mathml/fonts/ssty.woff Binary files differnew file mode 100644 index 0000000000..19312c713d --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/ssty.woff diff --git a/testing/web-platform/mozilla/tests/mathml/fonts/stretchy.otf b/testing/web-platform/mozilla/tests/mathml/fonts/stretchy.otf Binary files differnew file mode 100644 index 0000000000..f192de3463 --- /dev/null +++ b/testing/web-platform/mozilla/tests/mathml/fonts/stretchy.otf |