Closed
Bug 448043
Opened 17 years ago
Closed 17 years ago
DOM (?) error when using style float:left with nested ul
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: nplatis, Unassigned)
Details
(Keywords: testcase)
Attachments
(1 file)
|
582 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; el; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; el; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
This came out when trying to construct a nested menu using ul/li, and the bug is very strange.
Here is a minimal test case:
-----------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
ul {
float: left;
}
</style>
</head>
<body>
<ul>
<li>Home</li>
<li>Next</li>
<li>Sub
<ul>
<li>Sub1</li>
<li>Sub2</li>
</ul>
</li>
<li>After</li>
</ul>
</body>
</html>
-----------------
This document produces a nested list such as
* Home
* Next
* Sub
o Sub1
o Sub2
* After
However, run this document through the DOM inspector, and notice that when highlighting the <li> corresponding to "Sub", only "Sub" is marked and not "Sub1" and "Sub2". On the contrary, when highlighting the <li> corresponding to "After" the "Sub1" and "Sub2" are marked!
However, if you remove the "float: left" from the style of <ul>, the elements of the document are marked correctly, that is "Sub1" and "Sub2" together with "Sub".
Therefore it seems that for some reason the DOM is constructed incorrectly when using this style.
Reproducible: Always
Comment 1•17 years ago
|
||
Comment 2•17 years ago
|
||
(In reply to comment #0)
> highlighting the <li> corresponding to "Sub", only "Sub" is marked and not
> "Sub1" and "Sub2".
The marked area is correct since that is the actual size of the <LI>.
The float is not part of the normal flow so it does not contribute
to the height of the <LI> and instead it overflows.
> On the contrary, when highlighting the <li> corresponding to
> "After" the "Sub1" and "Sub2" are marked!
This is also correct. The "After" <LI> starts where the previous
one ends. The text "After" is moved below the (overflowing) float
since it doesn't fit to the right of it and this float clearance
is what stretches the last <LI> height.
http://www.w3.org/TR/CSS21/visuren.html#floats
-> INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•