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.
Created attachment 254534 [details] Patch
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 "".
(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 "".
Committed r185459: <http://trac.webkit.org/changeset/185459>