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

Unified Diff: third_party/WebKit/Source/core/layout/line/LineBoxList.cpp

Issue 2411773003: Dirty lineboxes when adding a float to an empty inline (Closed)
Patch Set: Created 4 years, 2 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 | « third_party/WebKit/LayoutTests/fast/block/float/float-should-dirty-line-when-adjacent-to-line-breaks-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/line/LineBoxList.cpp
diff --git a/third_party/WebKit/Source/core/layout/line/LineBoxList.cpp b/third_party/WebKit/Source/core/layout/line/LineBoxList.cpp
index 2aa487326992f9513535a2042caa82972b448fe3..f63948a40d51aebba58657fbf6155f21bd87c46f 100644
--- a/third_party/WebKit/Source/core/layout/line/LineBoxList.cpp
+++ b/third_party/WebKit/Source/core/layout/line/LineBoxList.cpp
@@ -287,11 +287,16 @@ void LineBoxList::dirtyLinesFromChangedChild(LineLayoutItem container,
}
// Try to figure out which line box we belong in. First try to find a previous
- // line box by examining our siblings. If we didn't find a line box, then use
- // our parent's first line box.
+ // line box by examining our siblings. If we are a float inside an inline then
+ // check the siblings of our inline parent. If we didn't find a line box, then
+ // use our parent's first line box.
RootInlineBox* box = nullptr;
- LineLayoutItem curr = nullptr;
- for (curr = child.previousSibling(); curr; curr = curr.previousSibling()) {
+ LineLayoutItem curr = child.isFloating() && !child.previousSibling() &&
+ child.parent() &&
+ child.parent().isLayoutInline()
+ ? child.parent().previousSibling()
+ : child.previousSibling();
+ for (; curr; curr = curr.previousSibling()) {
if (curr.isFloatingOrOutOfFlowPositioned())
continue;
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/block/float/float-should-dirty-line-when-adjacent-to-line-breaks-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698