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 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
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-25 20:43 UTC by Gérard Talbot
Modified: 2012-12-04 00:54 UTC (History)
1 user (show)

See Also:


Attachments

Description Gérard Talbot 2012-02-25 20:43:06 UTC
Test and demo pages
-------------------

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/float-non-replaced-width-013.html

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/float-non-replaced-width-014.html

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/float-non-replaced-width-015.html

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/float-non-replaced-width-016.html


Thread
------

[CSS21] Nested floats and zero-height margin box
http://lists.w3.org/Archives/Public/www-style/2012Feb/0852.html

in particular the objection from Øyvind Stenhaug
http://lists.w3.org/Archives/Public/www-style/2012Feb/1064.html
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
http://www.w3.org/TR/CSS21/visuren.html#float-rules



"
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
http://www.w3.org/TR/CSS21/visudet.html#float-width


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