Re: [svgwg] SVG and CSS display:contents

On Mon, Feb 13, 2017 at 12:02 PM, Amelia Bellamy-Royds
<notifications@github.com> wrote:
> This is a good question, but I think the easiest solution is to 
follow both specs as written.

I disagree. ^_^  While SVG isn't specced as working with the CSS box
model (instead hooking into 'display' directly to do something
similar), it's not hard to imagine how it would be implemented, and
putting SVG on the box model is still one of my long-term goals.  I
believe we should act in a way that's consistent with that long-term
goal.  I do have slightly different opinions on how to do so, tho:

* on a root <svg>: nothing displays. The SVG elements generate some
special kind of box, that I think only knows how to render if there's
an svg-canvas ancestor box. Take that away, and they can't display.
They don't magically become block or inline boxes.

* on a grouping element (nested <svg> or <g>): the
transform/filter/etc that element would apply is ignored, same as you
suggest.

* on a shape element: I'm inclined to say that nothing renders,
because I think it's reasonable to state that, at the language level,
shapes suppress the generation of boxes below them.  In other words,
identical to display:none, because shape elements *only* generate
their own box anyway; children are always suppressed.

* on a text element: nothing renders - like the relationship of svg
boxes to an svg-canvas ancestor, I think svg inline text needs an
svg-text ancestor to render. Remove that, and it's suppressed.

* on anything else: nothing happens, because they don't generate boxes
 anyway.


The end result is that display:contents and display:none end up almost
identical, except display:contents "unwraps" a wrapper element.

~TJ


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

Received on Monday, 13 February 2017 20:35:12 UTC