Closed Bug 365965 Opened 18 years ago Closed 18 years ago

Clearing a float with an element that floats causes problem with next float in the opposite direction

Categories

(Core :: Layout: Floats, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: dan, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.3
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20061218 Minefield/3.0a1

If you have an element set to float:right; and you follow it with another element set to clear:right; float:right; and then follow those first two elements with a third element set to float:left; the third element will not float next to the first element, even though it is not being cleared.

Additionally, it seems this is a similar issue to Bug# 355522.  However, Bug# 355522 is specific to the first-letter pseudo-class.

Reproducible: Always

Steps to Reproduce:
1. Create three block elements followed by a single paragraph of text.
2. Set the first block element to: float: right;
3. Set the second block element to: clear:right;float:right;
4. Set the third block element to float:left;
Actual Results:  
The third element will not float next to the first element, even though it is not being cleared. However, the paragraph at the end of the page will still rise to the top as expected.

Expected Results:  
The third element should rise to the top of the page and the paragraph at the end of the page should wrap around all three elements.

This bug is also present when the directions are reversed on the instructions above.
Keywords: testcase
This is actually the same as bug 355522 you mention.
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
In either case, we're doing what the CSS spec says to do here.
I believe you are misinterpreting the CSS spec.

I actually submitted the exact same bug to Safari webkit, and they fixed it in less than 1 hour:  http://bugs.webkit.org/show_bug.cgi?id=12114

Plus, the spec only specifies how to position the element that is being cleared. In the case described above, the float:left; should not be cleared by a clear:right;

Nowhere in the CSS spec does it say that a clear:right; should ever affect a float:left;
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
http://www.w3.org/TR/CSS21/visuren.html#float-position rule 5 says:

The outer top of a floating box may not be higher than the outer top of any block or floated box generated by an element earlier in the source document.

... References to other elements in these rules refer only to other elements in the same block formatting context as the float. 

->INVALID
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: