| Summary: | REGRESSION (WebKit2): Keyboard should have Search button in duckduckgo.com | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Enrica Casucci <enrica> | ||||
| Component: | WebKit2 | Assignee: | Enrica Casucci <enrica> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | ||||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | iPhone / iPad | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Enrica Casucci
2014-05-22 10:02:43 PDT
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. |