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

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: Address mstensho's comments 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 0a7572f7a7f0e4aa2ec4a84f2e3f2b828c1c6118..cd182933e695f58441bf80eb4452f1bed940424f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -2296,18 +2296,7 @@ int LayoutBlock::inlineBlockBaseline(LineDirectionMode lineDirection) const
return -1;
}
-static inline bool isLayoutBlockFlowOrLayoutButton(LayoutObject* layoutObject)
-{
- // We include isLayoutButton in this check because buttons are implemented
- // using flex box but should still support first-line|first-letter.
- // The flex box and grid specs require that flex box and grid do not
- // support first-line|first-letter, though.
- // FIXME: Remove when buttons are implemented with align-items instead
- // of flex box.
- return layoutObject->isLayoutBlockFlow() || layoutObject->isLayoutButton();
-}
-
-LayoutBlock* LayoutBlock::firstLineBlock() const
+LayoutBlock* LayoutBlock::enclosingFirstLineStyleBlock() const
{
LayoutBlock* firstLineBlock = const_cast<LayoutBlock*>(this);
bool hasPseudo = false;
@@ -2318,7 +2307,7 @@ LayoutBlock* LayoutBlock::firstLineBlock() const
LayoutObject* parentBlock = firstLineBlock->parent();
if (firstLineBlock->isReplaced() || firstLineBlock->isFloatingOrOutOfFlowPositioned()
|| !parentBlock
- || !isLayoutBlockFlowOrLayoutButton(parentBlock))
+ || !parentBlock->canHaveFirstLineOrFirstLetterStyle())
break;
ASSERT_WITH_SECURITY_IMPLICATION(parentBlock->isLayoutBlock());
if (toLayoutBlock(parentBlock)->firstChild() != firstLineBlock)
@@ -2332,6 +2321,17 @@ LayoutBlock* LayoutBlock::firstLineBlock() const
return firstLineBlock;
}
+LayoutBlockFlow* LayoutBlock::nearestInnerBlockWithFirstLine() const
+{
+ if (childrenInline())
+ return toLayoutBlockFlow(const_cast<LayoutBlock*>(this));
+ for (LayoutObject* child = firstChild(); child && !child->isFloatingOrOutOfFlowPositioned() && child->isLayoutBlockFlow(); child = toLayoutBlock(child)->firstChild()) {
+ if (child->childrenInline())
+ return toLayoutBlockFlow(child);
+ }
+ return nullptr;
+}
+
// Helper methods for obtaining the last line, computing line counts and heights for line counts
// (crawling into blocks).
static bool shouldCheckLines(LayoutObject* obj)

Powered by Google App Engine
This is Rietveld 408576698