From: timothy_horton@apple.com Date: Tue, 27 Sep 2011 00:36:19 +0000 (+0000) Subject: applied to filtered ellipse does not update X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=5bd1c1482c73f3bd1b83d72c921a75ecfffcf15b applied to filtered ellipse does not update https://bugs.webkit.org/show_bug.cgi?id=68457 Reviewed by Darin Adler. Invalidate the filter's cache when style changes take place so that style changes are respected. Test: svg/filters/animate-fill.svg git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96052 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 6dd99b8..ca84b93 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,17 @@ +2011-09-26 Tim Horton + + applied to filtered ellipse does not update + https://bugs.webkit.org/show_bug.cgi?id=68457 + + + Reviewed by Darin Adler. + + Test that changing the fill on a filtered shape properly invalidates the filtered result. + + * svg/filters/animate-fill-expected.png: Added. + * svg/filters/animate-fill-expected.txt: Added. + * svg/filters/animate-fill.svg: Added. + 2011-09-26 Mihai Parparita Remove failing expectations for some ruby tests, since they were diff --git a/LayoutTests/svg/filters/animate-fill-expected.png b/LayoutTests/svg/filters/animate-fill-expected.png new file mode 100644 index 0000000..a0d7ee4 Binary files /dev/null and b/LayoutTests/svg/filters/animate-fill-expected.png differ diff --git a/LayoutTests/svg/filters/animate-fill-expected.txt b/LayoutTests/svg/filters/animate-fill-expected.txt new file mode 100644 index 0000000..29fea9e --- /dev/null +++ b/LayoutTests/svg/filters/animate-fill-expected.txt @@ -0,0 +1,10 @@ +layer at (0,0) size 800x600 + RenderView at (0,0) size 800x600 +layer at (0,0) size 800x600 + RenderSVGRoot {svg} at (0,0) size 111x111 + RenderSVGHiddenContainer {defs} at (0,0) size 0x0 + RenderSVGResourceFilter {filter} [id="filt"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse] + [feOffset dx="0.00" dy="0.00"] + [SourceGraphic] + RenderSVGPath {rect} at (0,0) size 111x111 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] + [filter="filt"] RenderSVGResourceFilter {filter} at (-10,-10) size 120x120 diff --git a/LayoutTests/svg/filters/animate-fill.svg b/LayoutTests/svg/filters/animate-fill.svg new file mode 100644 index 0000000..daf8e32 --- /dev/null +++ b/LayoutTests/svg/filters/animate-fill.svg @@ -0,0 +1,25 @@ + + The rectangle should rapidly animate to green. + + + + + + + + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 0ddde8d..51bb3b0 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,19 @@ +2011-09-26 Tim Horton + + applied to filtered ellipse does not update + https://bugs.webkit.org/show_bug.cgi?id=68457 + + + Reviewed by Darin Adler. + + Invalidate the filter's cache when style changes take place so that style changes are respected. + + Test: svg/filters/animate-fill.svg + + * rendering/svg/SVGResourcesCache.cpp: + (WebCore::SVGResourcesCache::clientStyleChanged): + (WebCore::SVGResourcesCache::clientUpdatedFromElement): + 2011-09-26 Max Perepelitsyn Set but unused variables cleanup in v8 bindings (gcc 4.6) diff --git a/Source/WebCore/rendering/svg/SVGResourcesCache.cpp b/Source/WebCore/rendering/svg/SVGResourcesCache.cpp index 30f86c3..bbd4454 100644 --- a/Source/WebCore/rendering/svg/SVGResourcesCache.cpp +++ b/Source/WebCore/rendering/svg/SVGResourcesCache.cpp @@ -128,7 +128,7 @@ void SVGResourcesCache::clientStyleChanged(RenderObject* renderer, StyleDifferen if (diff == StyleDifferenceEqual) return; - // In this case the proper SVGFE*Element will imply whether the modifided CSS properties implies a relayout or repaint. + // In this case the proper SVGFE*Element will decide whether the modified CSS properties require a relayout or repaint. if (renderer->isSVGResourceFilterPrimitive() && diff == StyleDifferenceRepaint) return; @@ -144,6 +144,12 @@ void SVGResourcesCache::clientUpdatedFromElement(RenderObject* renderer, const R SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer); cache->removeResourcesFromRenderObject(renderer); cache->addResourcesFromRenderObject(renderer, newStyle); + + SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(renderer); + if (!resources) + return; + + resources->removeClientFromCache(renderer); } void SVGResourcesCache::clientDestroyed(RenderObject* renderer)