Skip to content

Commit

Permalink
Add WPT test for CSSStyleRule.style property
Browse files Browse the repository at this point in the history
  • Loading branch information
KiChjang committed Dec 18, 2016
1 parent 4738ce1 commit aa99f18
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.

This file was deleted.

3 changes: 0 additions & 3 deletions tests/wpt/metadata-css/cssom-1_dev/html/interfaces.htm.ini
Expand Up @@ -123,9 +123,6 @@
[CSSStyleRule interface: style_element.sheet.cssRules[0\] must inherit property "selectorText" with the proper type (0)]
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)]
expected: FAIL

Expand Down
6 changes: 6 additions & 0 deletions tests/wpt/metadata/MANIFEST.json
Expand Up @@ -39695,6 +39695,12 @@
"url": "/cssom/CSSRuleList.html"
}
],
"cssom/CSSStyleRule.html": [
{
"path": "cssom/CSSStyleRule.html",
"url": "/cssom/CSSStyleRule.html"
}
],
"cssom/CSSStyleSheet.html": [
{
"path": "cssom/CSSStyleSheet.html",
Expand Down
24 changes: 24 additions & 0 deletions tests/wpt/web-platform-tests/cssom/CSSStyleRule.html
@@ -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>

0 comments on commit aa99f18

Please sign in to comment.