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

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

Issue 2828553002: Search correctly for inline ancestors without a sibling when dirtying lineboxes (Closed)
Patch Set: Created 3 years, 8 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 8cdb236b02d08de27c8c6f7479faa0570dff9945..43085b849537bf6e536b9917ed9b2d933829e23c 100644
--- a/third_party/WebKit/Source/core/layout/line/LineBoxList.cpp
+++ b/third_party/WebKit/Source/core/layout/line/LineBoxList.cpp
@@ -289,16 +289,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 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.
+ // check our nearest inline ancestor with siblings. If we didn't find a line
+ // box, then use our parent's first line box.
RootInlineBox* box = nullptr;
LineLayoutItem curr = child.PreviousSibling();
- if (child.IsFloating() && !curr) {
- LineLayoutInline outer_inline;
- for (LineLayoutItem parent = child.Parent();
- parent && parent.IsLayoutInline() && !parent.PreviousSibling();
- parent = parent.Parent())
- outer_inline = LineLayoutInline(parent);
+ LineLayoutItem parent = child.Parent();
mstensho (USE GERRIT) 2017/04/19 11:37:24 |parent| is only needed if child.IsFloating(), so
+ if (child.IsFloating() && !curr && parent && parent.IsLayoutInline()) {
+ LineLayoutItem outer_inline = parent;
+ while (outer_inline && outer_inline.Parent().IsLayoutInline() &&
+ !outer_inline.PreviousSibling())
mstensho (USE GERRIT) 2017/04/19 11:37:24 Could you check !outer_inline.PreviousSibling() BE
+ outer_inline = outer_inline.Parent();
if (outer_inline)
curr = outer_inline.PreviousSibling();
}
« 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