Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 775350 - Update the overflow areas of the lines containing floats…
Browse files Browse the repository at this point in the history
… based on the overflow areas of the floats in the containing block; r=dbaron
  • Loading branch information
ehsan committed Nov 6, 2012
1 parent a4128f4 commit 3bac0c4
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
7 changes: 7 additions & 0 deletions layout/generic/nsBlockFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,13 @@ nsBlockFrame::UpdateOverflow()
ConsiderChildOverflow(lineAreas, lineFrame);
}

// Consider the overflow areas of the floats attached to the line as well
if (line->HasFloats()) {
for (nsFloatCache* fc = line->GetFirstFloat(); fc; fc = fc->Next()) {
ConsiderChildOverflow(lineAreas, fc->mFloat);
}
}

line->SetOverflowAreas(lineAreas);
}

Expand Down
11 changes: 11 additions & 0 deletions layout/reftests/floats/775350-1-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<div id="top"></div>
<div>
<div style="float: left; position: relative;">
<div id="inner" style="display: block; top: 100px; width: 100px; height: 100px; background: pink; position:absolute;"></div>
</div>
</div>
</body>
</html>
30 changes: 30 additions & 0 deletions layout/reftests/floats/775350-1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<script>

function handleLoad() {
setTimeout(f1, 0);
}

function f1() {
document.getElementById("inner").style.top = "100px";
setTimeout(f2, 0);
}

function f2() {
document.getElementById("top").style.display = "block";
document.documentElement.removeAttribute("class");
}

</script>
</head>
<body onload="handleLoad()">
<div id="top" style="display: none;"></div>
<div>
<div style="float: left; position: relative;">
<div id="inner" style="display: block; top: 110px; width: 100px; height: 100px; background: pink; position:absolute;"></div>
</div>
</div>
</body>
</html>
1 change: 1 addition & 0 deletions layout/reftests/floats/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ fails == 345369-2.html 345369-2-ref.html
== 345369-5.html 345369-5-ref.html
== 429974-1.html 429974-1-ref.html
== 546048-1.html 546048-1-ref.html
== 775350-1.html 775350-1-ref.html

0 comments on commit 3bac0c4

Please sign in to comment.