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

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

Issue 1473363003: Invalidate first line display item clients when first line style changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Invalidate the whole first line Created 5 years 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
Index: third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
index 3d7b00a155cc56f05ddcf3cbe3f00a7405d4368f..cf9b7d198c9f80d07e7d08849d42b5430564a63e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -2065,4 +2065,30 @@ LayoutUnit LayoutBlockFlow::startAlignedOffsetForLine(LayoutUnit position, bool
return logicalLeft;
}
+static void invalidteDisplayItemClientsOfInlineBoxRecursively(InlineBox& box)
+{
+ box.layoutObject().invalidateDisplayItemClient(box);
+ if (!box.isInlineFlowBox())
+ return;
+ for (InlineBox* child = toInlineFlowBox(box).firstChild(); child; child = child->nextOnLine())
+ invalidteDisplayItemClientsOfInlineBoxRecursively(*child);
+}
+
+void LayoutBlockFlow::invalidateDisplayItemClientsOfFirstLine()
+{
+ if (childrenInline()) {
+ // This block has the first line.
+ if (RootInlineBox* firstRootBox = this->firstRootBox())
+ invalidteDisplayItemClientsOfInlineBoxRecursively(*firstRootBox);
+ return;
+ }
+
+ // Let the first child flow find the first line.
+ LayoutObject* child = firstChild();
+ while (child && child->isFloatingOrOutOfFlowPositioned())
+ child = child->nextSibling();
+ if (child && child->isLayoutBlockFlow())
+ toLayoutBlockFlow(child)->invalidateDisplayItemClientsOfFirstLine();
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698