Bug 203440 - Add bindings support for the enterkeyhint HTML attribute
Summary: Add bindings support for the enterkeyhint HTML attribute
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-10-25 18:18 PDT by Wenson Hsieh
Modified: 2019-10-29 09:10 PDT (History)
12 users (show)

See Also:


Attachments
Patch (40.69 KB, patch)
2019-10-27 14:49 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (62.20 KB, patch)
2019-10-28 07:23 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (1.01 MB, patch)
2019-10-28 11:47 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Review feedback + new baselines (1.01 MB, patch)
2019-10-28 12:46 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Rebase on trunk (501.14 KB, patch)
2019-10-28 14:37 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2019-10-25 18:18:00 PDT
Work towards enterkeyhint support.
Comment 1 Wenson Hsieh 2019-10-27 14:49:35 PDT Comment hidden (obsolete)
Comment 2 Wenson Hsieh 2019-10-28 07:23:37 PDT
Created attachment 382069 [details]
Patch
Comment 3 Ryosuke Niwa 2019-10-28 10:20:40 PDT
Comment on attachment 382069 [details]
Patch

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

> Source/WebCore/html/EnterKeyHint.cpp:35
> +static const AtomString& enterKeyHintNameEnter()
> +{
> +    static NeverDestroyed<AtomString> name("enter", AtomString::ConstructFromLiteral);

I don't think these strings should be AtomString.
We're always doing case insensitive comparison, and we're just returning for IDL.
There is virtually no benefit for these rarely used strings to be AtomString.

> Source/WebCore/html/HTMLElement.idl:68
> +    attribute DOMString enterKeyHint;

We need a runtime flag for this.
e.g. I don't think it would be supported on any port but Apple's mobile ports, right?
Does desktop version of Chrome support this attribute as well?
Comment 4 Wenson Hsieh 2019-10-28 10:27:58 PDT
Comment on attachment 382069 [details]
Patch

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

Thanks for the review!

>> Source/WebCore/html/EnterKeyHint.cpp:35
>> +    static NeverDestroyed<AtomString> name("enter", AtomString::ConstructFromLiteral);
> 
> I don't think these strings should be AtomString.
> We're always doing case insensitive comparison, and we're just returning for IDL.
> There is virtually no benefit for these rarely used strings to be AtomString.

Okay! I’ll change these back to regular string literals.

>> Source/WebCore/html/HTMLElement.idl:68
>> +    attribute DOMString enterKeyHint;
> 
> We need a runtime flag for this.
> e.g. I don't think it would be supported on any port but Apple's mobile ports, right?
> Does desktop version of Chrome support this attribute as well?

Yes, the desktop version of Chrome supports this property (i.e. it is present in IDL, and reflects the enumerated attribute values per specification). However, specifying it doesn’t result in any behavioral difference, since there is no virtual keyboard on desktop.

It seems reasonable to match this behavior; I’ll add a runtime switch for enterKeyHint, and enable it by default on Cocoa platforms, for now.
Comment 5 Wenson Hsieh 2019-10-28 11:47:02 PDT Comment hidden (obsolete)
Comment 6 Wenson Hsieh 2019-10-28 12:46:05 PDT Comment hidden (obsolete)
Comment 7 Wenson Hsieh 2019-10-28 14:37:36 PDT
Created attachment 382112 [details]
Rebase on trunk
Comment 8 WebKit Commit Bot 2019-10-28 16:56:26 PDT
Comment on attachment 382112 [details]
Rebase on trunk

Clearing flags on attachment: 382112

Committed r251686: <https://trac.webkit.org/changeset/251686>
Comment 9 WebKit Commit Bot 2019-10-28 16:56:28 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2019-10-28 16:57:33 PDT
<rdar://problem/56690697>
Comment 11 Alexey Proskuryakov 2019-10-29 08:50:58 PDT
This commit added platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https.html, which now shows up as a test with missing results. I don't think that it was supposed to be landed at all.
Comment 12 Wenson Hsieh 2019-10-29 08:52:46 PDT
(In reply to Alexey Proskuryakov from comment #11)
> This commit added
> platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https.
> html, which now shows up as a test with missing results. I don't think that
> it was supposed to be landed at all.

My bad — this was supposed to be a test expectation. Fixing it now.
Comment 13 Wenson Hsieh 2019-10-29 09:10:37 PDT
(In reply to Wenson Hsieh from comment #12)
> (In reply to Alexey Proskuryakov from comment #11)
> > This commit added
> > platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https.
> > html, which now shows up as a test with missing results. I don't think that
> > it was supposed to be landed at all.
> 
> My bad — this was supposed to be a test expectation. Fixing it now.

Replaced the erroneous test with a test expectation in https://trac.webkit.org/r251705.