Bug 171745

Summary: WebKit should default to using sRGB with NSColor conversion instead of device color space
Product: WebKit Reporter: Beth Dakin <bdakin>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, bfulgham, buildbot, dino, rniwa, simon.fraser, thorton, zalan
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
thorton: review+, buildbot: commit-queue-
Archive of layout-test-results from ews100 for mac-elcapitan
none
Patch with new test results
buildbot: commit-queue-
Archive of layout-test-results from ews103 for mac-elcapitan none

Description Beth Dakin 2017-05-05 13:16:04 PDT
WebKit should maintain colorspaces that it understands on NSColors

We need this in order to get the highlight ring on the TouchBar color picker to work. 

rdar://problem/28314183
Comment 1 Beth Dakin 2017-05-05 13:18:35 PDT
Created attachment 309201 [details]
Patch
Comment 2 Tim Horton 2017-05-05 13:36:30 PDT
Comment on attachment 309201 [details]
Patch

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

> Source/WebCore/platform/graphics/mac/ColorMac.mm:64
> +    if (color.colorSpace == [NSColorSpace sRGBColorSpace])

Please use isEqual.
Comment 3 Simon Fraser (smfr) 2017-05-05 13:38:05 PDT
Comment on attachment 309201 [details]
Patch

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

> Source/WebCore/platform/graphics/mac/ColorMac.mm:64
> +    if (color.colorSpace == [NSColorSpace sRGBColorSpace])

This should use isEqual(To?): right?

> Source/WebCore/platform/graphics/mac/ColorMac.mm:67
> +        rgbColor = [color colorUsingColorSpaceName:NSDeviceRGBColorSpace];

Is this equivalent to NSCalibratedRGBColorSpace and which is sRGB?
Comment 4 Beth Dakin 2017-05-05 13:41:43 PDT
(In reply to Simon Fraser (smfr) from comment #3)
> Comment on attachment 309201 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=309201&action=review
> 
> > Source/WebCore/platform/graphics/mac/ColorMac.mm:64
> > +    if (color.colorSpace == [NSColorSpace sRGBColorSpace])
> 
> This should use isEqual(To?): right?
> 

Yup, fixing.

> > Source/WebCore/platform/graphics/mac/ColorMac.mm:67
> > +        rgbColor = [color colorUsingColorSpaceName:NSDeviceRGBColorSpace];
> 
> Is this equivalent to NSCalibratedRGBColorSpace and which is sRGB?

I'm not sure. This is what we have always done in this function before this patch.
Comment 5 Simon Fraser (smfr) 2017-05-05 13:44:18 PDT
Comment on attachment 309201 [details]
Patch

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

>>> Source/WebCore/platform/graphics/mac/ColorMac.mm:67
>>> +        rgbColor = [color colorUsingColorSpaceName:NSDeviceRGBColorSpace];
>> 
>> Is this equivalent to NSCalibratedRGBColorSpace and which is sRGB?
> 
> I'm not sure. This is what we have always done in this function before this patch.

Let's use colorUsingColorSpace:[NSColorSpace sRGBColorSpace]
Comment 6 Beth Dakin 2017-05-05 14:14:11 PDT
Created attachment 309206 [details]
Patch
Comment 7 Build Bot 2017-05-05 15:21:05 PDT
Comment on attachment 309206 [details]
Patch

Attachment 309206 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/3681199

New failing tests:
editing/mac/attributed-string/comment-cdata-section.html
editing/mac/attributed-string/font-style-variant-effect.html
editing/mac/attributed-string/font-weight.html
editing/mac/attributed-string/letter-spacing.html
editing/mac/attributed-string/vertical-align.html
editing/mac/attributed-string/text-decorations.html
editing/mac/attributed-string/font-size.html
editing/mac/attributed-string/anchor-element.html
editing/mac/attributed-string/basic.html
Comment 8 Build Bot 2017-05-05 15:21:06 PDT
Created attachment 309221 [details]
Archive of layout-test-results from ews100 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 9 Tim Horton 2017-05-05 15:27:52 PDT
I think those can be safely rebaselined.
Comment 10 Beth Dakin 2017-05-05 16:17:48 PDT
Created attachment 309236 [details]
Patch with new test results

For the bots to try.
Comment 11 Build Bot 2017-05-05 17:12:24 PDT
Comment on attachment 309236 [details]
Patch with new test results

Attachment 309236 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/3681987

New failing tests:
editing/mac/attributed-string/font-style-variant-effect.html
Comment 12 Build Bot 2017-05-05 17:12:25 PDT
Created attachment 309246 [details]
Archive of layout-test-results from ews103 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 13 Beth Dakin 2017-05-08 13:26:38 PDT
https://trac.webkit.org/changeset/216449/webkit