Summary: | Add click handler to the input element's speech button. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Satish Sampath <satish> | ||||||||
Component: | Forms | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | commit-queue, tkent, webkit.review.bot | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
Bug Depends on: | 41518 | ||||||||||
Bug Blocks: | 39485 | ||||||||||
Attachments: |
|
Description
Satish Sampath
2010-07-11 14:57:38 PDT
Created attachment 61486 [details]
Patch
Comment on attachment 61486 [details]
Patch
WebCore/rendering/TextControlInnerElements.cpp:353
+ input->focus();
focus() dispatches a focus event, and an event handler might remove 'input' node. So the next input->select() can use a deleted object.
Please look at SpinButtonElement::defaultEventHandler() of the latest revision of TextControlInnerElements.cpp.
WebCore/rendering/TextControlInnerElements.cpp:392
+ input->dispatchFormControlChangeEvent();
This has a similar problem. An event handler of the event might remove the 'input' node. So this InputFieldSpeechButtonElement instance might be removed.
So, we need
RefPtr<InputFieldSpeechButtonElement> protector(this);
before input->dispatchFormControlChangeEvent().
Created attachment 61494 [details]
Patch
Address Kent's comments
Attachment 61494 [details] did not pass style-queue:
Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebCore/rendering/TextControlInnerElements.cpp:356: hold_ref is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4]
WebCore/rendering/TextControlInnerElements.cpp:398: hold_ref is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4]
Total errors found: 2 in 3 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 61495 [details]
Patch
Address Kent's comments (2nd try)
Comment on attachment 61495 [details]
Patch
OK.
Comment on attachment 61495 [details] Patch Clearing flags on attachment: 61495 Committed r63315: <http://trac.webkit.org/changeset/63315> All reviewed patches have been landed. Closing bug. |