mirror of
https://github.com/servo/servo.git
synced 2025-08-25 07:08:21 +01:00
Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64
This commit is contained in:
parent
11a89bcc47
commit
8f98acd0e7
297 changed files with 3396 additions and 1555 deletions
29
tests/wpt/web-platform-tests/css/cssom/at-namespace.html
Normal file
29
tests/wpt/web-platform-tests/css/cssom/at-namespace.html
Normal 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>
|
||||
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue