Re: [css-sizing] Percentage contributions to intrinsic sizing

On 19/03/15 06:01, fantasai wrote:
>     B) Treat percentages as zero:
>          - percentages contribute zero to the intrinsic size
>          - once the item is sized, the percentages are still treated as zero

So during layout percentages may or may not be treated as zero based on… 
what exactly? This is not obvious to define.

Servo computes the intrinsic sizes of everything eagerly (in a parallel 
bottom-up tree traversal), so it’s not easy to determine whether a given 
intermediate result has affected a used width arbitrarily "far away" in 
the ancestors.

For example:

   <section style="float: left">
     <div style="width: 100px">
       <ul>
         <li style="margin: 10%">

Because one of the intermediate ancestors has a fixed width, the 
percentage margin of the <li> does not affect the used width of the 
<section> (or any other ancestor), even if it contributed to the 
intrinsic size of the <ul>.

-- 
Simon Sapin

Received on Thursday, 19 March 2015 11:54:35 UTC