Re: viewport units in SVG

On Wed, Jul 23, 2014 at 5:44 AM, Chris Lilley <chris@w3.org> wrote:
>> What do we do with viewport units in SVG? I would assume that they
>> mean the same for SVG roots as for CSS in HTML.
>
> Meaning they are window-derived coordinates that have nothing to to
> with the (SVG) viewport? Yes.

I've been thinking about this for a bit, and I think I agree - the
viewport units should maintain their CSS definition of being based on
the screen, not an SVG viewport.  As you say later in your response,
people use the viewport units for a specific purpose - making
something size relative to the screen size - and it would be
surprising if that wasn't true when used in SVG.

There's one case in CSS where that's not strictly true: if you use
viewport units are used inside of an iframe'd document, they're
relative to the size of the iframe, as that's the "size of the screen"
as far as the CSS inside of the iframe document can tell.  (It applies
to MQs too, etc.)  This means that a *linked* SVG, via <iframe> or
<img> or the like, would use the linking element's dimensions to
define its viewport units, but an inline SVG would use the outer
document.  This seems fine to me.

~TJ

Received on Wednesday, 23 July 2014 14:26:20 UTC