[Webkit-unassigned] [Bug 186531] [Datalist][macOS] Add suggestions UI for TextFieldInputTypes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 16 10:47:20 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=186531

--- Comment #24 from Aditya Keerthi <akeerthi at apple.com> ---
(In reply to Tim Horton from comment #22)
> Comment on attachment 343000 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=343000&action=review
> 
> > Source/WebKit/UIProcess/WebPageProxy.cpp:7492
> > +void WebPageProxy::closeOverlayedViews()
> 
> INTERESTING. I wonder if we should merge this with the
> dismissContentRelativeChildWindows mechanism that dismisses e.g. find
> highlights and force-touch previews...

Maybe I can look into that in another patch? This patch is fairly large as-is.

> > Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:50
> > +- (void)setText:(NSString *)text;
> > +- (void)setActive:(BOOL)shouldActivate;
> 
> I realize you don’t need getters now, but is there any reason these aren’t
> properties?

I didn't make a text property its value is never stored and setText serves only to update the NSTextField inside the view.

Replaced setActive with a property.

> > Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:148
> > + at implementation WKDataListSuggestionCell
> 
> Is there a reason this isn’t just NSTextFieldCell (or a subclass), instead
> of being our own implementation of that? Seems like that would get rid of a
> lot of code.

I initially had this as an NSTextField subclass. However, NSTextField does not vertically center it's text. For this reason, WKDataListSuggestionCell is a view that contains a vertically centered NSTextField.

> > Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:158
> > +    [_textField setBackgroundColor:[NSColor clearColor]];
> 
> Does this do the right thing in Dark Mode? (I’m not actually sure what the
> right thing is in this case)

This does the right thing as the WKDataListSuggestionCell uses semantic colors for its background. Note that the NSTextField does not take up the entire frame of the WKDataListSuggestionCell due to the vertical centering issue discussed above.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180716/9a160441/attachment-0001.html>


More information about the webkit-unassigned mailing list