Open Safari and navigate to duckduckgo.com. Tap on the input field. The keyboard has the Go button instead of Search.
<rdar://problem/17004207>
Created attachment 231894 [details] Patch
Comment on attachment 231894 [details] Patch r=me Might be nice to share this code in a helper function, if it matches WK1.
Comment on attachment 231894 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=231894&action=review > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:1860 > + if (element->getAttribute("pattern") == "\\d*" || element->getAttribute("pattern") == "[0-9]*") This could be done slightly more efficiently: const AtomicString& pattern = element->fastGetAttribute(HTMLNames::patternAttr); if (pattern == "\\d*" || pattern == "[0-9]*") .... > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:1865 > + && (element->getNameAttribute().contains("search") || element->getIdAttribute().contains("search") || element->fastGetAttribute(HTMLNames::titleAttr).string().contains("search"))) I think you can call .contains() directly on the return value from fastGetAttribute().
(In reply to comment #3) > (From update of attachment 231894 [details]) > r=me > > Might be nice to share this code in a helper function, if it matches WK1. Unfortunately the WK1 is in UIKit.
(In reply to comment #4) > (From update of attachment 231894 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=231894&action=review > > > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:1860 > > + if (element->getAttribute("pattern") == "\\d*" || element->getAttribute("pattern") == "[0-9]*") > > This could be done slightly more efficiently: > > const AtomicString& pattern = element->fastGetAttribute(HTMLNames::patternAttr); > if (pattern == "\\d*" || pattern == "[0-9]*") > .... > > > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:1865 > > + && (element->getNameAttribute().contains("search") || element->getIdAttribute().contains("search") || element->fastGetAttribute(HTMLNames::titleAttr).string().contains("search"))) > > I think you can call .contains() directly on the return value from fastGetAttribute(). Will do. thanks!
Committed revision 169207.