| Index: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
|
| index 57a5aa11f641632a5b678a064782f06370c959f0..4301af8b41fae899b9e1ac5fb1d0121622ff8c74 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
|
| @@ -2522,7 +2522,7 @@ int LayoutBlockFlow::lineCount(const RootInlineBox* stopRootInlineBox) const {
|
| }
|
|
|
| int LayoutBlockFlow::firstLineBoxBaseline() const {
|
| - if (isWritingModeRoot() && !isRubyRun())
|
| + if (isWritingModeRoot() && !isRubyRun() && !isGridItem())
|
| return -1;
|
| if (!childrenInline())
|
| return LayoutBlock::firstLineBoxBaseline();
|
| @@ -2531,7 +2531,9 @@ int LayoutBlockFlow::firstLineBoxBaseline() const {
|
| DCHECK(fontData);
|
| if (!fontData)
|
| return -1;
|
| - return (firstLineBox()->logicalTop() +
|
| + return ((styleRef().isFlippedLinesWritingMode()
|
| + ? logicalHeight() - firstLineBox()->logicalBottom()
|
| + : firstLineBox()->logicalTop()) +
|
| fontData->getFontMetrics().ascent(firstRootBox()->baselineType()))
|
| .toInt();
|
| }
|
|
|