Re: [cssom] Behaviour of DOM API when changing CSSRule

On Thu, 12 Mar 2015 07:09:34 +0100, Ian Kilpatrick  
<ikilpatrick@chromium.org> wrote:

> Hi all,
>
> When you change a CSSRule via CSSOM api, e.g.
> document.styleSheets[3].cssRules[0].color = 'red';
>
> What should be the behavior of subsequently querying the textContent of  
> the
> same stylesheet element? E.g.
> document.head.children[7].textContent;
>
> Should it remain the same or return the updated version of the  
> stylesheet?

Nothing in CSSOM or HTML says to change the content of the style element,  
so it should remain the same.

Note that mutating element.style is defined to update the style content  
attribute, though.
http://dev.w3.org/csswg/cssom/#the-elementcssinlinestyle-interface

> Thanks,
> Ian
>
> [1] From: http://crbug.com/147285
> [2] Example: http://jsfiddle.net/T4aCC/29/


-- 
Simon Pieters
Opera Software

Received on Thursday, 12 March 2015 10:15:08 UTC