Changes

Jump to: navigation, search

SVG:Sizing

373 bytes added, 15:58, 21 August 2007
no edit summary
<h2>Introduction</h2>
This page is an in-progress attempt of [[User:Jonathan_Watt|mine]] to make sense of viewport sizing for SVG content (the sizing of the rectangular area the SVG is given to draw into). You'd think it would be simple, what with one 'width' and one 'height' attribute. Unfortunately, there are a lot of other things to consider too, such as different unit types, omitted attribute(s), the CSS 'width', 'height', 'min-width', 'min-height', 'max-width', 'max-height' and 'background-image' properties, the 'viewBox' attribute, intrinsic width, height and aspect ratio, and whether the SVG is rendering standalone, embedded inline or embedded by reference. All add to the fun. In this document I'm only going to focus on a few important issues that I consider to be unresolved/troublesome and in need of further thought before implementation begins.
<h2>SVG width/height vs. CSS width/height</h2>
goes against the letter of the specification, but actually honors the intent behind the letter.
 
The way SVG requires the 'width' and 'height' attributes to be overridden by xxx does not fit well with mapping into style where uses values are expected to be close/related to the specified values.
The former approach would have the advantage of being the most intuitive for authors. The latter approach solves the problem of the 'display' property (i.e. [http://lists.w3.org/Archives/Public/www-svg/2005May/0022.html what you do with |display:inline;| on SVG]), and unless the user sets only one of the CSS properties 'width' and 'height' on the SVG while also having 'width' and 'height' attributes, they won't notice a difference to the former approach (well, as long as percentage attribute values are intrinsic).
Confirm, emeritus
969
edits

Navigation menu