mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 03:49:42 +00:00

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
37 lines
586 B
HTML
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>
|