Chromium Code Reviews| 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 bc46a2b38b836012f8081342507ed02f5b264f16..8c7a41f3163febe910500daf647efe45bb838785 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
| @@ -1999,9 +1999,9 @@ int LayoutBlock::inlineBlockBaseline(LineDirectionMode lineDirection) const |
| return -1; |
| } |
| -LayoutBlock* LayoutBlock::enclosingFirstLineStyleBlock() const |
| +const LayoutBlock* LayoutBlock::enclosingFirstLineStyleBlock() const |
| { |
| - LayoutBlock* firstLineBlock = const_cast<LayoutBlock*>(this); |
| + const LayoutBlock* firstLineBlock = this; |
| bool hasPseudo = false; |
| while (true) { |
| hasPseudo = firstLineBlock->style()->hasPseudoStyle(PseudoIdFirstLine); |
| @@ -2024,10 +2024,10 @@ LayoutBlock* LayoutBlock::enclosingFirstLineStyleBlock() const |
| return firstLineBlock; |
| } |
| -LayoutBlockFlow* LayoutBlock::nearestInnerBlockWithFirstLine() const |
| +LayoutBlockFlow* LayoutBlock::nearestInnerBlockWithFirstLine() |
|
eae
2016/05/10 15:40:54
Can this return a const LayoutBlockFlow?
mstensho (USE GERRIT)
2016/05/10 15:58:16
The caller calls non-const methods on the returned
|
| { |
| if (childrenInline()) |
| - return toLayoutBlockFlow(const_cast<LayoutBlock*>(this)); |
| + return toLayoutBlockFlow(this); |
|
eae
2016/05/10 15:40:54
Could we add a const version of toLayoutBlockFlow
mstensho (USE GERRIT)
2016/05/10 15:58:16
The DEFINE_LAYOUT_OBJECT_TYPE_CASTS macro already
|
| for (LayoutObject* child = firstChild(); child && !child->isFloatingOrOutOfFlowPositioned() && child->isLayoutBlockFlow(); child = toLayoutBlock(child)->firstChild()) { |
| if (child->childrenInline()) |
| return toLayoutBlockFlow(child); |