Bug 133183 - REGRESSION (WebKit2): Keyboard should have Search button in duckduckgo.com
Summary: REGRESSION (WebKit2): Keyboard should have Search button in duckduckgo.com
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Enrica Casucci
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-22 10:02 PDT by Enrica Casucci
Modified: 2014-05-22 11:04 PDT (History)
0 users

See Also:


Attachments
Patch (2.29 KB, patch)
2014-05-22 10:17 PDT, Enrica Casucci
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enrica Casucci 2014-05-22 10:02:43 PDT
Open Safari and navigate to duckduckgo.com.
Tap on the input field.
The keyboard has the Go button instead of Search.
Comment 1 Enrica Casucci 2014-05-22 10:04:22 PDT
<rdar://problem/17004207>
Comment 2 Enrica Casucci 2014-05-22 10:17:13 PDT
Created attachment 231894 [details]
Patch
Comment 3 Geoffrey Garen 2014-05-22 10:38:24 PDT
Comment on attachment 231894 [details]
Patch

r=me

Might be nice to share this code in a helper function, if it matches WK1.
Comment 4 Andreas Kling 2014-05-22 10:44:35 PDT
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().
Comment 5 Enrica Casucci 2014-05-22 10:55:58 PDT
(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.
Comment 6 Enrica Casucci 2014-05-22 10:56:21 PDT
(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!
Comment 7 Enrica Casucci 2014-05-22 11:04:34 PDT
Committed revision 169207.