mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Add WPT test for CSSStyleRule.style property
This commit is contained in:
parent
4738ce1af5
commit
aa99f18806
4 changed files with 30 additions and 8 deletions
24
tests/wpt/web-platform-tests/cssom/CSSStyleRule.html
Normal file
24
tests/wpt/web-platform-tests/cssom/CSSStyleRule.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style type="text/css" id="styleElement">
|
||||
div { margin: 10px; padding: 0px; }
|
||||
</style>
|
||||
<script>
|
||||
var styleSheet = document.getElementById("styleElement").sheet;
|
||||
var rule = styleSheet.cssRules[0];
|
||||
|
||||
test(function() {
|
||||
assert_equals(typeof rule.style, "object");
|
||||
assert_equals(rule.style.margin, "10px");
|
||||
assert_equals(rule.style.padding, "0px");
|
||||
|
||||
rule.style.padding = "5px";
|
||||
rule.style.border = "1px solid";
|
||||
|
||||
assert_equals(rule.style.padding, "5px");
|
||||
assert_equals(rule.style.border, "1px solid");
|
||||
}, "CSSStyleRule: style property");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue