Skip to content

Commit

Permalink
[mathml] Use ASCII case-insensitiveness to validate mathsize and dir
Browse files Browse the repository at this point in the history
The mathsize and dir attributes are defined modulo ASCII
case-insensitive equivalence and are mapped to CSS font-size and
direction properties [1] [2]. Since the CSS keywords are themselves
defined modulo ASCII case-insensitive equivalence [3], there is not need
to filter out other (Unicode) case-insensitive equivalent keywords
(e.g. "ſmall") in the MathML Code, they will be rejected by the CSS
parser.

This CL replaces DeprecatedEqualIgnoringCase with EqualIgnoringASCIICase
and adds tests to ensure that (Unicode) case-insensitive equivalent
strings remain disallowed.

[1] https://mathml-refresh.github.io/mathml-core/#global-attributes
[2] w3c/mathml#178
[3] https://www.w3.org/TR/css-values-4/#keywords

Bug: 6606
Bug: 627682
Change-Id: Ice84368c8cc7e8fff9faccb454c23fad87b99d59
  • Loading branch information
fred-wang authored and chromium-wpt-export-bot committed Dec 17, 2019
1 parent 8662126 commit 40d85a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>mathsize and css keywords</title>
</head>
<body>
<p>Test passes if you see ten "A" of equal size:</p>
<p>Test passes if you see 14 "A" of equal size:</p>
<math>
<mtext>A</mtext>
<mtext>A</mtext>
Expand All @@ -17,6 +17,10 @@
<mtext>A</mtext>
<mtext>A</mtext>
<mtext>A</mtext>
<mtext>A</mtext>
<mtext>A</mtext>
<mtext>A</mtext>
<mtext>A</mtext>
</math>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<script src="/mathml/support/feature-detection.js"></script>
</head>
<body>
<p>Test passes if you see ten "A" of equal size:</p>
<p>Test passes if you see 14 "A" of equal size:</p>
<math>
<mtext>A</mtext>
<mtext mathsize="xx-small">A</mtext>
Expand All @@ -22,6 +22,10 @@
<mtext mathsize="xx-large">A</mtext>
<mtext mathsize="larger">A</mtext>
<mtext mathsize="smaller">A</mtext>
<mtext mathsize="xx-ſmall">A</mtext>
<mtext mathsize="x-ſmall">A</mtext>
<mtext mathsize="ſmall">A</mtext>
<mtext mathsize="ſmaller">A</mtext>
</math>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_mathsize");</script>
Expand Down

0 comments on commit 40d85a2

Please sign in to comment.