Re: [svgwg] SVG should specify what CSS attribute selectors and class selectors match on

Class and attribute selectors aren't perfectly symmetrical, given that class selectors are processed (tokenized). Even if you use the token form of the attribute selector, I'm sure there could be weird edge cases where you get inconsistent results.  

In general, attribute selectors always match the literal attribute values, even if those are not valid values for the corresponding DOM properties, so you can get disconnects that way.  For example, `lang` selectors or other pseudoclasses could be out of sync with querying the actual attributes they are based on.

But that said: 

I would be quite happy to move towards an interpretation of SVG animation as more a declarative way of changing attributes, so the actual attribute value would change while the animation was in effect (just like it does if you're animating with JS).  In other words, if you `<set>` an attribute on an element, treat it as if it has that attribute for selector-matching.

But I think that goes against the argument for dropping `animVal` from SVG 2 (and I think some browsers already): there are DOM costs for keeping everything in sync.

-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/328#issuecomment-311459544 using your GitHub account

Received on Tuesday, 27 June 2017 19:25:21 UTC