[Chromium] REGRESSION(r87067): WebFrame::setFindEndstateFocusAndSelection()
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2012 07:22:59 +0000 (07:22 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2012 07:22:59 +0000 (07:22 +0000)
commit4bbeb2be80a975860eeb6a2ee3fef1df1bfae0b2
treed6b5862933ca884b24c4f8d62e1b6844ecb0d20d
parent7c51dd43b9b635af09798d5f446f44f2f8d9fcff
[Chromium] REGRESSION(r87067): WebFrame::setFindEndstateFocusAndSelection()
doesn't set the selection for <input> and <textarea>
https://bugs.webkit.org/show_bug.cgi?id=77186

Reviewed by Hajime Morita.

When the find-in-page box is closed, WebFrame::stopFinding(false) is
called. It calls setFindEndstateFocusAndSelection(). Before r87067,
m_activeMatch was stored as the normal selection in <input> or
<textarea> by accident. r87067 stopped this accidental behavior.

However the behavior of pre-r87067 is useful and we should support it
for contentEditable elements too.

* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::setFindEndstateFocusAndSelection):
- Add special handing for <input> and <textarea> to find a focusable parent.
- Sets the active match as the selection even if a focusable parent is found.
* tests/WebFrameTest.cpp:
(WebKit::TEST_F): Add tests for find() and stopFinding().
* tests/data/find.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebFrameImpl.cpp
Source/WebKit/chromium/tests/WebFrameTest.cpp
Source/WebKit/chromium/tests/data/find.html [new file with mode: 0644]