| 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)
|
|
|