Re: [cssom] CSSNamespaceRule

On Tue, 11 Mar 2014 12:15:11 +0100, Daniel Glazman  
<daniel.glazman@disruptive-innovations.com> wrote:

> http://dev.w3.org/csswg/cssom says [1] about CSSNamespaceRule that
> setting namespaceURI or prefix attribute should throw an exception if
> the parent stylesheet contains anything other than @charset, @import
> and @namespace rules. I fail understanding why.

Because otherwise, changing it would affect other rules in the stylesheet,  
and it was not specified how that would happen and it wasn't clear that  
people were interested in supporting it.

> If the namespace rule
> is already in the OM, then it's valid wrt CSS syntax and position in
> the sheet. I think this is wrong. As an editor vendor, the setters on
> these two attributes seem to me, as is, totally useless: a namespace
> rule in a complete stylesheet already containing style rules is, because
> of the above, not modifyable; an editor would have no other choice but
> to delete it and insert a new one to provide the user with namespaceURI
> or prefix editing.

Actually it wouldn't need to throw away the rule itself, but instead all  
other rules after it. I agree it is not particularly useful compared to  
throwing away all rules, though.

> I recommend just throwing away the two "On setting..." lists in section
> 6.4.10, it seems like an erronenous copy and paste from [2] item 7.

It's not an erroneous copy and paste, it's intentional.

> On another note, I don't understand better item 7 in [2]... It seems
> to me totally wrong and a blocker to editors.
>
> [1] http://dev.w3.org/csswg/cssom/#the-cssnamespacerule-interface
> [2] http://dev.w3.org/csswg/cssom/#insert-a-css-rule

When a namespace rule is changed and there are rules after it, what do you  
want to happen? Do you want the other rules to be affected or not? Just  
throwing away the step as you recommend above would result in the other  
rules not being affected by the change.

-- 
Simon Pieters
Opera Software

Received on Tuesday, 18 March 2014 11:56:55 UTC