W3C home > Mailing lists > Public > www-svg@w3.org > August 2008

Re: Can symbol contain width and height attributes?

From: Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>
Date: Thu, 14 Aug 2008 10:40:45 +0200
To: "Jiri Klement" <jiri.klement@gmail.com>, www-svg@w3.org
Message-Id: <200808141040.46355.Dr.O.Hoffmann@gmx.de>

Jiri Klement:
> My interpretation is the same as yours for this example. But lets have
> width and height in symbol:
>
> ...
> <symbol id="x" viewBox="-30 20 110 700" width="200" height="220"
> preserveAspectRatio="none"
> fill="blue" ...>
>
> ...
> </symbol>
>
> ...
> <use xlink:href="#x" x="100" y="140" fill="red" .../>
>
> Specification says 'use' is replaced by deep copy of 'symbol' with
> 'symbol' replaced by 'svg'. If you copy 'symbol' attributes as well,
> then the result is exactly the same as if width and height was in
> 'use' instead of 'symbol'
>
> <g transform="translate(100,140)"  fill="red" ...>
>
> <svg id="x" viewBox="-30 20 110 700" preserveAspectRatio="none"
> width="200" height="220" fill="blue" ...>
>
> ...
> </svg>
>
> </g>
>

No, because width or height are not part of the DTD for symbol, the
error processing of SVG1.1 notes to render the document up to the
error and to give some indication, therefore the referenced symbol
will never be rendered.

The currently fictive SVG1.2 error processing style (derived from
existing SVGT1.2, not having a symbol) might be simply to ignore width 
and height for symbol, therefore for the 'replacement svg' we will get
for both the value 100%. But obviously this is currently only 
speculative, what might happen in a future version, or such attributes
might be really added. Currently we have symbol in SVG1.1 and the 
error processing rules are in such a way, that the symbol will never
be rendered, therefore nothing is copied at all in the 'replacement
svg', no defined attributes and no others. This will typically ensure,
that the author will already remove the wrong attributes from the
symbol to get the document rendered, therefore in published documents
the problem should never occur (according to the error processing
philosophy of SVG1.1 ;o)
Received on Thursday, 14 August 2008 09:03:04 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:40 GMT