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 15671 - Should anonymous blocks be able to establish containing blocks?
Summary: Should anonymous blocks be able to establish containing blocks?
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-01-22 19:56 UTC by Anton P
Modified: 2012-12-04 00:54 UTC (History)
0 users

See Also:


Attachments

Description Anton P 2012-01-22 19:56:22 UTC
Discussed by Boris Zbarsky, Bert Bos

Boris raises the example:
   <div id="outer">
     <div id="row" style="display: table-row">
       <div id="inner"/>
     </div>
   </div>
and says that the proposed wording makes the "outer" div the containing block of the "inner" one, whereas the desired containing block, and the one all UAs 
use in practice, is the content edge of the anonymous table-cell box 
generated between the table-row and the "inner" block.

Bert disputes that this should be the case, claiming that the anonymous table cell isn't a good choice for a containing block because you cannot put 
properties on it.  He counters with:
    <div id=outer style="height: 20em">
      Some text <button style="height: 50%">before</button> the image.
      <img src="x.png" alt="x" style="display: block">
    </div>
in which the text is wrapped in an anonymous block box; he thinks that the height of the BUTTON should be 50% of the "outer" element, not of that anonymous box.

Discussion:
http://lists.w3.org/Archives/Public/www-style/2010Aug/0443.html
http://lists.w3.org/Archives/Public/www-style/2010Oct/0042.html
Comment 1 Anton P 2012-01-22 20:08:33 UTC
I'm not sure that the counter-example is pertinent.  9.2.1 says:

  # Anonymous block boxes are ignored when resolving percentage values
  # that would refer to it: the closest non-anonymous ancestor box is
  # used instead. For example, if the child of the anonymous block box
  # inside the DIV above needs to know the height of its containing block
  # to resolve a percentage height, then it will use the height of the
  # containing block formed by the DIV, not of the anonymous block box.