Consolidate NSColor to WebCore::Color conversion and fix system colors.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2018 02:39:35 +0000 (02:39 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2018 02:39:35 +0000 (02:39 +0000)
commit357f04231256fc447363f81084c7d1137f049e54
tree16b4a41e4afbfad0833cdc07438a82fa2b6febb4
parent6a602ba44fa18a35393fde01ca7190ced42992fb
Consolidate NSColor to WebCore::Color conversion and fix system colors.

https://bugs.webkit.org/show_bug.cgi?id=184096
rdar://problem/38918925

Reviewed by Tim Horton.

Source/WebCore:

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(CreateCGColorIfDifferent): Use CGColor property on NSColor, don't manually create new CGColor.
* platform/graphics/mac/ColorMac.h:
* platform/graphics/mac/ColorMac.mm:
(WebCore::makeRGBAFromNSColor): Move pattern code from RenderThemeMac's convertNSColorToColor.
Also use nextafter for proper RGBA float conversion.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::color): Use colorFromNSColor.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): Use colorFromNSColor.
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::systemColor const): Ditto.
(WebCore::paintAttachmentTitleBackground): Ditto.
(WebCore::convertNSColorToColor): Deleted.

LayoutTests:

* fast/css/apple-system-control-colors-expected.txt: Updated with rgba() colors.
* platform/mac/accessibility/content-editable-as-textarea-expected.txt: Updated with color space.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/apple-system-control-colors-expected.txt
LayoutTests/platform/mac/accessibility/content-editable-as-textarea-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/platform/graphics/mac/ColorMac.h
Source/WebCore/platform/graphics/mac/ColorMac.mm
Source/WebCore/platform/mac/PlatformPasteboardMac.mm
Source/WebCore/rendering/RenderThemeMac.mm