[svgwg] Use !important UA stylesheet rule to override display property for never-rendered elements

AmeliaBR has just created a new issue for 
https://github.com/w3c/svgwg:

== 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.

Please view or discuss this issue at 
https://github.com/w3c/svgwg/issues/192 using your GitHub account

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