[Chromium] Support scrolling and zooming to focused input elements
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jul 2012 00:27:19 +0000 (00:27 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jul 2012 00:27:19 +0000 (00:27 +0000)
commit37ee841278eddbe9f131358d078c7e3b1ca72113
treeb0961eadbdc3fde713dbdd1c99cb594085eeb9c9
parente85832e030ac5e558fdf3db265a1e28f507c4c50
[Chromium] Support scrolling and zooming to focused input elements
https://bugs.webkit.org/show_bug.cgi?id=91661

Reviewed by Darin Fisher.

This patch introduces saveScrollAndScaleState and
restoreScrollAndScaleState, which can be used to save and restore the
scroll and scale state of the WebView, respectively.  These functions
will be used by Chromium on Android to save the scale and scrolls state
before zoom into a text field so that we can "undo" the zoom if the
user didn't mean to zoom into the text field.

I wanted to write unit tests for these functions, but it wasn't clear
to me how to write the test because startPageScaleAnimation appears to
complete asynchronously.

* public/WebView.h:
(WebView):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::saveScrollAndScaleState):
(WebKit):
(WebKit::WebViewImpl::restoreScrollAndScaleState):
(WebKit::WebViewImpl::resetSavedScrollAndScaleState):
(WebKit::WebViewImpl::didCommitLoad):
* src/WebViewImpl.h:
(WebViewImpl):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebView.h
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.h