-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export mo-invisibleoperators-*.html reftests to WPT.
These tests are testing Gecko's special handling of invisible operators introduced in bug 969867 and bug 522393. mo-invisibleoperators-2.html is just dynamically replacing the invisible operators into ASCII text and is compatible with MathML-Core implementations. mo-invisibleoperators.html verifies that invisible operators are really invisible (no size, background, foreground) which is also compatible with MathML-Core implementations, as long as the default math fonts really have empty glyphs for these operators, which should be the case for modern font sets. Differential Revision: https://phabricator.services.mozilla.com/D199698 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1876684 gecko-commit: 3225b8ea16e45772092f8ecf0dfa40215019ca9d gecko-reviewers: emilio
- Loading branch information
1 parent
896d4b0
commit 7f5cd8c
Showing
4 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
mathml/presentation-markup/operators/mo-invisibleoperators-2-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<math> | ||
<mo>1</mo> | ||
</math> | ||
<p> | ||
<math> | ||
<mo>2</mo> | ||
</math> | ||
<p> | ||
<math> | ||
<mo>3</mo> | ||
</math> | ||
<p> | ||
<math> | ||
<mo>4</mo> | ||
</math> | ||
<p> | ||
<table> | ||
<tr> | ||
<td style="border: 1px solid;"> | ||
<math> | ||
<mo>x</mo> | ||
</math> | ||
</td> | ||
</tr> | ||
</table> | ||
</html> |
48 changes: 48 additions & 0 deletions
48
mathml/presentation-markup/operators/mo-invisibleoperators-2.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html class="reftest-wait"> | ||
<head> | ||
<link rel="match" href="mo-invisibleoperators-2-ref.html"> | ||
<link rel="help" href="https://w3c.github.io/mathml-core/#operator-fence-separator-or-accent-mo"> | ||
<link rel="help" href="This test verifies proper invalidation after dynamically replacing the text of invisible operators."> | ||
<meta name="assert" content="https://bugzilla.mozilla.org/show_bug.cgi?id=522393"> | ||
</head> | ||
<body> | ||
<math> | ||
<mo id="mo1">⁡<!-- FUNCTION APPLICATION --></mo> | ||
</math> | ||
<p> | ||
<math> | ||
<mo id="mo2">⁢<!-- INVISIBLE TIMES --></mo> | ||
</math> | ||
<p> | ||
<math> | ||
<mo id="mo3">⁣<!-- INVISIBLE SEPARATOR --></mo> | ||
</math> | ||
<p> | ||
<math> | ||
<mo id="mo4">⁤<!-- INVISIBLE PLUS --></mo> | ||
</math> | ||
<p> | ||
<!-- Test preferred width after dynamic change--> | ||
<table> | ||
<tr> | ||
<td style="border: 1px solid;"> | ||
<math> | ||
<mo id="mo5">⁡</mo> | ||
</math> | ||
</td> | ||
</tr> | ||
</table> | ||
<script type="text/javascript"> | ||
function doTest() { | ||
document.getElementById('mo1').firstChild.data = '1'; | ||
document.getElementById('mo2').firstChild.data = '2'; | ||
document.getElementById('mo3').firstChild.data = '3'; | ||
document.getElementById('mo4').firstChild.data = '4'; | ||
document.getElementById('mo5').firstChild.data = 'x'; | ||
document.documentElement.removeAttribute("class"); | ||
} | ||
window.addEventListener("TestRendered", doTest); | ||
</script> | ||
</body> | ||
</html> |
13 changes: 13 additions & 0 deletions
13
mathml/presentation-markup/operators/mo-invisibleoperators-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<math> | ||
<mrow> | ||
<mn>1</mn> | ||
<mn>2</mn> | ||
<mn>3</mn> | ||
<mn>4</mn> | ||
<mn>5</mn> | ||
<mspace height="2em" width="0.1em"></mspace> | ||
</mrow> | ||
</math> | ||
</html> |
33 changes: 33 additions & 0 deletions
33
mathml/presentation-markup/operators/mo-invisibleoperators.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link rel="match" href="mo-invisibleoperators-ref.html"> | ||
<link rel="help" href="https://w3c.github.io/mathml-core/#operator-fence-separator-or-accent-mo"> | ||
<link rel="help" href="This test verifies that invisible operators rendered with the default fonts do not add spacing, foreground or background."> | ||
<meta name="assert" content="https://bugzilla.mozilla.org/show_bug.cgi?id=969867"> | ||
<meta name="assert" content="https://bugzilla.mozilla.org/show_bug.cgi?id=522393"> | ||
</head> | ||
<math> | ||
<mrow> | ||
<mn>1</mn> | ||
<mo>⁡<!-- FUNCTION APPLICATION --></mo> | ||
<mn>2</mn> | ||
<mo>⁢<!-- INVISIBLE TIMES --></mo> | ||
<mn>3</mn> | ||
<mo>⁣<!-- INVISIBLE SEPARATOR --></mo> | ||
<mn>4</mn> | ||
<mo>⁤<!-- INVISIBLE PLUS --></mo> | ||
<mn>5</mn> | ||
<!-- Hack. The invisible operators may not belong to the same font as | ||
the numbers, so they may have different heights. The mspace | ||
compensates for this by ensuring the height of the mrow does not | ||
depend on character height --> | ||
<mspace height="2em" width="0.1em"></mspace> | ||
</mrow> | ||
</math> | ||
<p> | ||
<!-- Should be invisible --> | ||
<math> | ||
<mo style="background: red; color: blue;">⁡</mo> | ||
</math> | ||
</html> |