W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2006

[whatwg] <img> element comments

From: Spartanicus <spartanicus.3@ntlworld.ie>
Date: Sat, 04 Nov 2006 12:33:23 +0000
Message-ID: <n2m-g.ivvok2hsujtd6fqrl2u7a2msq6u3tresvi@4ax.com>
Ian Hickson <ian at hixie.ch> wrote:

[width and height attribute on the <img> element]

>I'm thinking of only allowing integer values, and requiring them to be 
>equal to the dimensions of the image, if present (and requiring both to 
>be present if either is present). Would people be ok with that?

Definitely on the integer value only, allowing percentage values makes
no sense to me.

In some cases I have used just one attribute
http://homepage.ntlworld.ie/spartanicus/fit_image_in_column2.htm , but
on examination this does not only have no benefit, it needlessly causes
the single coded image size to be reserved in the flow if for example a
graphical client is configured to not initially retrieve images. When
omitting both attributes the element's size collapses to the size of the
alt content, whilst the reflow on a possible subsequent retrieval of the
image occurs anyway in this particular scenario.

Meanwhile allowing authors to omit width & height together caters for
situations where better functionality is achieved if the natural
dimension of the image isn't reserved on the initial flow layout. The
required reflow on a subsequent retrieval of the image can be considered
preferable compared to the alternative where potentially valuable screen
space may be wasted to reserve space in the initial flow for the natural
size of the image.

So I also support requiring both to be present if either is present.

But wouldn't requiring the width & height values to be equal to the
natural dimension of the image require conformance checkers to have a
capability to parse images to retrieve these values?

-- 
Spartanicus

(email whitelist in use, non list-server mail will not be seen)
Received on Saturday, 4 November 2006 04:33:23 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:49 UTC