Open Bug 81710 Opened 24 years ago Updated 2 years ago

Empty floats don't take up room [FLOAT] (zero height)

Categories

(Core :: Layout: Floats, defect, P4)

defect

Tracking

()

People

(Reporter: ian, Unassigned)

References

(Blocks 2 open bugs, )

Details

(Keywords: css1, testcase, Whiteboard: [Hixie-P4][CSS1-5.5.25] WG (py8ieh:check on linux))

Attachments

(1 file)

An empty float takes up no room for some reason, even if it has an explicit width. See http://www.hixie.ch/tests/adhoc/css/box/float/007.xml for a testcase. dbaron says we should change the spec...
Blocks: float
QA Contact: petersen → ian
Whiteboard: [Hixie-P4] WG
Severity: normal → trivial
Severity: trivial → normal
Status: NEW → ASSIGNED
Priority: -- → P4
Target Milestone: --- → mozilla1.0
Severity: normal → trivial
One reason the testcase doesn't work right (at least on Linux) is that -moz-opacity is broken.
Broken in what way? Assuming it doesn't affect _layout_, then the testcase will still work. If it affects layout then yes, that is indeed broken, and I should file a new bug...
Whiteboard: [Hixie-P4] WG → [Hixie-P4] WG (py8ieh:check on linux)
-moz-opacity seems to be causing some of the things in the testcase to disappear entirely
That seems unfortunate.
Target Milestone: mozilla1.0 → Future
Target Milestone: Future → mozilla0.9.9
Whiteboard: [Hixie-P4] WG (py8ieh:check on linux) → [Hixie-P4][CSS1-5.5.25] WG (py8ieh:check on linux)
Reassigning to Alex.
Assignee: waterson → alexsavulov
Status: ASSIGNED → NEW
Target Milestone: mozilla0.9.9 → Future
->Layout:Floats
Assignee: alexsavulov → float
Component: Layout → Layout: Floats
Target Milestone: Future → ---
Target Milestone: --- → Future
*** Bug 225503 has been marked as a duplicate of this bug. ***
Summary: Empty floats don't take up room [FLOAT] → Empty floats don't take up room [FLOAT] (zero height)
I'm pretty sure this is invalid; the highest the float can go is the location of the zero-height float, and then there's nothing stopping the float from sliding all the way to the right.
It's not clearly invalid (except that the test relies on old z-ordering rules). The thing stopping the float from sliding all the way to the side is the zero-height float.
http://www.w3.org/TR/CSS21/visuren.html#floats First off, the use of the terms "lower than" and "to the right of" is a bit confusing; "to the right of" is supposed to mean "not to the left of" and "lower than" is really supposed to mean "not higher than". In other words, rule 2 is specifying that the distances between the edges must be nonnegative, but not necessarily positive. (Requiring it to be positive would be wrong because it would mean two 50px floats in an 100px container couldn't fit next to each other.) It's pretty easy to show both renderings satisfy rules 1-7. Supposing both the current and proposed renderings satisfy rules 1-7, and both renderings have the same top edge for the second float (so there's no rule 8 distinction), the current rendering is better according to rule 9. Therefore, unless the rules are wrong, this bug is invalid.
Assignee: layout.floats → nobody
QA Contact: ian → layout.floats
Er, sorry, I made that comment on the wrong bug!
Status: RESOLVED → REOPENED
No longer depends on: 191448
Resolution: FIXED → ---
Assignee: dbaron → nobody
Status: REOPENED → NEW
Target Milestone: mozilla1.9.1b3 → ---
layout/reftests/floats/zero-height-float.html is a somewhat less debatable testcase; it's also in the CSS 2.1 test suite as html4/floats-zero-height-wrap-002.htm and xhtml1/floats-zero-height-wrap-002.xht .
Blocks: css2.1-tests
I fixed this accidentally while working on bug 1062963. The "fix" there broke other stuff (see bug 1076986) but the effect can be separated out, like so. N.B. This fixes the test from comment 13, but not Hixie's original testcase (which we render the same as Chrome)
Assignee: nobody → smontagu
Attachment #8499021 - Flags: review?(dbaron)
Does this improve or worsen compatibility with other browsers? And is the correct behavior to have the test you've changed it to, or to remove the condition entirely?
Flags: needinfo?(smontagu)
(In reply to David Baron [:dbaron] (UTC-7) (needinfo? for questions) from comment #17) > Does this improve or worsen compatibility with other browsers? And is the > correct behavior to have the test you've changed it to, or to remove the > condition entirely? Hmm, I was hoping you would help me with just those questions! Do you remember what cases the "compatibility" in the original comment referred to?
Flags: needinfo?(smontagu)
Looking at https://wpt.fyi/css/CSS2/floats/floats-zero-height-wrap-002.xht (which dbaron wrote) Chrome, Edge, and Safari all seem to allow non-zero-width/zero-height floats to take up space, though I don't know how zero-width/zero-height floats are handled in other browsers, which we should test too.
I think there may have been some discussion of zero-height floats in the CSS WG sometime in the past few years.
Assignee: smontagu → nobody
Severity: trivial → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: