[css3-images] Referencing element directly with element() from Erik Dahlstrom on 2012-02-24 (www-style@w3.org from February 2012) (original) (raw)

On Wed, 22 Feb 2012 18:35:48 +0100, Tab Atkins Jr. <jackalmage@gmail.com>
wrote:

[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().

Ok, that's fine.

...

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.

Ok, I guess I can live with that.

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.

Ok.

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.

The new definition of "not rendered" seems to allow creating arbitrary svg
elements in script (without an enclosing ) and inserting them into
the document and then referencing them with element(), because they won't
get boxes then as far as I know. Is that ok? I mean I could just create
the svg:pattern element and insert it for example.

In svg, if you had a inside a it wouldn't render
either, and same if it wasn't inside a . None of the paint servers
render by themselves in svg. It would be enough to set display:none on the
parent.

[[In SVG, the descendants of a element are also considered to not
be rendered. Other host languages may define additional ways in which an
element can be considered not rendered.]]

That makes it sound like SVG isn't allowed to change what is considered as
"not rendered", and I'm not really convinced that is the only case.
I'd suggest making the part a note, and also "s/Other host
languages/Host languages/".

In http://dev.w3.org/csswg/css3-images/#paint-sources:

  1. Please define what the 'painting area' that is referred to in the
    defintions of userSpaceOnUse/objectBoundingBox is.
  2. In the definition of userSpaceOnUse please clarify how width and height
    are setup.
  3. Please consider using the term "user coordinates" instead of "user
    units", and for clarity please add a link to the definition of each term
    (just to be clear on whether it's an svg term or a css term).

Cheers

Erik Dahlstrom, Core Technology Developer, Opera Software Co-Chair, W3C SVG Working Group Personal blog: http://my.opera.com/macdev_ed

Received on Friday, 24 February 2012 13:07:15 UTC