Re: [CSS 2.1] How to handle rectangle values.

On 3/4/10 10:19 AM, Robert Stam wrote:
> All CSS 2.1 properties that can be specified as length value are
> converted to the absolute length at the 'computed value' stage.
>
> However, the computed value of the 'clip' property is specified as 'For
> rectangle values, a rectangle consisting of four computed lengths;
> otherwise, as specified'.

Right.  In practice, the only value that can happen "otherwise" is "auto".

> Does this mean (in deviation of all other properties) relative lengths
> are not converted to absolute lengths at this stage and can thus be
> inherited?

No.

That said, none of Presto, Webkit, Gecko implement this spec as it's 
currently written, in that they compute "auto" values in the rect to 
"auto", not to lengths [1].  Furthermore, the text for <shape> is 
self-contradictory in that it says:

   The value 'auto' means that a given edge of the clipping region
   will be the same as the edge of the element's generated border box

but then talks about computed widths and heights.  It presumably wants 
to talk about used widths and heights, right?  Can we get these two 
issues corrected, please?

-Boris

[1] Testcase that should show no red if auto is converted to lengths 
when determining computed style:

<!DOCTYPE html>
<html>
   <style>
     body { clip: rect(0, auto, auto, 0); }
     #outer { position: absolute; clip: inherit;
              border: 5px solid purple; }
     #inner { width: 100px; height: 100px; background: red;
   </style>
   <body>
     <div id="outer">
       <div id="inner"></div>
     </div>
   </body>
</html>

Received on Thursday, 4 March 2010 15:43:34 UTC