This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16072 - Margin collapsing: clarification needed as to where a collapsed margin manifests itself
Summary: Margin collapsing: clarification needed as to where a collapsed margin manife...
Status: NEW
Alias: None
Product: CSS
Classification: Unclassified
Component: CSS Level 2 (show other bugs)
Version: unspecified
Hardware: All Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: Bert Bos
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-22 08:30 UTC by Anton P
Modified: 2012-12-04 00:51 UTC (History)
0 users

See Also:


Attachments

Description Anton P 2012-02-22 08:30:01 UTC
Reported by Anton Prowse

The spec currently says that the bottom margins collapse for an auto-height, non-BFC parent with large min-height and a last in-flow non-self-collapsing child, even when the parent's used height is larger than the total height of all of its content and its last child's bottom margin.  The WG feels that this is acceptable behaviour because the alternatives are worse in a world without partial margin collapsing.  (See Bug 16037.)

However, nothing in the spec indicates where the collapsed margin should manifest itself.  (See also Bug 15894 - Position of top content edge of non-replaced block-level elements is not clearly defined.)  This problem has always existed, although in most cases it's intuitive that the collapse margin should manifest itself outside the parent's border box.  However, in the case described above, it's less intuitive, since one could argue that the collapsed margin might manifest itself immediately outside the /child's/ border box, for example.
Comment 1 Anton P 2012-02-22 08:41:20 UTC
It was generally agreed in the F2F in Paris 2012 [http://lists.w3.org/Archives/Public/www-style/2012Feb/0529.html] that the collapsed margin should manifest itself outside the parent's border box.  I don't see a suitable place in 8.3.1 to mention this, and it's not really within the remit of 8.3.1 to describe /how/ to use the resulting collapsed margin.  Instead, I propose the following change to 9.4.1 (Block formatting contexts).

Proposal:

In 9.4.1, in the following paragraph:

  # In a block formatting context, boxes are laid out one after the
  # other, vertically, beginning at the top of a containing block. The 
  # vertical distance between two sibling boxes is determined by the
  # 'margin' properties. Vertical margins between adjacent block-level
  # boxes in a block formatting context collapse.

change the last sentence as follows:

  | Vertical margins between adjacent block-level boxes in a block
  | formatting context <ins>typically</ins> collapse<ins>, and the
  | collapsed margin manifests itself outside of the border areas of
  | all the boxes that have precisely one margin which participates in
  | the collapsed margin</ins>.


[Note that it's not true in general that a collapsed margin lump lies outside of the (zero-height) border box of self-collapsing elements.  I added the word "typically" because there are clearly various cases where margins don't collapse.]

The resulting paragraph can then be rewritten with more accuracy in css3-box.