Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64

This commit is contained in:
WPT Sync Bot 2018-05-29 21:17:45 -04:00
parent 11a89bcc47
commit 8f98acd0e7
297 changed files with 3396 additions and 1555 deletions

View file

@ -0,0 +1,29 @@
<!doctype html>
<title>CSS Test: @namespace in CSSOM is not severely broken</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1464865">
<link rel="help" href="https://drafts.csswg.org/cssom/#insert-a-css-rule">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style id="s">
div { color: green }
</style>
<div>Should be green</div>
<script>
test(function() {
assert_throws("InvalidStateError", function() {
s.sheet.insertRule('@namespace myhtml url("http://www.w3.org/1999/xhtml")', 0);
});
assert_equals(s.sheet.cssRules.length, 1, "Shouldn't have been inserted");
assert_throws("SyntaxError", function() {
s.sheet.insertRule("myhtml|div { color: red !important }", 0);
});
assert_equals(s.sheet.cssRules.length, 1);
assert_equals(
getComputedStyle(document.querySelector("div")).color,
"rgb(0, 128, 0)",
"Namespace shouldn't be registered"
);
});
</script>

View file

@ -19,7 +19,7 @@
sheet.insertRule("p { color: green; }");
assert_equals(sheet.cssRules.length, 1);
assert_equals(sheet.cssRules.item(0).cssText, "p { color: green; }");
}, "inserRule with charset and omitted index argument");
}, "insertRule with charset and omitted index argument");
test(function() {
assert_equals(sheet.cssRules.length, 1);

View file

@ -20,7 +20,7 @@
assert_equals(sheet.cssRules.length, 1);
assert_throws("HierarchyRequestError", function() { sheet.insertRule("p { color: green; }"); });
assert_equals(sheet.cssRules.length, 1);
}, "inserRule with import and omitted index argument");
}, "insertRule with import and omitted index argument");
test(function() {
assert_equals(sheet.cssRules.length, 1);

View file

@ -22,7 +22,7 @@
assert_equals(sheet.cssRules.length, 3);
assert_throws("HierarchyRequestError", function() { sheet.insertRule("p { color: green; }"); });
assert_equals(sheet.cssRules.length, 3);
}, "inserRule with namespace and omitted index argument");
}, "insertRule with namespace and omitted index argument");
test(function() {
assert_equals(sheet.cssRules.length, 3);
@ -34,7 +34,7 @@
assert_equals(sheet.cssRules.length, 3);
sheet.insertRule("@import url(\"support/a-green.css\");");
assert_equals(sheet.cssRules.length, 4);
}, "inserRule with namespace and omitted index argument should insert import");
}, "insertRule with namespace and omitted index argument should insert import");
</script>
</body>
</html>

View file

@ -22,7 +22,7 @@
sheet.insertRule("p { color: green; }");
assert_equals(sheet.cssRules.length, 2);
assert_equals(sheet.cssRules.item(0).cssText, "p { color: green; }");
}, "inserRule with omitted index argument");
}, "insertRule with omitted index argument");
test(function() {
assert_equals(sheet.cssRules.length, 2);