Bug 16119 - [9.5.1 Floats] How nested floats with one zero-height margin box should be rendered
Summary: [9.5.1 Floats] How nested floats with one zero-height margin box should be re...
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
Depends on:
Reported: 2012-02-25 20:43 UTC by Gérard Talbot
Modified: 2012-12-04 00:54 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Gérard Talbot 2012-02-25 20:43:06 UTC
Test and demo pages






[CSS21] Nested floats and zero-height margin box

in particular the objection from Øyvind Stenhaug
which is

 First of all, the outermost floats here are all auto-width, in which
 case "CSS 2.1 does not define the exact algorithm" for finding preferred
 width and preferred minimum width.

 Second of all, what does it mean for a right-floating box to be "next
 to" a left-floating box? This doesn't seem to be properly defined.
 Perhaps it should be similar to the case of lineboxes "next to" floats,
 where floats with zero outer height are not supposed to shorten
 lineboxes. Then, for e.g. float-non-replaced-width-014 it would be
 perfectly fine to put #floated-left-child in the top left and
 #floated-right-child "below" it - #floated-right-child would still be
 "as high as possible".

Excerpts of current spec

  The right outer edge of a left-floating box may not be 
  to the right of the left outer edge of any right-floating box 
  that is next to it.
  A left-floating box must be put as far to the left as possible, a right-
  floating box as far to the right as possible.
9.5.1 Positioning the float

If 'width' is computed as 'auto', the used value is the "shrink-to-fit" width.

Calculation of the shrink-to-fit width is similar to calculating the width of a table cell using the automatic table layout algorithm. Roughly: calculate the preferred width by formatting the content without breaking lines other than where explicit line breaks occur, and also calculate the preferred minimum width, e.g., by trying all possible line breaks. CSS 2.1 does not define the exact algorithm. Thirdly, find the available width: in this case, this is the width of the containing block minus the used values of 'margin-left', 'border-left-width', 'padding-left', 'padding-right', 'border-right-width', 'margin-right', and the widths of any relevant scroll bars.

Then the shrink-to-fit width is: min(max(preferred minimum width, available width), preferred width).
10.3.5 Floating, non-replaced elements

Expected result

The CSS2.1 spec should indicate expected result for the 4 tests, in particular 
- float-non-replaced-width-014.html
- float-non-replaced-width-016.html

regards, Gérard
Comment 1 Anton P 2012-05-21 10:38:12 UTC
I propose closing this bug as resolved-wontfix, as explained in http://lists.w3.org/Archives/Public/www-style/2012May/0707.html