Fix color-filter to apply to SVG colors
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Apr 2018 17:30:35 +0000 (17:30 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Apr 2018 17:30:35 +0000 (17:30 +0000)
commitf4d37312d7f48fe55deaed2765447b928880521e
treeaa062d6a4a51d49bff00f0a488daef4544b35294
parent4998fbd9ee94dd0d3ffd994d48f218fa3cd2a4c7
Fix color-filter to apply to SVG colors
https://bugs.webkit.org/show_bug.cgi?id=185113
rdar://problem/39665082

Reviewed by Dean Jackson.
Source/WebCore:

Convert SVG colors through color-filter operations for the places in SVG
that use color, namely fill and stroke, gradients, lighting colors and
drop-shadow.

Test: css3/color-filters/svg/color-filter-inline-svg.html

* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::applyResource):
* rendering/svg/RenderSVGResourceGradient.h:
* rendering/svg/RenderSVGResourceLinearGradient.cpp:
(WebCore::RenderSVGResourceLinearGradient::buildGradient const):
* rendering/svg/RenderSVGResourceLinearGradient.h:
* rendering/svg/RenderSVGResourceRadialGradient.cpp:
(WebCore::RenderSVGResourceRadialGradient::buildGradient const):
* rendering/svg/RenderSVGResourceRadialGradient.h:
* rendering/svg/RenderSVGResourceSolidColor.cpp:
(WebCore::RenderSVGResourceSolidColor::applyResource):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute):
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::build):
* svg/SVGFEFloodElement.cpp:
(WebCore::SVGFEFloodElement::build):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute):
(WebCore::SVGFESpecularLightingElement::build):

LayoutTests:

* css3/color-filters/svg/color-filter-inline-svg-expected.html: Added.
* css3/color-filters/svg/color-filter-inline-svg.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/color-filters/svg/color-filter-inline-svg-expected.html [new file with mode: 0644]
LayoutTests/css3/color-filters/svg/color-filter-inline-svg.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp
Source/WebCore/rendering/svg/RenderSVGResourceGradient.h
Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.cpp
Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.h
Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.cpp
Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.h
Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp
Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
Source/WebCore/svg/SVGFEDropShadowElement.cpp
Source/WebCore/svg/SVGFEFloodElement.cpp
Source/WebCore/svg/SVGFESpecularLightingElement.cpp