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 605c990b65b93b50879aac549a6e53232b9cc04a..c82869d7fdd1d998a05f61f7a86f83e4995f91c8 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp |
@@ -2489,8 +2489,15 @@ int LayoutBlockFlow::lineCount(const RootInlineBox* stopRootInlineBox) const { |
return count; |
} |
+bool LayoutBlockFlow::isDescentBaseline() const { |
+ if (isOrthogonalWritingModeRoot()) |
+ return !styleRef().isHorizontalWritingMode(); |
kojii
2016/11/16 17:18:06
Just curious, since I don't understand, why do we
jfernandez
2016/11/16 18:50:07
In the general case, we don't compute baselines fo
kojii
2016/11/18 04:14:53
Oh I think I understand this. I think the missing
|
+ return parent() ? parent()->styleRef().isFlippedLinesWritingMode() |
+ : styleRef().isFlippedLinesWritingMode(); |
+} |
+ |
int LayoutBlockFlow::firstLineBoxBaseline() const { |
- if (isWritingModeRoot() && !isRubyRun()) |
+ if (isWritingModeRoot() && !isRubyRun() && !isGridItem()) |
return -1; |
if (!childrenInline()) |
return LayoutBlock::firstLineBoxBaseline(); |
@@ -2500,7 +2507,11 @@ int LayoutBlockFlow::firstLineBoxBaseline() const { |
if (!fontData) |
return -1; |
return (firstLineBox()->logicalTop() + |
- fontData->getFontMetrics().ascent(firstRootBox()->baselineType())) |
+ (!isDescentBaseline() |
+ ? fontData->getFontMetrics().ascent( |
+ firstRootBox()->baselineType()) |
+ : fontData->getFontMetrics().descent( |
+ firstRootBox()->baselineType()))) |
.toInt(); |
} |
return -1; |