[chromium] Add a method didChangeFormState to WebViewClient.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jul 2012 14:23:45 +0000 (14:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jul 2012 14:23:45 +0000 (14:23 +0000)
commitbc00f375064df857fbc33c5ea437e9eb1b8b9623
treea819a0056a4bbbd513f120ac0360f9ae2a85e7d1
parentdfb773bc034481cc03f7caa4d6153f3c217df2a5
[chromium] Add a method didChangeFormState to WebViewClient.
https://bugs.webkit.org/show_bug.cgi?id=90563

Patch by Oli Lan <olilan@chromium.org> on 2012-07-05
Reviewed by Adam Barth.

This patch adds a new method didChangeFormState to WebViewClient,
and calls it from ChromeClientImpl::formStateDidChange with the changed node.

This new method can be used for example by the Android port to update the browser's
IME when the state of the currently focused text node has changed. To facilitate this
usage, a focused() method has been added to WebNode.

A new test has been added to WebViewTest. This test checks that didChangeFormState
is called when an input's value is changed, and also checks that WebNode::focused() returns
the correct value for the provided node, in both the focused and non-focused cases.

* public/WebNode.h:
* public/WebViewClient.h:
(WebKit::WebViewClient::didChangeFormState):
* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::formStateDidChange):
* src/WebNode.cpp:
(WebKit::WebNode::focused):
(WebKit):
* tests/WebViewTest.cpp:
(FormChangeWebViewClient):
(WebKit::FormChangeWebViewClient::didChangeFormState):
(WebKit::FormChangeWebViewClient::reset):
(WebKit::FormChangeWebViewClient::called):
(WebKit::FormChangeWebViewClient::focused):
(WebKit):
(WebKit::TEST_F):
* tests/data/input_field_set_value_while_focused.html: Added.
* tests/data/input_field_set_value_while_not_focused.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebNode.h
Source/WebKit/chromium/public/WebViewClient.h
Source/WebKit/chromium/src/ChromeClientImpl.cpp
Source/WebKit/chromium/src/WebNode.cpp
Source/WebKit/chromium/tests/WebViewTest.cpp
Source/WebKit/chromium/tests/data/input_field_set_value_while_focused.html [new file with mode: 0644]
Source/WebKit/chromium/tests/data/input_field_set_value_while_not_focused.html [new file with mode: 0644]