Bug 187741

Summary: [Datalist] Add button to TextFieldInputs with a datalist
Product: WebKit Reporter: Aditya Keerthi <pxlcoder>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, cdumez, commit-queue, ews-watchlist, keishi, ryanhaddad, simon.fraser, thorton, timothy, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Archive of layout-test-results from ews200 for win-future
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
thorton: review+
Patch
none
Archive of layout-test-results from ews126 for ios-simulator-wk2
none
Patch for landing none

Aditya Keerthi
Reported 2018-07-17 15:42:12 PDT
There should be some indication that the input field has suggestions available.
Attachments
Patch (53.18 KB, patch)
2018-07-17 15:55 PDT, Aditya Keerthi
no flags
Patch (56.00 KB, patch)
2018-07-18 09:22 PDT, Aditya Keerthi
no flags
Archive of layout-test-results from ews200 for win-future (13.02 MB, application/zip)
2018-07-18 14:57 PDT, EWS Watchlist
no flags
Patch (56.22 KB, patch)
2018-07-24 10:50 PDT, Aditya Keerthi
no flags
Patch (58.01 KB, patch)
2018-07-25 21:39 PDT, Aditya Keerthi
no flags
Patch (58.05 KB, patch)
2018-07-26 15:12 PDT, Aditya Keerthi
no flags
Patch (58.04 KB, patch)
2018-07-26 15:28 PDT, Aditya Keerthi
no flags
Patch (58.19 KB, patch)
2018-07-26 20:44 PDT, Aditya Keerthi
no flags
Patch (57.25 KB, patch)
2018-08-13 14:40 PDT, Aditya Keerthi
thorton: review+
Patch (56.90 KB, patch)
2018-08-13 15:07 PDT, Aditya Keerthi
no flags
Archive of layout-test-results from ews126 for ios-simulator-wk2 (2.57 MB, application/zip)
2018-08-13 16:47 PDT, EWS Watchlist
no flags
Patch for landing (57.83 KB, patch)
2018-08-15 09:52 PDT, Aditya Keerthi
no flags
Aditya Keerthi
Comment 1 2018-07-17 15:55:42 PDT
Tim Horton
Comment 2 2018-07-17 16:07:40 PDT
Comment on attachment 345203 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345203&action=review > Source/WebCore/html/TextFieldInputType.cpp:322 > +#if ENABLE(DATALIST_ELEMENT) This seems weird at a glance but I haven't read enough to know what's up. > Source/WebCore/html/TextFieldInputType.cpp:883 > + return (m_suggestionPicker != nullptr); no need for all these characters, we don't usually do explicit comparisons with 0 (`return m_suggestionPicker` should be fine) > Source/WebCore/rendering/RenderThemeMac.mm:262 > + NSData *data = [[NSData alloc] initWithBase64EncodedString:@"iVBORw0KGgoAAAANSUhEUgAAAA4AAAAJCAYAAAACTR1pAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAAAr0lEQVQoFYWOMQrCUBBEfwhomSqtkNoL6An0WLmHZzB4Au0VrBUsbW0sbFJ838Rd+H4iLkxmdnbmkxBj3IEnWIc/Q2Zl2S4geqB5geWvLreFZaDYq9hK2TzgeV6WB3TzaVUswMYd+A5mXpY2DxpG2WK4I0qwHezP5wrVhkvid+jSH/XyBHOfhE7oY7If0NOvki8cKnAG+cirPDfKBPSLt6QpXY+Gc5NgY2WVmvyu/Q2JwxWVRuNg0wAAAABJRU5ErkJggg==" options:NSDataBase64DecodingIgnoreUnknownCharacters]; It seems like there's a bunch of leaks here. But also, I don't love the inline image data.
Aditya Keerthi
Comment 3 2018-07-17 16:34:49 PDT
(In reply to Tim Horton from comment #2) > Comment on attachment 345203 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=345203&action=review > > > Source/WebCore/html/TextFieldInputType.cpp:883 > > + return (m_suggestionPicker != nullptr); > > no need for all these characters, we don't usually do explicit comparisons > with 0 (`return m_suggestionPicker` should be fine) I'll change it to `return !!m_suggestionPicker`. Otherwise the compiler complains. > > Source/WebCore/rendering/RenderThemeMac.mm:262 > > + NSData *data = [[NSData alloc] initWithBase64EncodedString:@"iVBORw0KGgoAAAANSUhEUgAAAA4AAAAJCAYAAAACTR1pAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAAAr0lEQVQoFYWOMQrCUBBEfwhomSqtkNoL6An0WLmHZzB4Au0VrBUsbW0sbFJ838Rd+H4iLkxmdnbmkxBj3IEnWIc/Q2Zl2S4geqB5geWvLreFZaDYq9hK2TzgeV6WB3TzaVUswMYd+A5mXpY2DxpG2WK4I0qwHezP5wrVhkvid+jSH/XyBHOfhE7oY7If0NOvki8cKnAG+cirPDfKBPSLt6QpXY+Gc5NgY2WVmvyu/Q2JwxWVRuNg0wAAAABJRU5ErkJggg==" options:NSDataBase64DecodingIgnoreUnknownCharacters]; > > It seems like there's a bunch of leaks here. > > But also, I don't love the inline image data. Is there an asset catalog I can move the data into?
Tim Horton
Comment 4 2018-07-17 16:47:03 PDT
Comment on attachment 345203 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345203&action=review >>> Source/WebCore/html/TextFieldInputType.cpp:883 >>> + return (m_suggestionPicker != nullptr); >> >> no need for all these characters, we don't usually do explicit comparisons with 0 (`return m_suggestionPicker` should be fine) > > I'll change it to `return !!m_suggestionPicker`. Otherwise the compiler complains. Sure! >>> Source/WebCore/rendering/RenderThemeMac.mm:262 >>> + NSData *data = [[NSData alloc] initWithBase64EncodedString:@"iVBORw0KGgoAAAANSUhEUgAAAA4AAAAJCAYAAAACTR1pAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAAAr0lEQVQoFYWOMQrCUBBEfwhomSqtkNoL6An0WLmHZzB4Au0VrBUsbW0sbFJ838Rd+H4iLkxmdnbmkxBj3IEnWIc/Q2Zl2S4geqB5geWvLreFZaDYq9hK2TzgeV6WB3TzaVUswMYd+A5mXpY2DxpG2WK4I0qwHezP5wrVhkvid+jSH/XyBHOfhE7oY7If0NOvki8cKnAG+cirPDfKBPSLt6QpXY+Gc5NgY2WVmvyu/Q2JwxWVRuNg0wAAAABJRU5ErkJggg==" options:NSDataBase64DecodingIgnoreUnknownCharacters]; >> >> It seems like there's a bunch of leaks here. >> >> But also, I don't love the inline image data. > > Is there an asset catalog I can move the data into? We have lots of loose resources in the framework.
Aditya Keerthi
Comment 5 2018-07-18 09:22:04 PDT
EWS Watchlist
Comment 6 2018-07-18 14:56:56 PDT
Comment on attachment 345253 [details] Patch Attachment 345253 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/8578373 New failing tests: http/tests/security/canvas-remote-read-remote-video-blocked-no-crossorigin.html
EWS Watchlist
Comment 7 2018-07-18 14:57:09 PDT
Created attachment 345289 [details] Archive of layout-test-results from ews200 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews200 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Tim Horton
Comment 8 2018-07-23 15:04:58 PDT
Comment on attachment 345253 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345253&action=review > Source/WebCore/rendering/RenderThemeMac.mm:206 > +- (void)drawWithFrame:(NSRect)cellFrame inView:(__unused NSView *)controlView A bit sad that this can’t just use a system cell. > Source/WebCore/rendering/RenderThemeMac.mm:226 > + if ([self userInterfaceLayoutDirection] == NSUserInterfaceLayoutDirectionRightToLeft) { Does something really propagate UILayoutDirection into here!? > Source/WebCore/rendering/RenderThemeMac.mm:230 > + [transform translateXBy:-1*NSMidX(cellFrame) yBy:-1*NSMidY(cellFrame)]; Spaces around operators > Source/WebCore/rendering/RenderThemeMac.mm:237 > + if (accentColor == NSUserAccentColorRed) I continue to not love this. > Source/WebCore/rendering/RenderThemeMac.mm:261 > + RefPtr<WebCore::Image> image = WebCore::Image::loadPlatformResource("ListButtonArrow"); Much better! > Source/WebCore/rendering/RenderThemeMac.mm:1085 > + NSRect listButtonFrame = NSMakeRect(r.maxX() - 16, r.y(), 16, r.height()); What’s this random 16? Would be nice to have a named constant.
Aditya Keerthi
Comment 9 2018-07-24 10:50:35 PDT
Aditya Keerthi
Comment 10 2018-07-24 10:52:57 PDT
(In reply to Tim Horton from comment #8) > Comment on attachment 345253 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=345253&action=review > > > Source/WebCore/rendering/RenderThemeMac.mm:226 > > + if ([self userInterfaceLayoutDirection] == NSUserInterfaceLayoutDirectionRightToLeft) { > > Does something really propagate UILayoutDirection into here!? The UserInterfaceLayoutDirection is set in RenderThemeMac::paintListButtonForInput. > > Source/WebCore/rendering/RenderThemeMac.mm:1085 > > + NSRect listButtonFrame = NSMakeRect(r.maxX() - 16, r.y(), 16, r.height()); > > What’s this random 16? Would be nice to have a named constant. It's the width of the button. I put it in a constant.
Tim Horton
Comment 11 2018-07-25 18:04:28 PDT
Comment on attachment 345689 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345689&action=review > Source/WebCore/rendering/RenderThemeMac.mm:264 > + RefPtr<WebCore::Image> image = WebCore::Image::loadPlatformResource("ListButtonArrow"); You need a 2x version of this asset, and need to figure out how to load that correctly. > Source/WebCore/rendering/RenderThemeMac.mm:1105 > + // Margin to place button at end of input Comments should be complete sentences and have punctuation. > Source/WebCore/rendering/RenderThemeMac.mm:2363 > +NSCell* RenderThemeMac::listButton() const Star's on the wrong side.
Aditya Keerthi
Comment 12 2018-07-25 21:39:23 PDT
WebKit Commit Bot
Comment 13 2018-07-26 13:35:17 PDT
Comment on attachment 345818 [details] Patch Rejecting attachment 345818 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'validate-changelog', '--check-oops', '--non-interactive', 345818, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit /Volumes/Data/EWS/WebKit/Source/WebInspectorUI/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive). Full output: https://webkit-queues.webkit.org/results/8665129
Aditya Keerthi
Comment 14 2018-07-26 15:12:52 PDT
Aditya Keerthi
Comment 15 2018-07-26 15:13:26 PDT
Fixed ChangeLog.
Aditya Keerthi
Comment 16 2018-07-26 15:28:49 PDT
WebKit Commit Bot
Comment 17 2018-07-26 16:12:30 PDT
Comment on attachment 345883 [details] Patch Clearing flags on attachment: 345883 Committed r234281: <https://trac.webkit.org/changeset/234281>
WebKit Commit Bot
Comment 18 2018-07-26 16:12:32 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 19 2018-07-26 16:14:11 PDT
Ryan Haddad
Comment 20 2018-07-26 18:38:13 PDT
Reverted r234281 for reason: Broke internal builds. Committed r234289: <https://trac.webkit.org/changeset/234289>
Aditya Keerthi
Comment 21 2018-07-26 20:44:45 PDT
Aditya Keerthi
Comment 22 2018-08-13 14:40:19 PDT
Tim Horton
Comment 23 2018-08-13 14:46:49 PDT
Comment on attachment 347041 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=347041&action=review > Source/WebCore/html/shadow/DataListButtonElement.cpp:49 > + : HTMLDivElement(divTag, document), m_owner(owner) I think we usually always wrap these. > Source/WebCore/rendering/RenderThemeMac.mm:2081 > + } else { > + if (box.style().direction() == TextDirection::RTL) Why not fold these into the outer if?
Aditya Keerthi
Comment 24 2018-08-13 15:07:47 PDT
EWS Watchlist
Comment 25 2018-08-13 16:47:16 PDT
Comment on attachment 347041 [details] Patch Attachment 347041 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/8849118 New failing tests: fast/forms/datalist/datalist-textinput-appearance.html fast/forms/datalist/datalist-searchinput-appearance.html
EWS Watchlist
Comment 26 2018-08-13 16:47:18 PDT
Created attachment 347054 [details] Archive of layout-test-results from ews126 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews126 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.4
Aditya Keerthi
Comment 27 2018-08-13 16:58:39 PDT
(In reply to Build Bot from comment #25) > Comment on attachment 347041 [details] > Patch > > Attachment 347041 [details] did not pass ios-sim-ews (ios-simulator-wk2): > Output: https://webkit-queues.webkit.org/results/8849118 > > New failing tests: > fast/forms/datalist/datalist-textinput-appearance.html > fast/forms/datalist/datalist-searchinput-appearance.html I'm going to have to [ Skip ] these in platform/ios/TestExpectations until ENABLE(DATALIST_ELEMENT) is true.
Aditya Keerthi
Comment 28 2018-08-15 09:52:16 PDT
Created attachment 347171 [details] Patch for landing
WebKit Commit Bot
Comment 29 2018-08-15 13:42:34 PDT
Comment on attachment 347171 [details] Patch for landing Clearing flags on attachment: 347171 Committed r234898: <https://trac.webkit.org/changeset/234898>
Ryosuke Niwa
Comment 30 2022-08-17 22:14:05 PDT
*** Bug 72006 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.