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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlock.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: Pure paint invalildation change (Element.cpp reverted) 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/LayoutBlock.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
index 2155f0fb821d12c15e88232f0b100bd6df333086..55653fc57e0a6d42549b07b5f36d2ad0d8dc4e72 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -2890,6 +2890,31 @@ bool LayoutBlock::tryLayoutDoingPositionedMovementOnly()
return true;
}
+static void invalidteDisplayItemClientsOfInlineBoxRecursively(InlineBox& box)
rune 2015/12/02 09:00:49 invalidte -> invalidate
Xianzhu 2015/12/02 17:41:57 Done.
+{
+ box.layoutObject().invalidateDisplayItemClient(box);
+ if (!box.isInlineFlowBox())
+ return;
+ for (InlineBox* child = toInlineFlowBox(box).firstChild(); child; child = child->nextOnLine())
+ invalidteDisplayItemClientsOfInlineBoxRecursively(*child);
+}
+
+void LayoutBlock::invalidateDisplayItemClientsOfFirstLine()
mstensho (USE GERRIT) 2015/12/02 10:09:31 Lines are only interesting in block containers, i.
Xianzhu 2015/12/02 17:41:57 Done. Separated this method into LayoutBlock::firs
mstensho (USE GERRIT) 2015/12/03 12:08:10 Acknowledged.
+{
+ 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.
+ if (LayoutObject* child = firstChild()) {
+ if (!child->isFloatingOrOutOfFlowPositioned() && child->isLayoutBlock())
mstensho (USE GERRIT) 2015/12/02 10:09:31 Should only allow LayoutBlockFlow here. It's okay
Xianzhu 2015/12/02 17:41:57 Done. Now this is in LayoutBlock::firstLineContain
+ toLayoutBlock(child)->invalidateDisplayItemClientsOfFirstLine();
+ }
+}
+
#if ENABLE(ASSERT)
void LayoutBlock::checkPositionedObjectsNeedLayout()
{

Powered by Google App Engine
This is Rietveld 408576698