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

RE: Initial Viewport

From: Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>
Date: Wed, 12 Sep 2012 14:36:16 +0200
To: www-svg@w3.org, Nick.Hofstede@inventivegroup.com
Message-Id: <201209121436.16363.Dr.O.Hoffmann@gmx.de>
Hello,

(just my own observation/opinion on the problem)

If there is a difference in presentation for an SVG document without having 
width and height attributes noted in the root svg element and having them 
with values of 100%, I think, such a differences surely indicates a bug of
the viewer.

In general it can be indeed problematic to reference in a format like HTML4
(or the XHTML variants depending on this recommendation) an SVG document
with no indication of the image size (for example width and height for img or 
object) and only percentage values for the width and height within the
SVG document.
This problem occurs, because HTML4 seems to assume, that the 
referenced image or object always has some size information, that
can be finally converted into something like a specific number of device 
pixels.
On the other hand, SVG seems to assume, that the referencing document
always provides information about the size of the viewport, the SVG document
has to be presented in.
CSS rules finally cannot help here, because this is not necessarily only a
decorative problem - and as far as I remember, the size suggestions from
CSS are not very meaningful anyway. but not meaningless enough to force
authors to provide useful information, if the SVG document itself indicates
a size of 100% - but theses rules may apply in case a stylesheet is provided
and interpreted for the embedding document (this can be a user stylesheet
or user-agent stylesheet as well).

Therefore I think, authors of (X)HTML documents referencing such SVG document
always have to provide some information about the size of the viewport for the
SVG document to avoid arbitrary nonsense.
Often or typically this approach is more useful than not to use a size of 100%
in the SVG document.
In other formats or future variants of (X)HTML it might be useful to specify 
the size of such a default viewport - for example 100% of the width of the
viewport size of the (X)HTML document (including the implication, that this
can be modified again decoratively with for example CSS).
Typically in (X)HTML the height of a document is determined by its content,
therefore it will not be meaningful to make the size of such a default 
viewport for an object or image dependent on the height of the (X)HTML
document.
For example in current SVG recommendations elements like image always
provide a size for the viewport. If other formats have features to embed 
other documents/images/videos etc, it can be expected, that they define
exactly some default viewport size or recommend, that authors always provide
such information to get a presentation at all.
Concerning (X)HTML this looks like a task for the current 'HTML5'-WG, if they
do not already have this in their draft.


Olaf
Received on Wednesday, 12 September 2012 12:36:52 GMT

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