Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1468)

Unified Diff: Source/core/layout/LayoutBlockFlowLine.cpp

Issue 1298603004: Ensure floats get added to floating objects list even if they don't have a linebox (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/LayoutBlockFlow.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBlockFlowLine.cpp
diff --git a/Source/core/layout/LayoutBlockFlowLine.cpp b/Source/core/layout/LayoutBlockFlowLine.cpp
index 1c192276d25404ba9e39b814d1c0683b9308e72a..2e0ecfd1d1912619178738cb31b94b400cad526b 100644
--- a/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -1042,12 +1042,14 @@ void LayoutBlockFlow::markDirtyFloatsForPaintInvalidation(Vector<FloatWithRect>&
// painted by now if they had moved, but if they stayed at (0, 0), they still need to be
// painted.
for (size_t i = 0; i < floatCount; ++i) {
+ LayoutBox* f = floats[i].object;
if (!floats[i].everHadLayout) {
- LayoutBox* f = floats[i].object;
if (!f->location().x() && !f->location().y())
f->setShouldDoFullPaintInvalidation();
}
+ insertFloatingObject(*f);
}
+ positionNewFloats();
}
struct InlineMinMaxIterator {
@@ -1530,7 +1532,6 @@ void LayoutBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& pa
// deleted and only dirtied. In that case, we can layout the replaced
// elements at the same time.
Vector<LayoutBox*> replacedChildren;
- LayoutObject* lastChild = nullptr;
for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) {
LayoutObject* o = walker.current();
@@ -1565,13 +1566,7 @@ void LayoutBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& pa
dirtyLineBoxesForObject(o, layoutState.isFullLayout());
o->clearNeedsLayout();
}
- if (!o->isText() || !toLayoutText(o)->isAllCollapsibleWhitespace())
- lastChild = o;
}
- // If there is a trailing float on the line that will possibly occur after a natural line break
- // then dirty its adjacent lineboxes to ensure it gets placed.
- if (lastChild && lastChild->isFloating())
- dirtyLinesFromChangedChild(lastChild);
for (size_t i = 0; i < replacedChildren.size(); i++)
replacedChildren[i]->layoutIfNeeded();
« no previous file with comments | « Source/core/layout/LayoutBlockFlow.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698