[svgwg] Issue: SVG should specify what CSS attribute selectors and class selectors match on marked as SVG Core

birtles has just labeled an issue for https://github.com/w3c/svgwg as "SVG Core":

== SVG should specify what CSS attribute selectors and class selectors match on ==
Background: [Mozilla bug 1365472](https://bugzilla.mozilla.org/show_bug.cgi?id=1365472#c12)

Given that attributes can be animated in SVG, SVG needs to specify if attribute selectors match on the animated value of the attribute or not. Similarly for class selectors.

Proposal:
* Attribute selectors match on the base value of the attribute, i.e. the same value as `getAttribute` returns since [SMIL Animation](https://www.w3.org/TR/2001/REC-smil-animation-20010904/#BasicAnim) says, "When an animation is running, it should not actually change the attribute values in the DOM." (Note that Chrome appears to have [a bug](https://bugs.chromium.org/p/chromium/issues/detail?id=735820) here.)
* Class selectors match on the set of classes applied to the element which can be affected by SMIL animation (as otherwise being able to animate the `class` attribute would be meaningless, and being able to animate this is quite useful).

That means that if we have:

```svg
<circle>
  <set attributeName="class" to="a"/>
</circle>
```

Then`circle.a` would match but `circle[class="a"]` would not.

cc @bzbarsky

See https://github.com/w3c/svgwg/issues/328

Received on Tuesday, 27 June 2017 18:16:26 UTC