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..366fb79d603394a3717f7efa2a5cbfe3d0819f32 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::firstLineStyleBlock() 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,15 @@ LayoutBlock* LayoutBlock::firstLineBlock() const |
return firstLineBlock; |
} |
+LayoutBlockFlow* LayoutBlock::firstLineContainer() const |
+{ |
+ 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) |