Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp

Issue 1407633003: [css-grid] Implementation of Baseline Self-Alignment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed several bug and added new tests. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..fc1446abecc59b746bc5761f1020c06e3db02e65 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -2490,7 +2490,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();
@@ -2500,7 +2500,11 @@ int LayoutBlockFlow::firstLineBoxBaseline() const {
if (!fontData)
return -1;
return (firstLineBox()->logicalTop() +
- fontData->getFontMetrics().ascent(firstRootBox()->baselineType()))
+ (firstLineBox()->isHorizontal()
+ ? fontData->getFontMetrics().ascent(
+ firstRootBox()->baselineType())
+ : fontData->getFontMetrics().descent(
+ firstRootBox()->baselineType())))
kojii 2016/11/15 04:21:15 My intuition tells me that using descent is only c
jfernandez 2016/11/16 11:51:24 Yes, you are totally right. using descent only mak
kojii 2016/11/16 17:18:06 Thank you for doing the extensive research, and so
jfernandez 2016/11/16 18:50:07 I understand, I think we can still implement some
.toInt();
}
return -1;

Powered by Google App Engine
This is Rietveld 408576698