W3C home > Mailing lists > Public > www-style@w3.org > November 2014

[css-sizing] Intrinsic Sizes of Replaced Elements ignores 'width' and 'height'?

From: Simon Sapin <simon.sapin@exyr.org>
Date: Thu, 13 Nov 2014 14:58:52 +0000
Message-ID: <5464C72C.9090707@exyr.org>
To: www-style@w3.org
The "Intrinsic Sizes of Replaced Elements" section of the ED currently 

> For replaced elements, the min-content size and max-content size are
> equivalent and correspond to the appropriate dimension of the
> concrete object size returned by the default sizing algorithm
> [CSS3-IMAGES] of the element, calculated with an unconstrained
> specified size.

css-images-3 defines "specified size" as given (for replaced elements) 
by the 'width' and 'height' properties.

So css-sizing says to ignore these properties for the intrinsic size of 
an image? That sounds wrong.

I was looking for what should happen to images with the percentage 
specified width. A possible solution would be to do like for blocks: 
resolve the percentage if it is definite, or ignore it otherwise.

However, browsers seem to interoperably do something more complicated, 
at least when tables are involved, and I don’t know what the algorithm 
is here.

Compare the document below with and without the style="width: 50%". (The 
behavior without is explained by tables always getting at least their 
min-content size, even when the specified size is smaller, per 

<table style="width: 200px">
<td style="border: solid">
<img style="width: 50%"
      src="data:image/svg+xml,<svg width='1000'

Context: https://github.com/Kozea/WeasyPrint/issues/227

Simon Sapin
Received on Thursday, 13 November 2014 14:59:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:48 UTC