W3C home > Mailing lists > Public > www-style@w3.org > March 2015

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

From: Simon Pieters <simonp@opera.com>
Date: Thu, 12 Mar 2015 11:14:36 +0100
To: www-style@w3.org, "Ian Kilpatrick" <ikilpatrick@chromium.org>
Message-ID: <op.xvdqqmdbidj3kv@simons-mbp>
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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:30 UTC