Bug 1570142 [wpt PR 18181] - MathML attribute-mapping: Add some asserts to ensure attribute values…, a=testonly

Automatic update from web-platform-tests
MathML attribute-mapping: Add some asserts to ensure attribute values are case insensitive. (#18181)

--

wpt-commits: 3383f62628eafc55cea20d4d85cdd2cfded9b657
wpt-pr: 18181
This commit is contained in:
Frédéric Wang 2019-08-01 15:27:56 +00:00 committed by moz-wptsync-bot
parent 77a1273bda
commit 83d8e60cde
2 changed files with 18 additions and 0 deletions

View File

@ -31,6 +31,8 @@
assert_equals(style.getPropertyValue("direction"), "ltr", "no attribute");
element.setAttribute("dir", "rtl");
assert_equals(style.getPropertyValue("direction"), "rtl", "attribute specified");
element.setAttribute("dir", "RtL");
assert_equals(style.getPropertyValue("direction"), "rtl", "case insensitive");
}, `dir on the ${tag} element is mapped to CSS direction`)
test(function() {
@ -40,6 +42,10 @@
"no attribute");
element.setAttribute("mathcolor", "black");
assert_equals(style.getPropertyValue("color"), "rgb(0, 0, 0)", "attribute specified");
// The color names are case-insensitive.
// See https://www.w3.org/TR/css-color-3/#html4
element.setAttribute("mathcolor", "GrEeN");
assert_equals(style.getPropertyValue("color"), "rgb(0, 128, 0)", "case insensitive");
}, `mathcolor on the ${tag} element is mapped to CSS color`);
test(function() {
@ -49,12 +55,20 @@
"no attribute");
element.setAttribute("mathbackground", "lightblue");
assert_equals(style.getPropertyValue("background-color"), "rgb(173, 216, 230)", "attribute specified");
// The color names are case-insensitive.
// See https://www.w3.org/TR/css-color-3/#html4
element.setAttribute("mathbackground", "YeLlOw");
assert_equals(style.getPropertyValue("background-color"), "rgb(255, 255, 0)", "case insensitive");
}, `mathbackground on the ${tag} element is mapped to CSS background-color`);
test(function() {
assert_equals(style.getPropertyValue("font-size"), "50px", "no attribute");
element.setAttribute("mathsize", "20px");
assert_equals(style.getPropertyValue("font-size"), "20px", "attribute specified");
// unit identifiers are ASCII case-insensitive.
// https://www.w3.org/TR/css-values-3/#typedef-dimension
element.setAttribute("mathsize", "30Px");
assert_equals(style.getPropertyValue("font-size"), "30px", "case insensitive");
}, `mathsize on the ${tag} element is mapped to CSS font-size`);
});

View File

@ -27,6 +27,8 @@
"no attribute");
element.setAttribute("mathvariant", "fraktur");
assert_equals(style.getPropertyValue("text-transform"), "math-fraktur", "attribute specified");
element.setAttribute("mathvariant", "DoUbLe-StRuCk");
assert_equals(style.getPropertyValue("text-transform"), "math-double-struck", "case insensitive");
}, `mathvariant on the ${tag} element is mapped to CSS text-transform`)
test(function() {
@ -39,6 +41,8 @@
assert_equals(style.getPropertyValue("math-style"), "inline", "no attribute");
element.setAttribute("displaystyle", "true");
assert_equals(style.getPropertyValue("math-style"), "display", "attribute specified");
element.setAttribute("displaystyle", "TrUe");
assert_equals(style.getPropertyValue("math-style"), "display", "case insensitive");
}, `displaystyle on the ${tag} element is mapped to CSS math-style`);
});