summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2012-08-14 15:24:24 -0700
committerGeorge Mount <mount@google.com>2012-08-14 15:24:24 -0700
commit55f4533e6fc4f50a0ac57b1b180276d679aa04fc (patch)
tree25f3c3da1bd0e42e2027d0a5ec1f71f356b30141 /Source/WebKit/android/jni/WebViewCore.cpp
parentfcadd7a73d414109c41d46fcad0d199ddc656a34 (diff)
downloadexternal_webkit-55f4533e6fc4f50a0ac57b1b180276d679aa04fc.zip
external_webkit-55f4533e6fc4f50a0ac57b1b180276d679aa04fc.tar.gz
external_webkit-55f4533e6fc4f50a0ac57b1b180276d679aa04fc.tar.bz2
Use content size for scroll width calculation.
Bug 6976140 Horizontal scrolling calculation requires use of content and not client width. Vertical scrolling uses client width because text areas support padding differently than text inputs. Change-Id: Ib105c6c185415c1784c83f7203810a3e5416a9c8
Diffstat (limited to 'Source/WebKit/android/jni/WebViewCore.cpp')
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 3324bfd..fd5e9c4 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -3006,7 +3006,7 @@ void WebViewCore::scrollFocusedTextInput(float xPercent, int y)
}
int x = (int)round(xPercent * (renderText->scrollWidth() -
- renderText->clientWidth()));
+ renderText->contentWidth()));
renderText->setScrollLeft(x);
renderText->setScrollTop(y);
focus->document()->frame()->selection()->recomputeCaretRect();
@@ -3417,6 +3417,9 @@ WebCore::IntRect WebViewCore::absoluteClientRect(WebCore::Node* node,
RenderBox* renderBox = toRenderBox(render);
clientRect = renderBox->clientBoxRect();
+ IntRect contentBox = renderBox->contentBoxRect();
+ clientRect.setX(contentBox.x());
+ clientRect.setWidth(contentBox.width());
FloatPoint absPos = renderBox->localToAbsolute(FloatPoint());
clientRect.move(absPos.x() - offset.x(), absPos.y() - offset.y());
}