CTTE: SVGResourcesCache should only allow RenderElements.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Sep 2014 19:25:57 +0000 (19:25 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Sep 2014 19:25:57 +0000 (19:25 +0000)
commit1d5a2f5d5e7c6a9e77ee77cae05bfcbabb792476
treec874d67456d04ce15da7b56c3f98e5c6ae389fd6
parent35b9a1ebc3171f032cacc5438da30910b3ad9f26
CTTE: SVGResourcesCache should only allow RenderElements.
<https://webkit.org/b/136578>

Only RenderElement subclasses can use SVG resources.
Codify this by making SVGResourcesCache::m_cache keyed on RenderElement.

Reviewed by Antti Koivisto.

* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::selfWillPaint):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::imageChanged):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
(WebCore::removeFromCacheAndInvalidateDependencies):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::paintReplaced):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::shouldGenerateMarkerPositions):
(WebCore::RenderSVGShape::markerRect):
(WebCore::RenderSVGShape::drawMarkers):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::invalidateResourcesOfChildren):
(WebCore::SVGRenderSupport::intersectRepaintRectWithResources):
(WebCore::SVGRenderSupport::filtersForceContainerLayout):
(WebCore::SVGRenderSupport::pointInClippingArea):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::resourcesCacheFromRenderer):
(WebCore::SVGResourcesCache::cachedResourcesForRenderer):
(WebCore::SVGResourcesCache::clientLayoutChanged):
(WebCore::SVGResourcesCache::clientDestroyed):
(WebCore::SVGResourcesCache::resourceDestroyed):
(WebCore::SVGResourcesCache::cachedResourcesForRenderObject): Deleted.
* rendering/svg/SVGResourcesCache.h:
* rendering/svg/SVGResourcesCycleSolver.cpp:
(WebCore::SVGResourcesCycleSolver::resourceContainsCycles):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/rendering/svg/RenderSVGContainer.cpp
Source/WebCore/rendering/svg/RenderSVGImage.cpp
Source/WebCore/rendering/svg/RenderSVGResource.cpp
Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/RenderSVGShape.cpp
Source/WebCore/rendering/svg/SVGRenderSupport.cpp
Source/WebCore/rendering/svg/SVGRenderingContext.cpp
Source/WebCore/rendering/svg/SVGResourcesCache.cpp
Source/WebCore/rendering/svg/SVGResourcesCache.h
Source/WebCore/rendering/svg/SVGResourcesCycleSolver.cpp