[css3-images] Referencing element directly with element() from Tab Atkins Jr. on 2012-02-22 (www-style@w3.org from February 2012) (original) (raw)

[rearranged for better reply order]

On Wed, Feb 22, 2012 at 3:15 AM, Erik Dahlstrom <ed@opera.com> wrote:

It seems to me that even the paint server model (svg gradients, patterns) that is defined in the spec suffers from the same problem, even if the contained only elements inside a the itself would still take up space in the main document.

If the SVG contains only paint servers, you can set it to display:none. They'll still be usable in element().

using the element() notation and referencing an element[1], I'm wondering if it is possible to reference a whole fragment which in itself is not rendered? One that only renders when referenced via element() but which is invisible and doesn't take up any space in the main document?

One way to solve that might be to use cssElementMap, but that has the drawback of having to use scripting. Is there a script-less way of doing this?

Please consider making as a "paint source" as well. That would make svg easier to use here, since you wouldn't have to wrap the content inside a element.

As Boris says, you can't do this in general, since there may be dependencies on the outside world for style information, percentages, etc. I could finesse a definition that avoided some of these, but it's simpler to just require and be done with it, both from a spec perspective and an author-learning perspective.

Hmm. removes the layout-information dependencies, but not the style dependencies. I've now corrected that so that paint sources that aren't rendered use initial values if they try to inherit.

If I understand the spec correctly, elements that are "paint sources" (e.g , and

Yes, display:none is included in that. I've clarified the term now - it's defined as any element that does not generate a box, or which is a descendant of in SVG.

Are these responses acceptable?

~TJ

Received on Wednesday, 22 February 2012 17:36:40 UTC