SVG pattern data deleted while in use
authorFlorin Malita <fmalita@chromium.org>
Wed, 6 Feb 2013 16:58:42 +0000 (17:58 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 7 Feb 2013 18:21:20 +0000 (19:21 +0100)
commitf47c0b0c6d7a96558273254f014d7515c04b42fb
treef8557ec77399ac031033c832ad4cd947b1a544b6
parent659c84da41ad75ebd446ec6549f66e60263e1430
SVG pattern data deleted while in use

https://bugs.webkit.org/show_bug.cgi?id=103415

Reviewed by Dirk Schulze.

Various calls in RenderSVGResourcePattern::applyResource() can trigger invalidations,
which may end up deleting our current pattern data (via removeAllClientsFromCache).
To avoid this, we should add the pattern data to the cache only after it is fully built.
For clarity, the patch also refactors the pattern setup code into a separate method.

Test: svg/custom/large-image-pattern-crash.html

* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::buildPattern):
(WebCore::RenderSVGResourcePattern::applyResource):
* rendering/svg/RenderSVGResourcePattern.h:
(RenderSVGResourcePattern):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136250 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Change-Id: I1ad128e056f7825727e2d1a9f365dd5f1aa2e4fa
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Source/WebCore/ChangeLog
Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
Source/WebCore/rendering/svg/RenderSVGResourcePattern.h