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

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: Some modifications were not saved to README.md in the previous patch 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 29128938ce17c485b3980639da65cc67b0299fbf..c7939b6a8510faacc9601be6255efcaf2d0b6ac1 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -2292,18 +2292,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;
@@ -2314,7 +2303,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)
@@ -2328,6 +2317,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)
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698