W3C home > Mailing lists > Public > www-style@w3.org > September 2010

Issue 203 - improved rendering of elements with clearance [was: Re: [CSSWG] Minutes and Resolutions 2010-09-15]

From: Anton Prowse <prowse@moonhenge.net>
Date: Tue, 21 Sep 2010 23:36:03 +0200
Message-ID: <4C992543.5040804@moonhenge.net>
To: "www-style@w3.org" <www-style@w3.org>
CC: fantasai <fantasai.lists@inkedblade.net>
On 21/09/2010 11:15, fantasai wrote:
> <glazou> http://wiki.csswg.org/spec/css2.1#issue-203
>    TabAtkins: This needs layout people to look at this.
>    TabAtkins: But elika, arronei, and arronei's coworker all looked at
>               this together and thought it was probably good.
>    dbaron: I believe the change is fine with me, too.
>    RESOLVED: Accept fantasai's change for issue 203.

I am unhappy with this resolution.

We need to be careful to distinguish Issue 158 from Issue 203.  Issue 
158 was resolved by accepting fantasai's proposal in [1].  As I stated 
in my immediate reply[2] to the proposal, the edits succeed in 
clarifying the description of the clearance model as defined by the 
current spec, and hence I am content with that resolution (apart from a 
tiny niggle that I mentioned therein).

However, Issue 203 is specifically my assertion that the hypothetical 
border calculation should match actual border calculation.  fantasai 
proposed determining the hypothetical top border of a clearing element 
by introducing a temporary non-zero bottom border.[3]  However, as I 
explained and demonstrated with test cases in [2], this hypothetical top 
border is not the same as the actual top border in some cases where 
8.3.1.6.1 (self-collapsing elements) applies.  As a result, clearance is 
introduced in situations where it is not actually necessary.

I suggested a very straightforward  indeed simpler  alternative 
resolution: make the hypothetical top border the same as the actual top 
border in all cases.  In other words, to determine if clearance is 
necessary, merely treat the clearing element has having clear:none and 
see whether its actual top border is past the relevant floats.  This has 
the significant advantage of only introducing clearance when it is 
actually necessary.

This suggestion doesn't appear to have been discussed during the 
telecon.  Whilst I could live with fantasai's resolution (despite 
disliking it), I ask that the WG acknowledge that they are aware of the 
consequence (IMO, shortcoming) of the resolution.

[Note that there is currently no interop anyway on this issue, so the 
resolution need not be influenced by current browser behaviour.]


The clearance troubles doesn't end there, however.  As I explained in 
[4], both fantasai's proposal and my approach suffer as a consequence of 
the discontinuity between how top border position is determined in 
8.3.1.6.1 (before clearance was introduced) and in 8.3.1.6.2 (after 
clearance has been introduced), resulting in the clearing element ending 
up lower than needed in some cases where it is self-collapsing; the 
clearing element clears the float by too much.  I suggested resolving 
this by modifying either 9.5.2 or 8.3.1.6.2 (preferably the latter) to 
express the following notion:

   If the element has clearance but its margins collapsed with its
   parent's top margin when determining if clearance were
   needed (ie when assuming clear:none), then the top border edge
   position is the same as that of a hypothetical immediately-following
   sibling with zero top margin and non-zero top border.

This issue also remains unaddressed.  I originally treated this as part 
of my proposal for Issue 203, but since the issue also affects 
fantasai's proposal for 203 (although I've only verified that my 
suggested fix works correctly in the context of /my/ proposal for 203), 
I think it would be more appropriate to file this as a separate issue. 
(Note that this issue, which concerns undesirable final placement of the 
clearing element, is independent from LC Issue 207 which concerns 
undesirable placement of the following siblings of the clearing element.)

I'll point out here that I *think* that if both this issue and Issue 207 
were resolved as I suggest, then it wouldn't actually matter whether 
Issue 203 were resolved using fantasai's proposal or my one, since the 
resulting rendering would be indistinguishable in the cases where 
fantasai's proposal causes an element to have clearance but my proposal 
doesn't. (I haven't proved this though.)  However, I don't regard this 
as lending support to fantasai's proposal for Issue 203 since, even if 
my hunch were correct, that proposal remains confusing; the average 
reader will inevitably wonder why a special hypothetical top border is 
invoked when the actual top border is a more natural way to determine 
whether clearance is necessary.


[1] http://lists.w3.org/Archives/Public/www-style/2010Aug/0458.html
[2] http://lists.w3.org/Archives/Public/www-style/2010Aug/0477.html
[3] http://lists.w3.org/Archives/Public/www-style/2010Aug/0460.html
[4] http://lists.w3.org/Archives/Public/www-style/2010Aug/0526.html

Cheers,
Anton Prowse
http://dev.moonhenge.net
Received on Tuesday, 21 September 2010 21:36:56 GMT

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