diff options
author | mjs <mjs@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2007-03-09 02:12:43 +0000 |
---|---|---|
committer | mjs <mjs@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2007-03-09 02:12:43 +0000 |
commit | 925f06aa519a5b9f02f6b19328346f2d97510abd (patch) | |
tree | d21a7ce5757f283d9a9027f145c08930a7495ff5 /third_party/WebKit/WebCore/html/HTMLInputElement.cpp | |
parent | dbd6ced54baa1919a712fa6fac3bc16caba4f5b2 (diff) | |
download | chromium_src-925f06aa519a5b9f02f6b19328346f2d97510abd.zip chromium_src-925f06aa519a5b9f02f6b19328346f2d97510abd.tar.gz chromium_src-925f06aa519a5b9f02f6b19328346f2d97510abd.tar.bz2 |
LayoutTests:
Reviewed by Adele.
<rdar://problem/4646563> REGRESSION: Unable to send text message from Verizon text message website: vtext.com (12588)
http://bugs.webkit.org/show_bug.cgi?id=12588
Carefully revised which focus operations restore previous selection, which clear it, and which
select the whole control contents, these test cases cover every focus call I could find.
* fast/forms/focus-selection-input-expected.txt: Added.
* fast/forms/focus-selection-input.html: Added.
* fast/forms/focus-selection-textarea-expected.txt: Added.
* fast/forms/focus-selection-textarea.html: Added.
* fast/forms/onselect-textfield-expected.txt:
WebCore:
Reviewed by Adele.
<rdar://problem/4646563> REGRESSION: Unable to send text message from Verizon text message website: vtext.com (12588)
http://bugs.webkit.org/show_bug.cgi?id=12588
Carefully revised which focus operations restore previous selection, which clear it, and which
select the whole control contents.
Tests:
fast/forms/focus-selection-input.html
fast/forms/focus-selection-textarea.html
* dom/Element.cpp:
(WebCore::Element::focus):
* dom/Element.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::focus):
(WebCore::HTMLInputElement::accessKeyAction):
* html/HTMLInputElement.h:
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::focus):
(WebCore::HTMLLabelElement::accessKeyAction):
* html/HTMLLabelElement.h:
* html/HTMLLegendElement.cpp:
(WebCore::HTMLLegendElement::focus):
* html/HTMLLegendElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::focus):
* html/HTMLTextAreaElement.h:
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocus):
git-svn-id: svn://svn.chromium.org/blink/trunk@20072 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/WebCore/html/HTMLInputElement.cpp')
-rw-r--r-- | third_party/WebKit/WebCore/html/HTMLInputElement.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/third_party/WebKit/WebCore/html/HTMLInputElement.cpp b/third_party/WebKit/WebCore/html/HTMLInputElement.cpp index e2bcb9a..fb949fe 100644 --- a/third_party/WebKit/WebCore/html/HTMLInputElement.cpp +++ b/third_party/WebKit/WebCore/html/HTMLInputElement.cpp @@ -182,7 +182,7 @@ bool HTMLInputElement::isMouseFocusable() const return HTMLGenericFormElement::isMouseFocusable(); } -void HTMLInputElement::focus() +void HTMLInputElement::focus(bool restorePreviousSelection) { if (isTextField()) { Document* doc = document(); @@ -198,10 +198,10 @@ void HTMLInputElement::focus() setNeedsFocusAppearanceUpdate(true); return; } - updateFocusAppearance(); + updateFocusAppearance(restorePreviousSelection); return; } - HTMLGenericFormElement::focus(); + HTMLGenericFormElement::focus(restorePreviousSelection); } void HTMLInputElement::updateFocusAppearance(bool restorePreviousSelection) @@ -534,8 +534,7 @@ void HTMLInputElement::accessKeyAction(bool sendToAnyElement) case RANGE: case RESET: case SUBMIT: - // focus - focus(); + focus(false); // send the mouse button events iff the caller specified sendToAnyElement dispatchSimulatedClick(0, sendToAnyElement); break; @@ -546,7 +545,8 @@ void HTMLInputElement::accessKeyAction(bool sendToAnyElement) case PASSWORD: case SEARCH: case TEXT: - focus(); + // should never restore previous selection here + focus(false); break; } } |