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

[whatwg] <img> element comments

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Fri, 03 Nov 2006 22:12:15 -0500
Message-ID: <454C050F.1040603@earthlink.net>
Michel Fortin wrote:
> Except that, contrary to bgcolor, the height and width attributes can  
> help solve a real problem: page jiggling while the images loads. It's  
> somewhat like the type="image/jpg" attribute you can set for links:  
> it gives advance information on what the external content is supposed  
> to be.

  So does CSS, as you point out below.

> In this case, height and width are inherent properties of the  
> document if we consider the linked image as part of the document,  
> much alike the type="" attribute on a link.

   I'm not sure what you mean. The |type| attribute describes the MIME
type. Even if you were to deliberately manipulate this value to some
end, I don't see how you could do so in a way that alters the
presentation of the document like |height| and |width| do, with the one
exception being that you can prevent a style sheet from loading by
intentionally giving the wrong |type| value. Of course, there's no
obvious motive for providing a <link> that does nothing, is there?

> Sure, we could use
> style="width: 32; height: 32" instead of width="32" height="32", but  
> most of the time the size of an image isn't a matter of style, it's a  
> matter of what the image is.

   The |width| and |height| attributes don't specify the dimensions of
the source image. They specify the size of the image in the document.
That's presentational, in my book. Arguing that those attributes are
properties of the image within the document amounts to a free pass for
all presentational markup. The <font>, <center>, <s> and <u> elements
communicate a property of the text, not the presentation. I don't buy
it. Without the attributes actually describing a property of the source
image (which is redundant), the |height| and |width| have no semantic
meaning. Convenient as they are, they're styling as markup.
Received on Friday, 3 November 2006 19:12:15 UTC

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