[whatwg] require img dimensions to be correct?

Sander Tekelenburg st at isoc.nl
Sat Mar 17 15:05:23 PDT 2007


At 03:46 +1300 UTC, on 2007-03-17, Dean Edridge wrote:

> Regarding: img dimensions to be correct?
> Sander Tekelenburg wrote:

[...]

>><http://webrepair.org/02strategy/02certification/01requirements.php#req24>
>>[...]
>>
> I don't really think this is a good idea IMHO.
>
> Firstly, the chance of someone not being able to access the CSS for a web
>page is I'm guessing, pretty slim.

Maybe. I don't have any data to back up either way.

> The chance of someone not being able to access this CSS, and actually
>noticing or caring that the images aren't rendered correctly

The argument is not rendering "correctly", but to avoid "jumpy"
rendering/achieve faster page loading by letting the browser know beforehand
what amount of space to allocate for the image.

> [...] So I don't think it's really worth
>throwing away the benefits of CSS just for a very rare occasion like this
>that would probably not be of benefit to anyone anyway.

I don't see how this throws away CSS benefits. Quite the contrary, as it
disallows specifying width and height in percentages[*] through HTML. I'd
prefer to say that defining width and height in HTML would be illegal, as it
is presentational and should therefore be done through Style Sheets. The only
problem then is that, when CSS is not available, the UA won't know what
amount of space to allocate to the image until it is completely fetched. It's
a (mild) case of CSS-dependancy. The only way I see to avoid that is to
specify a width and height in HTML. And we're talking about pixels only[*],
not percentages which would be purely presentational and thus should be done
through Style Sheets.

Maybe the requirement should in fact be that the image's *actual* width and
height be specifed through HTML.

Btw, remember that the target for the WRI's requirements are "Automated Web
Publishing Systems". It can't be hard for an authoring system to ensure that
the width and height for a particular image is set the same both in HTMl and
CSS. And note that this synchronicity is only required when the image's
height and width is specified in px[1] -- scaling through %/em/ex, a CSS
benefit, is specifically allowed.

[1] I see it didn't clearly say so at
<http://webrepair.org/02strategy/02certification/01requirements.php#req24>.
It does now.


-- 
Sander Tekelenburg
The Web Repair Initiative: <http://webrepair.org/>



More information about the whatwg mailing list