Auto merge of #14304 - KiChjang:css-style-rule-style, r=Manishearth

Implement CSSStyleRule.style

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14209 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14304)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-12-19 11:29:02 -08:00 committed by GitHub
commit d05cae5072
9 changed files with 205 additions and 131 deletions

View file

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

View file

@ -120,15 +120,9 @@
[CSSStyleRule interface: attribute selectorText]
expected: FAIL
[CSSStyleRule interface: attribute style]
expected: FAIL
[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

View file

@ -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",

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>