Semantic colors should not be transformed by color-filter
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jun 2018 20:52:49 +0000 (20:52 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jun 2018 20:52:49 +0000 (20:52 +0000)
commit892af40834f30ac6b2c8d9083c1aee1cf62b035b
tree34be55f7d8269b106e783ecec7abc46c36f217fd
parent5f15bd9eec3f2b712e54e34337fa53da71aabd23
Semantic colors should not be transformed by color-filter
https://bugs.webkit.org/show_bug.cgi?id=186566
<rdar://problem/40705739>

Reviewed by Simon Fraser.

Source/WebCore:

Test: css3/color-filters/color-filter-ignore-semantic.html

* platform/graphics/Color.h:
(WebCore::Color::Color):
(WebCore::Color::isSemantic const):
(WebCore::Color::setIsSemantic):

Add a bit to Color to indicate it originated from a semantic color name.
Note that a color compares unequal to the semantic version of the same color.

* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::transformColor const):
* platform/graphics/mac/ColorMac.h:
* platform/graphics/mac/ColorMac.mm:
(WebCore::semanticColorFromNSColor):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const):

Set the bit for semantic system colors.

* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):

Fix up the output to avoid unneccary render tree dump changes.

LayoutTests:

* css3/color-filters/color-filter-ignore-semantic-expected.html: Added.
* css3/color-filters/color-filter-ignore-semantic.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/color-filters/color-filter-ignore-semantic-expected.html [new file with mode: 0644]
LayoutTests/css3/color-filters/color-filter-ignore-semantic.html [new file with mode: 0644]
LayoutTests/platform/ios/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Color.h
Source/WebCore/platform/graphics/filters/FilterOperations.cpp
Source/WebCore/platform/graphics/mac/ColorMac.h
Source/WebCore/platform/graphics/mac/ColorMac.mm
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderTreeAsText.cpp