Skip to content

Commit

Permalink
Bug 1586574 - apply horizontal writing mode to mathml elements. r=emilio
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-wang committed Dec 16, 2022
1 parent a470955 commit f88b1fe
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 80 deletions.
5 changes: 4 additions & 1 deletion layout/mathml/mathml.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@

@namespace url(http://www.w3.org/1998/Math/MathML);

* {
writing-mode: horizontal-tb !important;
}

/**************************************************************************/
/* <math> - outermost math element */
/**************************************************************************/

math {
writing-mode: horizontal-tb !important;
direction: ltr;
unicode-bidi: embed;
display: inline;
Expand Down
2 changes: 1 addition & 1 deletion layout/printing/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ asserts-if(Android,0-1) load 793844.html
skip-if(Android) load 1662259.html
skip-if(Android) load 1663722.html
skip-if(Android) load 1671503.html
asserts-if(!Android,1-1) load 1748277.html # Bug 1751260
load 1748277.html # Bug 1751260
load 1758199-1.html
pref(layout.css.named-pages.enabled,true) load 1804571.html
pref(layout.css.named-pages.enabled,true) load 1804798.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,3 @@
expected:
if (os == "android") and fission: [OK, TIMEOUT]
max-asserts: 51
[mfrac layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[mpadded layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[munder layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[mtable layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[mo layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[munderover layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[menclose layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[mrow layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[maction layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[mstyle layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[msub layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[merror layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[semantics layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[msqrt layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[mphantom layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[mmultiscripts layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[ms layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[mi layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[mn layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[mtext layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[mroot layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[mover layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[msup layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

[msubsup layout is not affected by writing-mode: vertical-rl;]
expected: FAIL

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
/* selector defined in mathml-fragments.js */
.element {
writing-mode: vertical-lr;
padding-block-start: 10px;
padding-block-end: 15px;
padding-inline-start: 20px;
padding-inline-end: 25px;
}
</style>
</head>
Expand All @@ -21,7 +25,6 @@
<math class="element"></math>
</div>
<script>
test(function () {
var container = document.getElementById("container");
for (tag in MathMLFragments) {
container.insertAdjacentHTML("beforeend", `<math>${MathMLFragments[tag]}</math>`);
Expand All @@ -32,9 +35,16 @@
Array.from(document.getElementsByClassName("element")).forEach(element => {
var tag = element.tagName;
var style = window.getComputedStyle(element);
assert_equals(style["writing-mode"], "horizontal-tb", `writing-mode on ${tag}`);
}, `writing-mode is forced to horizontal-tb on all MathML elements`);
});
test(function () {
assert_equals(style["writing-mode"], "horizontal-tb");
}, `writing-mode is forced to horizontal-tb on <${tag}> element`);
test(function () {
assert_equals(style["padding-block-start"], style["padding-top"]);
assert_equals(style["padding-block-end"], style["padding-bottom"]);
assert_equals(style["padding-inline-start"], style["padding-left"]);
assert_equals(style["padding-inline-end"], style["padding-right"]);
}, `logical properties interpreted in horizontal-tb on <${tag}> element`);
});
</script>
</body>
</html>

0 comments on commit f88b1fe

Please sign in to comment.