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

Unified Diff: Source/core/rendering/InlineTextBox.cpp

Issue 182923003: Chrome not considering Underline Position from Font (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing TestExpectation Created 6 years, 8 months 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/platform/fonts/FontMetrics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/InlineTextBox.cpp
diff --git a/Source/core/rendering/InlineTextBox.cpp b/Source/core/rendering/InlineTextBox.cpp
index dcb093c0379302ef922e0d75d88c12ff06442363..a28b0d4d71c23401efd9c990bf81fd919f4ac800 100644
--- a/Source/core/rendering/InlineTextBox.cpp
+++ b/Source/core/rendering/InlineTextBox.cpp
@@ -920,7 +920,18 @@ static int computeUnderlineOffset(const TextUnderlinePosition underlinePosition,
{
// Compute the gap between the font and the underline. Use at least one
// pixel gap, if underline is thick then use a bigger gap.
- const int gap = std::max<int>(1, ceilf(textDecorationThickness / 2.f));
+ int gap = 0;
+
+ // Underline position of zero means draw underline on Baseline Position,
+ // in Blink we need at least 1-pixel gap to adding following check.
+ // Positive underline Position means underline should be drawn above baselin e
+ // and negative value means drawing below baseline, negating the value as in Blink
+ // downward Y-increases.
+
+ if (fontMetrics.underlinePosition())
+ gap = -fontMetrics.underlinePosition();
+ else
+ gap = std::max<int>(1, ceilf(textDecorationThickness / 2.f));
// FIXME: We support only horizontal text for now.
switch (underlinePosition) {
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/platform/fonts/FontMetrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698