| 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 31ac24aa956778860b7b74b2639ba2d1d366c9d9..fa169158b81c529d37f765e06af04bba1d8c60e4 100644
|
| --- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| +++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| @@ -1351,6 +1351,21 @@ Length ComputedStyle::lineHeight() const
|
|
|
| void ComputedStyle::setLineHeight(const Length& specifiedLineHeight) { SET_VAR(inherited, line_height, specifiedLineHeight); }
|
|
|
| +float ComputedStyle::floatComputedLineHeight() const
|
| +{
|
| + const Length& lh = lineHeight();
|
| +
|
| + // Negative value means the line height is not set. Use the font's built-in
|
| + // spacing, if avalible.
|
| + if (lh.isNegative() && font().primaryFont())
|
| + return getFontMetrics().lineSpacing();
|
| +
|
| + if (lh.hasPercent())
|
| + return minimumValueForLength(lh, LayoutUnit(computedFontSize()));
|
| +
|
| + return std::min(lh.value(), LayoutUnit::max().toFloat());
|
| +}
|
| +
|
| int ComputedStyle::computedLineHeight() const
|
| {
|
| const Length& lh = lineHeight();
|
|
|