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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 1410173002: Only use fontMetrics if available in line-height computation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index 3852f28062f1f9c3cbc46d26e638ce95829b3e2b..6cef0714c8c54393249ab3155b0119353ac869b3 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -1307,8 +1307,9 @@ int ComputedStyle::computedLineHeight() const
{
const Length& lh = lineHeight();
- // Negative value means the line height is not set. Use the font's built-in spacing.
- if (lh.isNegative())
+ // Negative value means the line height is not set. Use the font's built-in
+ // spacing, if avalible.
+ if (lh.isNegative() && font().primaryFont())
return fontMetrics().lineSpacing();
if (lh.hasPercent())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698