[Webkit-unassigned] [Bug 51897] Escape should clear search field

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 13 18:06:02 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=51897


Kent Tamura <tkent at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #100667|review?                     |review-
               Flag|                            |




--- Comment #3 from Kent Tamura <tkent at chromium.org>  2011-07-13 18:06:02 PST ---
(From update of attachment 100667)
View in context: https://bugs.webkit.org/attachment.cgi?id=100667&action=review

r- because of possible use-after-free.


> LayoutTests/fast/forms/input-search-press-escape-key.html:28
> +    eventSender.keyDown("escape");

Do you need to use eventSender?
Doesn't the following event dispatching work?
 var event = document.createEvent('KeyboardEvents');
 event.initKeyboardEvent(...);
 input.dispatchEvent(event);

> Source/WebCore/html/SearchInputType.cpp:110
> +        input->setValueForUser("");
> +        input->onSearch();

setValueForUser() dispatches 'change' event and a JavaScript handler can delete 'input'.
You need to use RefPtr<HTMLInputElement>.

>> Source/WebCore/html/SearchInputType.cpp:113
>> +        TextFieldInputType::handleKeydownEvent(event);
> 
> Does this mean it's impossible for content to handle 'esc' specially?  I wonder if this maybe belongs on keypress rather than keydown.

Agree with Evan.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list