W3C home > Mailing lists > Public > www-svg@w3.org > February 2012

Re: display:none and mixed SVG and HTML

From: Alex Danilo <alex@abbra.com>
Date: Thu, 02 Feb 2012 23:08:39 +1100
Message-Id: <FQLRYL.YSKKVIHE4TPL@abbra.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Brian Birtles <bbirtles@mozilla.com>, www-svg <www-svg@w3.org>

--Original Message--:
>On Wed, Feb 1, 2012 at 11:38 PM, Brian Birtles <bbirtles@mozilla.com> wrote:
>> <snip/>
>> So in summary:
>> A. When display:none is first encountered on an SVG element other than the
>> outermost SVG element in a document, SVG rendering behaviour applies and the
>> element and its children may still be referenced and rendered elsewhere
>> where permitted by SVG (e.g. patterns, filters etc.)
>> B. When display:none is first encountered on an HTML element or an outermost
>> SVG element in a compound document the whole subtree from that element
>> onwards is not available for rendering. Attempts to reference content from
>> that subtree will behave as if the target element was not found.
>> The seems to more-or-less correspond with what I've observed in WebKit. For
>> Gecko this is being tracked in bug 376027.[7]
>> Your feedback would be very much appreciated! Perhaps there are other
>> permutations worth clarifying?
>> Best regards,
>> Brian Birtles
>> [1] http://www.w3.org/TR/SVG11/painting.html#DisplayProperty, "The Ądisplay˘
>> property only affects the direct rendering of a given element, whereas it
>> does not prevent elements from being referenced by other elements."
>> [2] http://www.w3.org/TR/SVG11/filters.html#FilterElement
>> [3] http://www.w3.org/TR/SVG11/pservers.html#LinearGradientElement
>> [4] http://www.w3.org/TR/SVG11/masking.html#ClipPathElement
>> [5] https://bug376027.bugzilla.mozilla.org/attachment.cgi?id=593735
>> [6] http://www.w3.org/TR/SVG11/pservers.html#PatternElement
>> [7] https://bugzilla.mozilla.org/show_bug.cgi?id=376027
>I disagree with this.
>For one, I don't think we should be enshrining any functionality
>differences between HTML and SVG unless absolutely necessary.


The tree is the document model.

Hence it is all available for reference regardless of any display="none"
on an ancestor. Rendering is orthogonal to the document model.


>For two, "<p style=display:none><img id=foo></p>" will still draw the
>image when you reference it with the element() function from CSS.
>(This is currently only implemented in Firefox, as I specced it after
>they revealed an experimental implementation.)  It's not perfect quite
>yet - for example, if the image was an animated GIF, only the first
>frame will show in the above example (while it would be animated if
>the image was visible).  That can be considered a bug, though.  This
>is basically identical to the situation you're talking about, though -
>if, instead of <img>, I had <svg><pattern /></svg>, I should be able
>to reference it just the same.
Received on Thursday, 2 February 2012 12:09:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:34 UTC