[svgwg] Issue: Use !important UA stylesheet rule to override display property for never-rendered elements marked as Entire spec

AmeliaBR has just labeled an issue for https://github.com/w3c/svgwg as
 "Entire spec":

== Use !important UA stylesheet rule to override display property for 
never-rendered elements ==
We currently have a lot of repeated prose in SVG 2 about how the 
`display` property doesn't apply to certain elements (the 
[never-rendered 
elements](https://svgwg.org/svg2-draft/render.html#TermNeverRenderedElement),
 in the terminology I added to the rendering chapter).

As I was looking up better ways to define the behavior of `<symbol>` 
from a Shadow DOM perspective (i.e., never-rendered directly, but 
rendered when re-used), I came upon the solution that it can be 
defined as an `!important` rule in the user agent stylesheet.

As per [CSS Cascading and 
Inheritance](https://www.w3.org/TR/css-cascade-4/#importance):

> User agent style sheets may also contain !important declarations. 
These override all author and user declarations.

In other words, instead of saying that `display` doesn't apply to 
these elements, we can just say that, no matter what CSS rules you 
apply elsewhere, a user agent `display: none !important` rule 
overrides them.

The net behavior is the same, but it's more logically consistent with 
CSS in general.  The only user-facing change is that if you 
`getComputedStyle()` for a never-rendered SVG element, you would now 
explicitly get `display: none` returned.

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

Received on Tuesday, 5 July 2016 19:33:03 UTC