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(); |
+} |
+ |
} |