W3C home > Mailing lists > Public > www-style@w3.org > March 2011

Re: [CSS21] Clearance - the missing manual (Issue 203)

From: Anton Prowse <prowse@moonhenge.net>
Date: Mon, 14 Mar 2011 01:34:31 +0100
Message-ID: <4D7D6297.7040104@moonhenge.net>
To: "www-style@w3.org" <www-style@w3.org>
CC: Arron Eicholz <Arron.Eicholz@microsoft.com>
On 12/03/2011 00:00, Arron Eicholz wrote:
> On Sunday, August 15, 2010 12:30 AM Anton Prowse wrote:
>>
>>
>> Yes... but oddly it's not /that/ position that's used.  It's a different position,
>> this time defined as where it would be (relative to the
>> canvas) if the clearing element really did have a non-zero *top* border.
>>
>> Why?
>> ====
>>
>> Because there's an error in the spec!  Stay tuned for the follow-up, in which
>> we demonstrate precisely why this part of the spec is just silly...
>
> Thank you for your feedback. The CSSWG resolved not to make changes to the CSS 2.1 specification[1].
>
> We have determine that the spec is not incorrect based on the following logic from this email[2]. Additional changes have been made to the relevant test cases so the cases match the specification.

> [2] http://lists.w3.org/Archives/Public/www-style/2010Dec/0474.html

But AFAICT [2] doesn't /contain/ any logic, beyond the fact that all 
major browsers seem to behave in the same way on a certain test case. 
(And it is well known that these browsers don't implement certain parts 
of the clearance spec at all, so I don't take their current behaviour as 
gospel.)

I will study [2] in more detail this week.  (I'm afraid the 14th March 
deadline is unreasonable.  Apologies if there is more info about this 
issue in the F2F minutes; I haven't gone through them yet.)  I'll state 
below (again) the problem alluded to in my original post, which 
represents Issue 203 in the Issues wiki. [2] seems to have been 
instrumental in the resolution now listed there: "Have CSS2.1 allow two 
possible margin collapsing behaviors in the margin-collapse-clear case: 
the hypothetical position before clearance is applied may be calculated 
either with respect to the parent block, or with respect to the 
containing block formatting context."  I need to think about what the 
relationship is, if any, between the pair {real border position (wrt 
canvas), hypothetical border position (wrt canvas)} that I'm considering 
and the pair {hypothetical border position wrt parent, hypothetical 
border position wrt containing block} that the resolution is considering.

As the heart of Issue 203 is the following.  It's easily demonstrated 
that using a hypothetical border position which is different from the 
actual border position (as defined in 8.3.1) results in clearance being 
introduced in situations where it is not needed and hence the clearing 
element being placed too high up (flush with the bottom of the float).

<div style="float:left; width:100px; height:100px; background:red"></div>
<div style="height:20px; background:blue"></div>
<div>
     <div style="clear:left; margin-bottom: 100px">
     <div style="position:absolute; width:100px; height:100px; 
background:yellow"></div>
     </div>
</div>

(Without clear:left, the child div is already 20px past the float, yet 
with clear:left clearance is deemed necessary under the current spec and 
hence that div is actually moved up to be flush with the bottom of the 
float.)

Cheers,
Anton Prowse
http://dev.moonhenge.net
Received on Monday, 14 March 2011 00:35:04 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:38 GMT