W3C home > Mailing lists > Public > www-svg@w3.org > October 2010

Re: [other topic] was [Re: inconsistency about preserveAspectRatio for <image> element] and was [Some comments on <image>]

From: Daniel Holbert <dholbert@mozilla.com>
Date: Mon, 11 Oct 2010 19:43:46 -0700
Message-ID: <4CB3CB62.3070102@mozilla.com>
To: ddailey <ddailey@zoominternet.net>
CC: www-svg@w3.org
> I do prefer the behavior of IE/ASV here to the way the spec handles it and
> cannot see why an author who says height="200" width="300" would, by
> default, want something different to happen

At least for a SVG-backed image (with a viewBox -- since
preserveAspectRatio has no effect sans-viewBox), the spec's default
behavior makes sense.

There, the default preserveAspectRatio value says: "I'm giving this SVG
image a 200-by-300 canvas.  Let it fill that canvas such that all of its
relevant content is visible and scaled consistently, and any extra space
is distributed evenly so that the image is centered."

I'd agree that the default preserveAspectRatio is less intuitive for
raster-backed images (particularly for authors used to html's <img>).
However, it has the benefit of being consistent, at least -- currently,
preserveAspectRatio has the same default value on all elements that it
applies to, which is nice.

~Daniel

On 10/11/2010 07:11 PM, ddailey wrote:
> Yes, I agree that what you're saying is a different issue. I've tried to
> change the topic of the subject line, accordingly.
> 
> I do prefer the behavior of IE/ASV here to the way the spec handles it and
> cannot see why an author who says height="200" width="300" would, by
> default, want something different to happen.  I think other authors my
> experience my same sense of betrayal (well, okay, the word is a bit of an
> exaggeration!) on this point.
> 
> cheers
> David
> ----- Original Message ----- From: "Daniel Holbert" <dholbert@mozilla.com>
> To: "ddailey" <ddailey@zoominternet.net>
> Cc: <www-svg@w3.org>
> Sent: Monday, October 11, 2010 9:44 PM
> Subject: Re: inconsistency about preserveAspectRatio for <image> element
> 
> 
>> On 10/11/2010 06:00 PM, ddailey wrote:
>>> if the question of when to honor that
>>> attribute is raised
>>
>> FWIW, I'm actually not at all questioning whether to honor that attribute.
>> The spec is clear that it *should* be honored on <image> tags.
>>
>>> My sense is that if an author goes to the trouble of specifying both
>>> height and width of an image, then they probably mean it regardless of
>>> the default value of preserveAspectRatio.
>>
>> The <image> height/width attributes both default to 0, so authors *have*
>> to specify them both.  The fact that an author "goes to the trouble of
>> specifying both"  only signifies that he/she wants a nonzero-size image.
>> :)  It doesn't necessarily signify any desire to distort the image.
>>
>> ~Daniel
>>
>>
> 
Received on Tuesday, 12 October 2010 02:44:23 GMT

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