W3C home > Mailing lists > Public > www-style@w3.org > August 2009

Re: [CSS21] Clearance paradox

From: Anton Prowse <prowse@moonhenge.net>
Date: Thu, 13 Aug 2009 09:21:41 +0200
Message-ID: <4A83BF05.10402@moonhenge.net>
CC: "www-style@w3.org" <www-style@w3.org>
L. David Baron wrote:
> On Wednesday 2009-05-20 08:01 -0700, fantasai wrote:
>> Anton Prowse wrote on 2 Apr 2009:
>>> The least disruptive solution to the problem discussed therein is to say
>>> that an element can still be said to have clearance even if that
>>> clearance is zero.  In other words, clearance is a property that
>>> elements may possess in addition to being a quantity which is applied.
>>> This makes the whole thing hold together conceptually, and required no
>>> conceptual changes to the 'clear' property.  To put it another way, the
>>> specification currently incorrectly equates zero clearance with no
>>> clearance, yet the two concepts would be different under the solution
>>> above.  Of course, this solution requires some editorial changes to the
>>> text of 9.5.2 The 'clear' property
>>> (http://www.w3.org/TR/CSS21/visuren.html#propdef-clear) and 8.3.1
>>> Collapsing margins
>>> (http://www.w3.org/TR/CSS21/box.html#collapsing-margins) where clearance
>>> is sometimes regarded as solely a quantity through the implication that
>>> zero clearance implies /no/ clearance.
> Such changes are *far* from editorial.  If an element is considered
> to have cleareance even when it would not otherwise be adjacent to
> floats, then large numbers of margins that today collapse (and have
> according to all prior CSS definitions) would stop collapsing, which
> would be a significant break with Web-compatibility.

I don't follow you;  if an element is not adjacent to floats, why would 
it be considered to have clearance?  An element only has clearance  when 
it satisfies the conditions in 9.5.2[1].  The proposed change attempts 
to address the particular situation in which, due to the conditions for 
possessing clearance being satisfied (adjacency to floats), a box with 
clearance is thus "pushed down" from its existing position due to the 
prevention of margin collapsing, to a position in which its top border 
edge fits snugly under the bottom border edge of the float being 
cleared.  In this case the value of clearance is "zero".  The problem is 
that the spec equates this zero value with "no clearance" elsewhere in 
9.5.2 and beyond (because clearance is currently treated only as a 
value, not [additionally] as a characteristic which an element may or 
may not possess), which leads to a paradox because elements with "no 
clearance" are not excluded from margin-collapsing.

I think this is editorial; the proposed change doesn't affect when an 
element is determined to have clearance; it merely ensures that in the 
special case where clearance exists and happens to be "zero" then the 
spec is unambiguous in stating that margin/collapsing was/is prohibited.

[1] http://www.w3.org/TR/CSS21/visuren.html#propdef-clear

Anton Prowse
Received on Thursday, 13 August 2009 07:23:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:38 UTC