Add WPT test for CSSStyleRule.style property

This commit is contained in:
Keith Yeung 2016-12-10 00:51:12 -08:00
parent 4738ce1af5
commit aa99f18806
4 changed files with 30 additions and 8 deletions

View file

@ -1,5 +0,0 @@
[cssstyledeclaration-mutability.htm]
type: testharness
[StyleSheet's CSSStyleDeclaration is mutable]
expected: FAIL

View file

@ -123,9 +123,6 @@
[CSSStyleRule interface: style_element.sheet.cssRules[0\] must inherit property "selectorText" with the proper type (0)] [CSSStyleRule interface: style_element.sheet.cssRules[0\] must inherit property "selectorText" with the proper type (0)]
expected: FAIL expected: FAIL
[CSSStyleRule interface: style_element.sheet.cssRules[0\] must inherit property "style" with the proper type (1)]
expected: FAIL
[CSSRule interface: style_element.sheet.cssRules[0\] must inherit property "parentRule" with the proper type (10)] [CSSRule interface: style_element.sheet.cssRules[0\] must inherit property "parentRule" with the proper type (10)]
expected: FAIL expected: FAIL

View file

@ -39695,6 +39695,12 @@
"url": "/cssom/CSSRuleList.html" "url": "/cssom/CSSRuleList.html"
} }
], ],
"cssom/CSSStyleRule.html": [
{
"path": "cssom/CSSStyleRule.html",
"url": "/cssom/CSSStyleRule.html"
}
],
"cssom/CSSStyleSheet.html": [ "cssom/CSSStyleSheet.html": [
{ {
"path": "cssom/CSSStyleSheet.html", "path": "cssom/CSSStyleSheet.html",

View 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>