Re: [SVGT 1.2] Question on sizing of the outermost <svg>

Boris,
This is the official response from the SVG Working Group. We have
modified the specification to address your comments. In particular:

* The reference has been changed to chapter 10 of the CSS spec
* The spec has been clarified to make sure that it is clear that
specified CSS properties for width and height take precedence over
'width' and 'height' attributes on the root 'svg' element
* The spec has been clarified to say that CSS properties for width and
height also apply to inline embedded SVG content within a parent
document which is styled by CSS.

Please reply to this mail within two weeks if these changes do not
address your concerns.

Thanks

SVG WG

At 01:15 PM 5/9/2005, Boris Zbarsky wrote:

>I have a question about the sizing of outermost <svg> elements.
>
>In section 7.2 [1], the specification says:
>
>   The width attribute on the 'svg' element establishes the viewport's
>   width, unless the following conditions are met:
>
>     * the SVG content is a separately stored resource that is embedded
>       by reference (such as the 'object' element in [XHTML]), or the
>       SVG content is embedded inline within a containing document;
>     * and the referencing element or containing document is styled
>       using CSS [CSS2] or XSL [XSL];
>     * and there are CSS-compatible positioning properties [ CSS2-POSN]
>       specified on the referencing element (e.g., the 'object'
element)
>       or on the containing document's 'svg' element that are
sufficient
>       to establish the width of the viewport.
>
>Here "[CSS2-POSN]" is a link to the Visual Formatting Model chapter 
>(chapter 9) of CSS2.  Unfortunately, the "width" property in CSS2 is in

>the "Visual formatting model details" chapter (chapter 10).

Boris,
Thanks for pointing this out. This incorrect reference has been in the
SVG 
spec forever. The guy who edited the SVG 1.0 spec screwed up. (Guess who

that was.) I believe the correct reference should be to chapter 10, as
you 
say: http://www.w3.org/TR/REC-CSS2/visudet.html.

>This leaves me unsure as to whether an outermost <svg:svg> element in
an 
>XHTML document styled with "width: 100px" and having width="50px" as an

>attribute should be 100px wide or 50px wide.  I'm assuming the intent
is 
>that it should be the former, right?  It may be worth adjusting the
text 
>to make that clearer.

Yes, the former.


>Further, there is the question of interaction with the CSS display 
>property, since per CSS width/height do not apply to display:inline 
>non-replaced elements.  I guess the intention is that <svg:svg> should 
>essentially be a replaced element in CSS terms?  That is, with the
default 
>display value of "inline" the specified values of width and height
should 
>affect the computed width and height?  That would make some sense to
me, 
>since a CSS renderer can't really do anything with an <svg:svg> other
than 
>reserve space for its desired size in the CSS box model...

Yes, that makes sense to me: compute the width/height of an inline
svg:svg 
element following the rules for CSS inline, replaced elements.

Jon


>-Boris
>
>[1] http://www.w3.org/TR/SVGMobile12/coords.html#InitialViewport

Received on Tuesday, 1 November 2005 11:53:23 UTC