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

The "Intrinsic Sizes of Replaced Elements" section of the ED currently 
reads:

http://dev.w3.org/csswg/css-sizing/#replaced-intrinsic
> 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 
"shrink-to-fit".)

<table style="width: 200px">
<td style="border: solid">
<img style="width: 50%"
      src="data:image/svg+xml,<svg width='1000'
           xmlns='http://www.w3.org/2000/svg'/>">


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

-- 
Simon Sapin

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