Skip to content

Commit

Permalink
Export reftests for MathML embellished operators to WPT.
Browse files Browse the repository at this point in the history
The tests exported in this patch use complex embellished operators and
verify whether or not the operator stretches. To avoid relying on
systems fonts and make the visual rendering more reliable, we use the
Ahem font for text as well as operators.woff for stretchy operators.
stretchy-mover-2a.html is currently failing so we preserve this
annotation. Some unrelated alignment issue were happening with
stretchy-mover-1a/b, which are worked around by wrapping the <math>
tag in a container div.

Differential Revision: https://phabricator.services.mozilla.com/D185308

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1847034
gecko-commit: d3d519122ea8ffc4314678a7a35a9d557223cefd
gecko-reviewers: emilio
  • Loading branch information
fred-wang authored and Lightning00Blade committed Dec 11, 2023
1 parent 10202cd commit a606f0f
Show file tree
Hide file tree
Showing 65 changed files with 2,199 additions and 0 deletions.
31 changes: 31 additions & 0 deletions mathml/presentation-markup/operators/embellished-op-1-2-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<title>embellished operators 1: mrow</title>
<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
@font-face {
font-family: operators;
src: url("/fonts/math/operators.woff");
}
math {
font: 25px/1 Ahem;
}
mo {
font-family: operators;
}
</style>
</head>

<body>
<div>
<!-- mrow whose child is embellished op -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
<mtext>abcdef</mtext>
<mrow><mo stretchy="false">&#xaf;</mo></mrow>
</mover>
</math>
</div>
</body>
</html>
33 changes: 33 additions & 0 deletions mathml/presentation-markup/operators/embellished-op-1-2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>embellished operators 1: mrow</title>
<link rel="mismatch" href="embellished-op-1-2-ref.html"/>
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=21479"/>
<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
@font-face {
font-family: operators;
src: url("/fonts/math/operators.woff");
}
math {
font: 25px/1 Ahem;
}
mo {
font-family: operators;
}
</style>
</head>

<body>
<div>
<!-- mrow whose child is embellished op -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
<mtext>abcdef</mtext>
<mrow><mo>&#xaf;</mo></mrow>
</mover>
</math>
</div>
</body>
</html>
31 changes: 31 additions & 0 deletions mathml/presentation-markup/operators/embellished-op-1-3-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<title>embellished operators 1: mstyle</title>
<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
@font-face {
font-family: operators;
src: url("/fonts/math/operators.woff");
}
math {
font: 25px/1 Ahem;
}
mo {
font-family: operators;
}
</style>
</head>

<body>
<div>
<!-- mstyle whose child is embellished op -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
<mtext>abcdef</mtext>
<mstyle><mo stretchy="false">&#xaf;</mo></mstyle>
</mover>
</math>
</div>
</body>
</html>
33 changes: 33 additions & 0 deletions mathml/presentation-markup/operators/embellished-op-1-3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>embellished operators 1: mstyle</title>
<link rel="mismatch" href="embellished-op-1-3-ref.html"/>
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=21479"/>
<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
@font-face {
font-family: operators;
src: url("/fonts/math/operators.woff");
}
math {
font: 25px/1 Ahem;
}
mo {
font-family: operators;
}
</style>
</head>

<body>
<div>
<!-- mstyle whose child is embellished op -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
<mtext>abcdef</mtext>
<mstyle><mo>&#xaf;</mo></mstyle>
</mover>
</math>
</div>
</body>
</html>
31 changes: 31 additions & 0 deletions mathml/presentation-markup/operators/embellished-op-1-4-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<title>embellished operators 1: mpadded</title>
<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
@font-face {
font-family: operators;
src: url("/fonts/math/operators.woff");
}
math {
font: 25px/1 Ahem;
}
mo {
font-family: operators;
}
</style>
</head>

