gecko-dev/layout/reftests/floats/1291110-2.html
Ting-Yu Lin 384e9e119b Bug 1291110 Part 4 - Use line BSize to query available space when updating nsLineLayout. r=dbaron
In nsBlockFrame::PlaceLine(), we query the float available space by
using the line's BSize(), which may cause the line to reflow again due
to available space shrunk.

The first issue lies in the second reflow. That is, we do not leverage
the line's BSize() computed in the first reflow to query the float
available space when updating the inline reflow engine in
BlockReflowInput::AddFloat(). So some tall inline elements could still
overlap the floats as in the first reflow.

To solve this, we cache current line's BSize so that it could be
used to update the inline reflow engine when redo the line.

Another issue is in nsBlockFrame::PlaceLine(). When determined whether
the available space is shrunk, we use the float manager's state *before*
placing the line. So if current line has floats, they're not considered.

To solve this, we use the current set of floats to get the float available
space for comparison, and leave the original aFloatAvailableSpace to provide
the information when redoing the line.

MozReview-Commit-ID: GqqNlphgxYS

--HG--
extra : rebase_source : e2c64ab1ac363c7a08e532dc043bee69d6455049
2016-08-22 19:42:37 +08:00

37 lines
586 B
HTML

<!DOCTYPE html>
<style>
.container {
width: 250px;
height: 300px;
border: 1px solid blue;
}
.float1 {
float: left;
width: 100px;
height: 50px;
background-color: green;
}
.float2 {
float: right;
width: 180px;
height: 50px;
background-color: lightgreen;
}
.box {
display: inline-block;
width: 30px;
height: 80px;
background-color: blue;
}
</style>
<div class="container">
<div class="float1"></div>
<div class="float2"></div>
<div class="box"></div>
</div>
<p>The test pass if the inline blue box does not overlap any of the green float boxes.</p>