Files
firefox/testing/web-platform/tests/css/cssom/insertRule-syntax-error-01.html
T
Chris Nardi f3b70eb79a Bug 1442493 [wpt PR 9739] - Upstream some CSSOM tests, a=testonly
Automatic update from web-platform-testsUpstream some CSSOM tests

Tests that were duplicates of those already existing in
web-platform-tests were deleted. Other tests were either moved to the
CSSOM directory in WPT, or appended to already existing tests. The
README was also deleted, as it is no longer accurate.

Change-Id: I0acb41c6102a572a1fc2401630732a8ff1c5263d
Reviewed-on: https://chromium-review.googlesource.com/945135
Reviewed-by: Robert Ma <[email protected]>
Reviewed-by: Darren Shen <[email protected]>
Commit-Queue: Chris Nardi <[email protected]>
Cr-Commit-Position: refs/heads/master@{#541716}

wpt-commits: 8ef3fed7cdd966fbbd831215cedc0ee4b8ea8d6e
wpt-pr: 9739
wpt-commits: 8ef3fed7cdd966fbbd831215cedc0ee4b8ea8d6e
wpt-pr: 9739
2018-03-31 22:32:51 +01:00

15 lines
621 B
HTML

<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/cssom-1/#insert-a-css-rule">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
p { color: green; }
</style>
<p id="test">This text should be green.</p>
<script>
test(function() {
assert_throws("SyntaxError", () => document.styleSheets[0].insertRule("p { color: red; } garbage", 1));
assert_equals(getComputedStyle(document.getElementById("test")).color, "rgb(0, 128, 0)");
}, "A syntax error in insertRule should throw and not affect the style of the page");
</script>