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

NEW
Assigned to

Status

()

Core
Layout: Floats
P4
trivial
17 years ago
3 years ago

People

(Reporter: Hixie (not reading bugmail), Assigned: smontagu)

Tracking

(Blocks: 2 bugs, {css1, testcase})

Trunk
css1, testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
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...
(Reporter)

Updated

17 years ago
Blocks: 78094
Keywords: css1, mozilla1.0, testcase
QA Contact: petersen → ian
Whiteboard: [Hixie-P4] WG
(Reporter)

Updated

17 years ago
Severity: normal → trivial

Updated

17 years ago
Severity: trivial → normal
Status: NEW → ASSIGNED
Priority: -- → P4
Target Milestone: --- → mozilla1.0

Updated

17 years ago
Severity: normal → trivial
One reason the testcase doesn't work right (at least on Linux) is that
-moz-opacity is broken.
(Reporter)

Comment 2

16 years ago
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
(Reporter)

Comment 4

16 years ago
That seems unfortunate.

Updated

16 years ago
Target Milestone: mozilla1.0 → Future

Updated

16 years ago
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 → ---

Updated

14 years ago
Target Milestone: --- → Future
(Reporter)

Comment 7

14 years ago
*** Bug 225503 has been marked as a duplicate of this bug. ***
(Reporter)

Updated

13 years ago
Summary: Empty floats don't take up room [FLOAT] → Empty floats don't take up room [FLOAT] (zero height)

Comment 8

10 years ago
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.

Comment 10

10 years ago
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
This was fixed by bug 191448 (on the basis that it got fixed on the 1.9.1 branch between nightlies 2009-02-12-01-mozilla-1.9.1 and 2009-02-12-01-mozilla-1.9.1, i.e., in http://hg.mozilla.org/releases/mozilla-1.9.1/pushloghtml?fromchange=1af81db46cc5&tochange=110384dabb87
Assignee: nobody → dbaron
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Depends on: 191448
Resolution: --- → FIXED
Target Milestone: Future → mozilla1.9.1b3
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: 605520

Comment 14

4 years ago
Test [RC6]:
http://test.csswg.org/suites/css2.1/latest/html4/floats-zero-height-wrap-002.htm

Correct reference test link [RC6] for such test:
http://test.csswg.org/suites/css2.1/latest/html4/floats-zero-height-wrap-001-ref.htm

Also,

Test [nightly-unstable]:
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/floats-zero-height-wrap-002.htm

Current reference test link [nightly-unstable]:
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/reference/floats-zero-height-wrap-001-ref.htm
(Assignee)

Comment 15

3 years ago
Created attachment 8499021 [details] [diff] [review]
Don't ignore floats unless both dimensions are zero

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)
(Assignee)

Comment 16

3 years ago
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=fa2a3bc9a674
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)
(Assignee)

Comment 18

3 years ago
(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)
You need to log in before you can comment on or make changes to this bug.