<body>
<div>
<!-- mpadded whose child is embellished op -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
<mtext>abcdef</mtext>
<mpadded><mo stretchy="false">&#xaf;</mo></mpadded>
</mover>
</math>
</div>
</body>
</html>
33 changes: 33 additions & 0 deletions mathml/presentation-markup/operators/embellished-op-1-4.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>embellished operators 1: mpadded</title>
<link rel="mismatch" href="embellished-op-1-4-ref.html"/>
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=21479"/>
<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
@font-face {
font-family: operators;
src: url("/fonts/math/operators.woff");
}
math {
font: 25px/1 Ahem;
}
mo {
font-family: operators;
}
</style>
</head>

<body>
<div>
<!-- mpadded whose child is embellished op -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
<mtext>abcdef</mtext>
<mpadded><mo>&#xaf;</mo></mpadded>
</mover>
</math>
</div>
</body>
</html>
35 changes: 35 additions & 0 deletions mathml/presentation-markup/operators/embellished-op-1-5-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>embellished operators 1: mphantom</title>
<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
@font-face {
font-family: operators;
src: url("/fonts/math/operators.woff");
}
math {
font: 25px/1 Ahem;
}
mo {
font-family: operators;
}
</style>
</head>

<body>
<div>
<!-- mphantom whose child is embellished op -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
<mtext>abcdef</mtext>
<mrow>
<mtext>g</mtext>
<mphantom><mo stretchy="false">&#xaf;</mo></mphantom>
<mtext>h</mtext>
</mrow>
</mover>
</math>
</div>
</body>
</html>
37 changes: 37 additions & 0 deletions mathml/presentation-markup/operators/embellished-op-1-5.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<title>embellished operators 1: mphantom</title>
<link rel="mismatch" href="embellished-op-1-5-ref.html"/>
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=21479"/>
<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
@font-face {
font-family: operators;
src: url("/fonts/math/operators.woff");
}
math {
font: 25px/1 Ahem;
}
mo {
font-family: operators;
}
</style>
</head>

<body>
<div>
<!-- mphantom whose child is embellished op -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
<mtext>abcdef</mtext>
<mrow>
<mtext>g</mtext>
<mphantom><mo>&#xaf;</mo></mphantom>
<mtext>h</mtext>
</mrow>
</mover>
</math>
</div>
</body>
</html>
31 changes: 31 additions & 0 deletions mathml/presentation-markup/operators/embellished-op-2-1-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<title>embellished operators: ignore space-like children</title>
<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
@font-face {
font-family: operators;
src: url("/fonts/math/operators.woff");
}
math {
font: 25px/1 Ahem;
}
mo {
font-family: operators;
}
</style>
</head>

<body>
<div>
<!-- first child space-like -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
<mtext>abcdef</mtext>
<mrow><mtext>g</mtext><mo stretchy="false">&#xaf;</mo></mrow>
</mover>
</math>
</div>
</body>
</html>
33 changes: 33 additions & 0 deletions mathml/presentation-markup/operators/embellished-op-2-1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>embellished operators: ignore space-like children</title>
<link rel="mismatch" href="embellished-op-2-1-ref.html"/>
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=21479"/>
<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
@font-face {
font-family: operators;
src: url("/fonts/math/operators.woff");
}
math {
font: 25px/1 Ahem;
}
mo {
font-family: operators;
}
</style>
</head>

<body>
<div>
<!-- first child space-like -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
<mtext>abcdef</mtext>
<mrow><mtext>g</mtext><mo>&#xaf;</mo></mrow>
</mover>
</math>
</div>
</body>
</html>
31 changes: 31 additions & 0 deletions mathml/presentation-markup/operators/embellished-op-2-2-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<title>embellished operators: ignore space-like children</title>
<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
@font-face {
font-family: operators;
src: url("/fonts/math/operators.woff");
}
math {
font: 25px/1 Ahem;
}
mo {
font-family: operators;
}
</style>
</head>

<body>
<div>
<!-- last child space-like -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
<mtext>abcdef</mtext>
<mrow><mo stretchy="false">&#xaf;</mo><mtext>g</mtext></mrow>
</mover>
</math>
</div>
</body>
</html>
Loading

0 comments on commit a606f0f

Please sign in to comment.