Bug 192518

Summary: WKWebView should support custom tintColor
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, megan_gardner, simon.fraser, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Tim Horton 2018-12-07 15:01:11 PST
WKWebView should support custom tintColor
Comment 1 Tim Horton 2018-12-07 15:03:11 PST
Created attachment 356842 [details]
Patch
Comment 2 Tim Horton 2018-12-07 15:03:21 PST
<rdar://problem/37243261>
Comment 3 Tim Horton 2018-12-07 15:05:29 PST
Created attachment 356843 [details]
Patch
Comment 4 Simon Fraser (smfr) 2018-12-07 17:41:02 PST
Comment on attachment 356843 [details]
Patch

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

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2511
> +        if (!_page->editorState().isMissingPostLayoutData) {

I hate isMissingPostLayoutData. Why is it a thing?

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2513
> +            if (caretColor.isValid())

Is it OK if caretColor is transparent black?
Comment 5 Megan Gardner 2018-12-07 17:57:45 PST
Comment on attachment 356843 [details]
Patch

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

> Tools/TestWebKitAPI/ios/UIKitSPI.h:71
> +@property (nonatomic, readonly) UIColor *selectionBarColor;

Why don't we test selectionHighlightColor as well? Is that not testable?
Comment 6 Tim Horton 2018-12-08 00:49:59 PST
(In reply to Simon Fraser (smfr) from comment #4)
> Comment on attachment 356843 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=356843&action=review
> 
> > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2511
> > +        if (!_page->editorState().isMissingPostLayoutData) {
> 
> I hate isMissingPostLayoutData. Why is it a thing?

I don’t know. I blame whsieh.

> > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2513
> > +            if (caretColor.isValid())
> 
> Is it OK if caretColor is transparent black?

Yes.

(In reply to Megan Gardner from comment #5)
> Comment on attachment 356843 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=356843&action=review
> 
> > Tools/TestWebKitAPI/ios/UIKitSPI.h:71
> > +@property (nonatomic, readonly) UIColor *selectionBarColor;
> 
> Why don't we test selectionHighlightColor as well? Is that not testable?

It is, but it’s actually transformed a bit by UIKit so it’s not a trivial equality test. I decided I didn’t want my test to depend on UIKit internal implementation details.
Comment 7 Wenson Hsieh 2018-12-08 00:52:57 PST
Comment on attachment 356843 [details]
Patch

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

>>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2511
>>> +        if (!_page->editorState().isMissingPostLayoutData) {
>> 
>> I hate isMissingPostLayoutData. Why is it a thing?
> 
> I don’t know. I blame whsieh.

See: <https://trac.webkit.org/changeset/182603/webkit>
Comment 8 WebKit Commit Bot 2018-12-10 01:05:08 PST
Comment on attachment 356843 [details]
Patch

Clearing flags on attachment: 356843

Committed r239026: <https://trac.webkit.org/changeset/239026>
Comment 9 WebKit Commit Bot 2018-12-10 01:05:10 PST
All reviewed patches have been landed.  Closing bug.