summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav/CacheBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/android/nav/CacheBuilder.cpp')
-rw-r--r--WebKit/android/nav/CacheBuilder.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp
index 47c7c70..c631cd4 100644
--- a/WebKit/android/nav/CacheBuilder.cpp
+++ b/WebKit/android/nav/CacheBuilder.cpp
@@ -1303,11 +1303,18 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
static_cast<RenderTextControl*>(nodeRenderer);
if (isFocus)
cachedRoot->setSelection(renderText->selectionStart(), renderText->selectionEnd());
- // FIXME: Would it be better to use (float) size()?
// FIXME: Are we sure there will always be a style and font, and it's correct?
RenderStyle* style = nodeRenderer->style();
if (style) {
isUnclipped |= !style->hasAppearance();
+ int lineHeight = -1;
+ Length lineHeightLength = style->lineHeight();
+ // If the lineHeight is negative, WebTextView will calculate it
+ // based on the text size, using the Paint.
+ // See RenderStyle.computedLineHeight.
+ if (lineHeightLength.isPositive())
+ lineHeight = style->computedLineHeight();
+ cachedInput.setLineHeight(lineHeight);
cachedInput.setTextSize(style->font().size());
cachedInput.setIsRtlText(style->direction() == RTL
|| style->textAlign() == WebCore::RIGHT