Changeset 91058 in webkit
- Timestamp:
- Jul 15, 2011 1:10:54 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r91055 r91058 1 2011-07-15 Kentaro Hara <haraken@google.com> 2 3 Clear the content of a search input form when 'Escape' is pressed. 4 https://bugs.webkit.org/show_bug.cgi?id=51897 5 6 The added test checks if the value in a search input form is cleared 7 and a 'search' event is triggered, when we press 'Escape' key. 8 9 Reviewed by Kent Tamura. 10 11 * fast/forms/input-search-press-escape-key-expected.txt: Added. 12 * fast/forms/input-search-press-escape-key.html: Added. 13 1 14 2011-07-14 Hayato Ito <hayato@chromium.org> 2 15 -
trunk/Source/WebCore/ChangeLog
r91057 r91058 1 2011-07-15 Kentaro Hara <haraken@google.com> 2 3 Clear the content of a search input form when 'Escape' is pressed. 4 https://bugs.webkit.org/show_bug.cgi?id=51897 5 6 This change added handleKeydownEvent() to a search input form, 7 which clears the form and triggers a 'search' event when 'Escape' is pressed. 8 9 Reviewed by Kent Tamura. 10 11 Test: fast/forms/input-search-press-escape-key.html 12 13 * html/SearchInputType.cpp: 14 (WebCore::SearchInputType::handleKeydownEvent): 15 * html/SearchInputType.h: 16 1 17 2011-07-15 Alexandru Chiculita <achicu@adobe.com> 2 18 -
trunk/Source/WebCore/html/SearchInputType.cpp
r91014 r91058 33 33 34 34 #include "HTMLInputElement.h" 35 #include "KeyboardEvent.h" 35 36 #include "RenderTextControlSingleLine.h" 36 37 #include "ShadowRoot.h" … … 100 101 } 101 102 103 void SearchInputType::handleKeydownEvent(KeyboardEvent* event) 104 { 105 if (element()->disabled() || element()->readOnly()) { 106 TextFieldInputType::handleKeydownEvent(event); 107 return; 108 } 109 110 const String& key = event->keyIdentifier(); 111 if (key == "U+001B") { 112 RefPtr<HTMLInputElement> input = element(); 113 input->setValueForUser(""); 114 input->onSearch(); 115 event->setDefaultHandled(); 116 return; 117 } 118 TextFieldInputType::handleKeydownEvent(event); 119 } 120 102 121 void SearchInputType::destroyShadowSubtree() 103 122 { -
trunk/Source/WebCore/html/SearchInputType.h
r91014 r91058 57 57 virtual HTMLElement* resultsButtonElement() const; 58 58 virtual HTMLElement* cancelButtonElement() const; 59 virtual void handleKeydownEvent(KeyboardEvent*); 59 60 60 61 void searchEventTimerFired(Timer<SearchInputType>*);
Note: See TracChangeset
for help on using the changeset viewer.