Re: [csswg-drafts] [cssom][css-syntax] Initial filling the CSS rules of a CSS style sheet or a grouping rule

I think, in general, it doesn't make much sense to have a procedure just for inserting existing CSS rule objects into a stylesheet.

CSS rule objects need to have corresponding stylesheet when they are created, because parsing CSS rules actually depend on its context in the stylesheet. Specifically, parsing selectors need the namespace information, and parsing url value needs the url and other security information of the stylesheet. Parsing of some property value also depends on the document's mode.

Reapplying these information to a parsed CSS rule when inserting into a stylesheet may be possible, but it is wasteful, and doesn't match what browsers currently do.

-- 
GitHub Notification of comment by upsuper
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1754#issuecomment-326153187 using your GitHub account

Received on Thursday, 31 August 2017 00:12:07 UTC