Bug 145780 - Simplify event handling logic for search cancel button
Summary: Simplify event handling logic for search cancel button
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords:
Depends on: 145774
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-08 18:18 PDT by Daniel Bates
Modified: 2015-06-11 10:21 PDT (History)
4 users (show)

See Also:


Attachments
Patch (26.38 KB, patch)
2015-06-08 18:26 PDT, Daniel Bates
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2015-06-08 18:18:01 PDT
Following the patch for bug #145774, we can take advantage of the click event to simplify the event handling logic for the search cancel button.
Comment 1 Daniel Bates 2015-06-08 18:26:29 PDT
Created attachment 254534 [details]
Patch
Comment 2 Darin Adler 2015-06-09 11:31:41 PDT
Comment on attachment 254534 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=254534&action=review

r=me if you figure out how to make this work or compile it out on iOS

> Source/WebCore/html/shadow/TextControlInnerElements.cpp:176
> +    setAttribute(aria_labelAttr, AtomicString(AXSearchFieldCancelButtonText()));

iOS build failure:

html/shadow/TextControlInnerElements.cpp:176:47: error: use of undeclared identifier 'AXSearchFieldCancelButtonText'
    setAttribute(aria_labelAttr, AtomicString(AXSearchFieldCancelButtonText()));

That is in a !PLATFORM(IOS) block.

Separate question: Is the explicit AtomicString construction required here?

> Source/WebCore/html/shadow/TextControlInnerElements.cpp:201
> +        input->setValueForUser("");

Please use emptyString() rather than "".
Comment 3 Daniel Bates 2015-06-11 10:16:45 PDT
(In reply to comment #2)
> > Source/WebCore/html/shadow/TextControlInnerElements.cpp:176
> > +    setAttribute(aria_labelAttr, AtomicString(AXSearchFieldCancelButtonText()));
> 
> iOS build failure:
> 
> html/shadow/TextControlInnerElements.cpp:176:47: error: use of undeclared
> identifier 'AXSearchFieldCancelButtonText'
>     setAttribute(aria_labelAttr,
> AtomicString(AXSearchFieldCancelButtonText()));
> 
> That is in a !PLATFORM(IOS) block.

Will add !PLATFORM(IOS)-guard around this code. 

> 
> Separate question: Is the explicit AtomicString construction required here?

No, it is not required. Will remove.
 
> 
> > Source/WebCore/html/shadow/TextControlInnerElements.cpp:201
> > +        input->setValueForUser("");
> 
> Please use emptyString() rather than "".

Will substitute emptyString() for "".
Comment 4 Daniel Bates 2015-06-11 10:21:28 PDT
Committed r185459: <http://trac.webkit.org/changeset/185459>