Changeset 20072 in webkit
- Timestamp:
- Mar 8, 2007 6:12:43 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r20071 r20072 1 2007-03-08 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Adele. 4 5 <rdar://problem/4646563> REGRESSION: Unable to send text message from Verizon text message website: vtext.com (12588) 6 http://bugs.webkit.org/show_bug.cgi?id=12588 7 8 Carefully revised which focus operations restore previous selection, which clear it, and which 9 select the whole control contents, these test cases cover every focus call I could find. 10 11 * fast/forms/focus-selection-input-expected.txt: Added. 12 * fast/forms/focus-selection-input.html: Added. 13 * fast/forms/focus-selection-textarea-expected.txt: Added. 14 * fast/forms/focus-selection-textarea.html: Added. 15 * fast/forms/onselect-textfield-expected.txt: 16 1 17 2007-03-08 Justin Garcia <justin.garcia@apple.com> 2 18 -
trunk/LayoutTests/fast/forms/onselect-textfield-expected.txt
r17562 r20072 17 17 18 18 Calling focus on text field 19 After focus: text field selection start: 0end: 1019 After focus: text field selection start: 6 end: 10 20 20 -
trunk/WebCore/ChangeLog
r20071 r20072 1 2007-03-08 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Adele. 4 5 <rdar://problem/4646563> REGRESSION: Unable to send text message from Verizon text message website: vtext.com (12588) 6 http://bugs.webkit.org/show_bug.cgi?id=12588 7 8 Carefully revised which focus operations restore previous selection, which clear it, and which 9 select the whole control contents. 10 11 Tests: 12 fast/forms/focus-selection-input.html 13 fast/forms/focus-selection-textarea.html 14 15 * dom/Element.cpp: 16 (WebCore::Element::focus): 17 * dom/Element.h: 18 * html/HTMLInputElement.cpp: 19 (WebCore::HTMLInputElement::focus): 20 (WebCore::HTMLInputElement::accessKeyAction): 21 * html/HTMLInputElement.h: 22 * html/HTMLLabelElement.cpp: 23 (WebCore::HTMLLabelElement::focus): 24 (WebCore::HTMLLabelElement::accessKeyAction): 25 * html/HTMLLabelElement.h: 26 * html/HTMLLegendElement.cpp: 27 (WebCore::HTMLLegendElement::focus): 28 * html/HTMLLegendElement.h: 29 * html/HTMLTextAreaElement.cpp: 30 (WebCore::HTMLTextAreaElement::focus): 31 * html/HTMLTextAreaElement.h: 32 * page/FocusController.cpp: 33 (WebCore::FocusController::advanceFocus): 34 1 35 2007-03-08 Justin Garcia <justin.garcia@apple.com> 2 36 -
trunk/WebCore/dom/Element.cpp
r20028 r20072 890 890 } 891 891 892 void Element::focus( )892 void Element::focus(bool restorePreviousSelection) 893 893 { 894 894 Document* doc = document(); … … 906 906 } 907 907 908 updateFocusAppearance( );908 updateFocusAppearance(restorePreviousSelection); 909 909 } 910 910 -
trunk/WebCore/dom/Element.h
r20028 r20072 159 159 virtual String target() const { return String(); } 160 160 161 virtual void focus( );161 virtual void focus(bool restorePreviousSelection = true); 162 162 virtual void updateFocusAppearance(bool restorePreviousSelection = false); 163 163 void blur(); -
trunk/WebCore/html/HTMLInputElement.cpp
r19672 r20072 183 183 } 184 184 185 void HTMLInputElement::focus( )185 void HTMLInputElement::focus(bool restorePreviousSelection) 186 186 { 187 187 if (isTextField()) { … … 199 199 return; 200 200 } 201 updateFocusAppearance( );201 updateFocusAppearance(restorePreviousSelection); 202 202 return; 203 203 } 204 HTMLGenericFormElement::focus( );204 HTMLGenericFormElement::focus(restorePreviousSelection); 205 205 } 206 206 … … 535 535 case RESET: 536 536 case SUBMIT: 537 // focus 538 focus(); 537 focus(false); 539 538 // send the mouse button events iff the caller specified sendToAnyElement 540 539 dispatchSimulatedClick(0, sendToAnyElement); … … 547 546 case SEARCH: 548 547 case TEXT: 549 focus(); 548 // should never restore previous selection here 549 focus(false); 550 550 break; 551 551 } -
trunk/WebCore/html/HTMLInputElement.h
r19662 r20072 62 62 virtual bool isMouseFocusable() const; 63 63 virtual bool isEnumeratable() const { return inputType() != IMAGE; } 64 virtual void focus( );64 virtual void focus(bool restorePreviousSelection = true); 65 65 virtual void dispatchFocusEvent(); 66 66 virtual void dispatchBlurEvent(); -
trunk/WebCore/html/HTMLLabelElement.cpp
r18293 r20072 27 27 #include "config.h" 28 28 #include "HTMLLabelElement.h" 29 30 #include "Document.h" 31 #include "Event.h" 32 #include "EventNames.h" 29 33 #include "HTMLFormElement.h" 30 31 34 #include "HTMLNames.h" 32 #include "EventNames.h"33 #include "Event.h"34 #include "Document.h"35 35 36 36 namespace WebCore { … … 131 131 } 132 132 133 void HTMLLabelElement::focus( )133 void HTMLLabelElement::focus(bool) 134 134 { 135 // to match other browsers, always restore previous selection 135 136 if (Element* element = formElement()) 136 137 element->focus(); … … 139 140 void HTMLLabelElement::accessKeyAction(bool sendToAnyElement) 140 141 { 141 Element *element = formElement(); 142 if (element) 142 if (Element* element = formElement()) 143 143 element->accessKeyAction(sendToAnyElement); 144 144 } -
trunk/WebCore/html/HTMLLabelElement.h
r18874 r20072 65 65 void setHtmlFor(const String &); 66 66 67 void focus( );67 void focus(bool restorePreviousSelection = true); 68 68 69 69 private: -
trunk/WebCore/html/HTMLLegendElement.cpp
r15299 r20072 106 106 } 107 107 108 void HTMLLegendElement::focus( )108 void HTMLLegendElement::focus(bool) 109 109 { 110 // to match other browsers, never restore previous selection 110 111 if (Element *element = formElement()) 111 element->focus( );112 element->focus(false); 112 113 } 113 114 -
trunk/WebCore/html/HTMLLegendElement.h
r18874 r20072 52 52 void setAlign(const String &); 53 53 54 void focus( );54 void focus(bool restorePreviousSelection = true); 55 55 }; 56 56 -
trunk/WebCore/html/HTMLTextAreaElement.cpp
r19662 r20072 201 201 } 202 202 203 void HTMLTextAreaElement::focus( )203 void HTMLTextAreaElement::focus(bool) 204 204 { 205 205 Document* doc = document(); -
trunk/WebCore/html/HTMLTextAreaElement.h
r19662 r20072 73 73 virtual bool isMouseFocusable() const; 74 74 virtual bool isKeyboardFocusable(KeyboardEvent*) const; 75 virtual void focus( );75 virtual void focus(bool restorePreviousSelection = true); 76 76 virtual void updateFocusAppearance(bool restorePreviousSelection = true); 77 77 -
trunk/WebCore/page/FocusController.cpp
r19636 r20072 204 204 setFocusedFrame(newDocument->frame()); 205 205 206 static_cast<Element*>(node)->focus( );206 static_cast<Element*>(node)->focus(false); 207 207 return true; 208 208 }
Note: See TracChangeset
for help on using the changeset viewer.