W3C home > Mailing lists > Public > www-svg@w3.org > July 2015

Default size and autodetection (SVG 2?)

From: anatoly techtonik <techtonik@gmail.com>
Date: Fri, 17 Jul 2015 11:49:19 +0300
Message-ID: <CAPkN8xLqpA==Znq+aNsU5XR19WjtX-1QmaWCWCysZvJyQF6WbQ@mail.gmail.com>
To: www-svg@w3.org
Hi,

If I load SVG into <img> and top <svg> tag
doesn't contain width/height, the browser
shows the image as 300x150. Even this
simple box is rendered as 10x10 black square
on an empty 300x150 field:

<svg xmlns="http://www.w3.org/2000/svg">
  <rect width="10" height="10"/>
</svg>

If you load it with <img> tag, there is no way
to query and fix the dimensions of the image.
This is frustrating, because for .jpg and .png
browser is able to get the size automatically.

In <svg> you need to take care that it has
proper width and height attributes, which is
very daunting to do manually. Why browsers
don't autodetect the width/height? They
render .svg much like .jpg or .png anyway.


A side question about SVG2 process.
Are there any efforts to make basic use of
SVG 2 less overburdened with details?
Some people give up even after xmlns tag,
and I think most don't really want to care
about stuff like setting dimensions explicitly.
Are there any guidelines that recommend
following user expectations instead of trying
to create and teach academically right way?

-- 
anatoly t.
Received on Friday, 17 July 2015 08:50:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:55:02 UTC