Commit 4986c482 authored by robhogan@gmail.com's avatar robhogan@gmail.com

Don't add floats on clean lines to new lineboxes

When tying floats in a block-flow to the last linebox stop when we hit a float that sits
in clean lines in the block-flow.

BUG=492918

Review URL: https://codereview.chromium.org/1306733003

git-svn-id: svn://svn.chromium.org/blink/trunk@201680 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e3890efa
<!DOCTYPE html>
<style>
img { padding-right: 100%; height: 20px; }
source { padding-right: 1px; }
img:nth-child(odd) { width: 5px; }
#area { float: right; width: 10px; }
</style>
<script src="../../../resources/check-layout.js"></script>
<script>
function boom() {
firstdiv = document.createElement('div');
document.body.appendChild(firstdiv);
firstdiv.setAttribute("id", "first");
firstdiv.setAttribute("data-expected-height", "0");
seconddiv = document.createElement('div');
document.body.appendChild(seconddiv);
img = document.createElement('img');
document.body.appendChild(img);
div = document.createElement('div');
div.setAttribute('id', 'area');
document.body.appendChild(div);
source = document.createElement('source');
document.body.appendChild(source);
document.body.offsetTop;
document.body.removeChild(seconddiv);
checkLayout('#first')
}
window.onload = boom;
</script>
<!-- crbug.com/492918 : Floats on clean lines should stay with them. -->
...@@ -900,6 +900,10 @@ void LayoutBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState, ...@@ -900,6 +900,10 @@ void LayoutBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState,
} }
for (; it != end; ++it) { for (; it != end; ++it) {
FloatingObject& floatingObject = *it->get(); FloatingObject& floatingObject = *it->get();
// If we've reached the start of clean lines any remaining floating children belong to them.
// We don't care about the 'last float' mechanism once we're in clean lines so it's ok to let it get set below.
if (floatingObject.layoutObject() == cleanLineStart.object())
break;
appendFloatingObjectToLastLine(floatingObject); appendFloatingObjectToLastLine(floatingObject);
ASSERT(floatingObject.layoutObject() == layoutState.floats()[layoutState.floatIndex()].object); ASSERT(floatingObject.layoutObject() == layoutState.floats()[layoutState.floatIndex()].object);
// If a float's geometry has changed, give up on syncing with clean lines. // If a float's geometry has changed, give up on syncing with clean lines.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment