[csswg-drafts] [cssom] CSSStyleRule.style liveness (?) differs across browsers

jyc has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom] CSSStyleRule.style liveness (?) differs across browsers ==
Is [CSSStyleRule.style](https://drafts.csswg.org/cssom/#dom-cssstylerule-style) supposed to be live (if that's the right term)? In Firefox and Chrome, the following example will output "", while in Safari it will output "3px":

```
<style id="styles">
div { margin: 10px; }
</style>

<script>
var style = document.getElementById("styles").sheet;
var ruleList = style.cssRules;
var rule = ruleList[0];

rule.style.margin = "3px";

//console.log("before " + rule.style.margin);
// in all browsers, this is '3px'

// this is what assert_readonly in testharness.js does
var initial = rule["style"];
rule["style"] = initial + "a";
rule["style"] = initial;

console.log(rule.style.margin);
// in Chrome and Firefox, this is '', while in Safari, this is '3px'

rule.style.margin = "10px";

//console.log("end " + rule.style.margin);
// in all browsers, this is '10px'
</script>
```

This is sort of a related issue for Typed OM, where the eventual decision was for the corresponding object to be live: https://github.com/w3c/css-houdini-drafts/issues/149

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1506 using your GitHub account

Received on Wednesday, 7 June 2017 18:54:26 UTC