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

Re: [CSS21] Clearance paradox

From: Anton Prowse <prowse@moonhenge.net>
Date: Wed, 19 Aug 2009 20:11:33 +0200
Message-ID: <4A8C4055.2030807@moonhenge.net>
To: "L. David Baron" <dbaron@dbaron.org>
CC: www-style@w3.org
L. David Baron wrote:
> On Thursday 2009-08-13 09:21 +0200, Anton Prowse wrote:
>> 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  
> 
> Because fantasai's proposed changes in
> http://lists.w3.org/Archives/Public/www-style/2009May/0186.html say
> that it does:
>    | Values other than 'none' introduce clearance as spacing above the
>    | margin-top of an element. Clearance inhibits margin collapsing and
>    | is used to push the element vertically past the float.
> 
> -David
> 

Good catch.  fantasai's proposed change replaces a definition
["Clearance is introduced as spacing above the margin-top of an
element"] with a sufficient condition for existence ["Values other than
'none' introduce clearance as spacing above the margin-top of an
element"].  (I was imagining an unstated "may" in the proposed change,
presumably due to my familiarity with the existing prose in its current
form.)

I assume that this change of role was unintentional, given that
the explicit statement of the conditions for the introduction and
calculation of clearance remains, further down the section.

Whilst I believe the other proposed changes are sound (and successfully
break the paradox), it is certain that this particular one does need
rewording.  How about something along the lines of:

   | Values other than 'none' potentially introduce clearance.
   | Clearance inhibits margin collapsing and acts as spacing above the
   | margin-top of an element, used to push the element vertically past
   | the float.


I'm not too happy with the wording of the last sentence of the new
example of negative clearance, either:

   # Explanation: Without the 'clear', the first and last paragraphs'
   # margins would collapse and the last paragraph's top border edge
   # would be flush with the top of the floating paragraph. But the
   # 'clear' requires the top border edge to be below the float, i.e.,
   # 2em lower. That means that the margins must not collapse and
   # clearance must be added such that clearance + margin-top = 2em,
   # i.e., clearance = 2em - margin-top = 2em - 3em = -1em.

Margins-collapsing is not inhibited prior to the introduction of
clearance; rather it is inhibited as /part/ of the introduction of
clearance.  How about:

   | [...] This means that clearance must be introduced.  Accordingly,
   | the margins must not collapse and the amount of clearance added
   | satisfies the equation clearance + margin-top = 2em, i.e.,
   | clearance = 2em - margin-top = 2em - 3em = -1em.

Additionally, perhaps a link to 8.3.1 Collapsing margins would be useful
at the point where it is stated that margins must not collapse.


One quick editorial omission: this negative clearance example needs to
be introduced as an "HTML fragment", as usual.


Cheers,
Anton Prowse
http://dev.moonhenge.net
Received on Wednesday, 19 August 2009 18:13:24 GMT

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