Skip to content

Commit

Permalink
[mathml] Update CSS math-style to match specification update
Browse files Browse the repository at this point in the history
math-style was originally implemented in [1] but it was decided with the
CSSWG to perform the following changes [2]:
- 'display' is renamed 'normal'
- 'inline' is renamed 'compact'
- the default value becomes 'normal' (instead of 'inline')

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2100787
[2] w3c/csswg-drafts#5387

Bug: 6606
Change-Id: I5eb4aa423f434c068ccb02517b086830291fcf55
  • Loading branch information
fred-wang authored and chromium-wpt-export-bot committed Sep 21, 2020
1 parent 86b1ae6 commit 691faaa
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@
<div>
<div class="container">
<div>
<div style="font-size: 200px; math-style: display">
<div style="font-size: 200px; math-style: normal">
<div id="autoDisplay" style="font-size: scriptlevel(auto)"></div>
</div>
<div style="font-size: 500px; math-style: inline">
<div style="font-size: 500px; math-style: compact">
<div id="autoInline" style="font-size: scriptlevel(auto)"></div>
</div>
</div>
<div style="font-size: 2000px;">
<div style="math-style: display; font-size: scriptlevel(7)">
<div style="math-style: normal; font-size: scriptlevel(7)">
<div id="autoDisplayFrom7" style="font-size: scriptlevel(auto)"></div>
</div>
<div style="math-style: inline; font-size: scriptlevel(7)">
<div style="math-style: compact; font-size: scriptlevel(7)">
<div id="autoInlineFrom7" style="font-size: scriptlevel(auto)"></div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</head>
<body>
<p>Test passes if you see a square of side 100 × 0.71^(0 − 0) = 100px.</p>
<div class="container" style="math-style: display;">
<div class="container" style="math-style: normal;">
<div style="font-size: scriptlevel(auto)">X</div>
</div>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</head>
<body>
<p>Test passes if you see a square of side 500 × 0.71^(1 − 0) = 355px.</p>
<div class="container" style="math-style: inline;">
<div class="container" style="math-style: compact;">
<div style="font-size: scriptlevel(auto)">X</div>
</div>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
</style>
</head>
<body>
<p>Test passes if you see a square of side 500 × 0.71^(1 − 0) = 355px.</p>
<p>Test passes if you see a square of side 500px.</p>
<div class="container">
<div style="font-size: 355px">X</div>
<div style="font-size: 500px">X</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3746">
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#the-math-script-level-property">
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#the-math-style-property">
<meta name="assert" content="Initial value of math-style is 'inline'">
<meta name="assert" content="Initial value of math-style is 'normal'">
<link rel="match" href="math-script-level-auto-and-math-style-003.tentative-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
Expand All @@ -18,7 +18,7 @@
</style>
</head>
<body>
<p>Test passes if you see a square of side 500 × 0.71^(1 − 0) = 355px.</p>
<p>Test passes if you see a square of side 500px.</p>
<div class="container">
<div style="font-size: scriptlevel(auto)">X</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
</style>
</head>
<body>
<p>Test passes if you see a square of side 500 × 0.71^(1 − 0) = 355px.</p>
<p>Test passes if you see a square of side 500px.</p>
<div class="container">
<div>
<div>
<div style="font-size: 355px">X</div>
<div style="font-size: 500px">X</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3746">
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#the-math-script-level-property">
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#the-math-style-property">
<meta name="assert" content="Initial value of math-style is 'inline'">
<meta name="assert" content="Initial value of math-style is 'normal'">
<link rel="match" href="math-script-level-auto-and-math-style-004.tentative-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
Expand All @@ -18,9 +18,9 @@
</style>
</head>
<body>
<p>Test passes if you see a square of side 500 × 0.71^(1 − 0) = 355px.</p>
<p>Test passes if you see a square of side 500px.</p>
<div class="container">
<div style="math-style: display">
<div style="math-style: compact">
<div style="math-style: initial">
<div style="font-size: scriptlevel(auto)">X</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<body>
<p>Test passes if you see a square of side 100 × 0.71^(0 − 0) = 100px.</p>
<div class="container">
<div style="math-style: display;">
<div style="math-style: normal;">
<div>
<div>
<div style="font-size: scriptlevel(auto)">X</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
setup({ explicit_done: true });
window.addEventListener("load", function() {
test(function() {
assert_equals(mathStyle("initial"), "inline");
assert_equals(mathStyle("initial"), "normal");
}, "Initial value of math-style");
test(function() {
assert_equals(mathStyle("specifiedInline"), "inline");
assert_equals(mathStyle("specifiedDisplay"), "display");
assert_equals(mathStyle("specifiedInline"), "compact");
assert_equals(mathStyle("specifiedDisplay"), "normal");
}, "Specified values of math-style");
test(function() {
assert_equals(mathStyle("inheritedInline"), "inline");
assert_equals(mathStyle("inheritedDisplay"), "display");
assert_equals(mathStyle("inheritedInline"), "compact");
assert_equals(mathStyle("inheritedDisplay"), "normal");
}, "Inherited values of math-style");
done();
});
Expand All @@ -33,10 +33,10 @@
<body>
<div id="log"></div>
<div id="initial"></div>
<div id="specifiedInline" style="math-style: inline">
<div id="specifiedInline" style="math-style: compact">
<div id="inheritedInline"></div>
</div>
<div id="specifiedDisplay" style="math-style: display">
<div id="specifiedDisplay" style="math-style: normal">
<div id="inheritedDisplay"></div>
</div>
</body>
Expand Down
6 changes: 3 additions & 3 deletions mathml/relations/css-styling/attribute-mapping-002.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
}, `scriptlevel on the ${tag} element is mapped to font-size: scriptlevel(...)`);

test(function() {
assert_equals(style.getPropertyValue("math-style"), "inline", "no attribute");
assert_equals(style.getPropertyValue("math-style"), "compact", "no attribute");
element.setAttribute("displaystyle", "true");
assert_equals(style.getPropertyValue("math-style"), "display", "attribute specified");
assert_equals(style.getPropertyValue("math-style"), "normal", "attribute specified");
element.setAttribute("displaystyle", "TrUe");
assert_equals(style.getPropertyValue("math-style"), "display", "case insensitive");
assert_equals(style.getPropertyValue("math-style"), "normal", "case insensitive");
}, `displaystyle on the ${tag} element is mapped to CSS math-style`);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</math>
</p>
<p>displaystyle:
<math style="math-style: inline">
<math style="math-style: compact">
<munder>
<mo movablelimits="true">X</mo>
<mo>X</mo>
Expand Down
2 changes: 1 addition & 1 deletion mathml/relations/css-styling/presentational-hints-001.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</math>
</p>
<p>displaystyle:
<math displaystyle="true" style="math-style: inline">
<math displaystyle="true" style="math-style: compact">
<munder>
<mo movablelimits="true">X</mo>
<mo>X</mo>
Expand Down

0 comments on commit 691faaa

Please sign in to comment.