Fix lifetime handling of SVGPropertyTearOffs
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Mar 2014 16:26:15 +0000 (16:26 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Mar 2014 16:26:15 +0000 (16:26 +0000)
commitd6ab198da21d62c24c23d420f4f5f6423d57f9b2
tree4ae745c5315e6240a54a06753fccfbae60e45e0e
parent1dc554782819dd3f2bb924bbe803bfc3b40e189b
Fix lifetime handling of SVGPropertyTearOffs
<http://webkit.org/b/129211>
<rdar://problem/15696025>

Reviewed by Maciej Stachowiak.

Merged from Blink (patch by Ojan Vafai):
https://src.chromium.org/viewvc/blink?revision=157801&view=revision
http://crbug.com/288771

    -Replace SVGStaticPropertyWithParentTearOff with SVGMatrixTearOff
    since it's only used in that one place. This means we can get rid
    of the templatizing and the method pointer.
    -Change SVGPropertyTearOff to keep track of it's child tearoffs
    and call detachWrapper on its child tearoffs when it's destroyed
    or when it's wrapper is detached.
    -Have SVGPropertyTearOff hold WeakPtrs to the child tearoffs
    to avoid having a cycle.

Source/WebCore:

Test: svg/transforms/svg-matrix-tearoff-crash.html

* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue):
* svg/properties/SVGMatrixTearOff.h: Renamed from Source/WebCore/svg/properties/SVGStaticPropertyWithParentTearOff.h.
(WebCore::SVGMatrixTearOff::create):
(WebCore::SVGMatrixTearOff::commitChange):
(WebCore::SVGMatrixTearOff::SVGMatrixTearOff):
* svg/properties/SVGPropertyTearOff.h:
(WebCore::SVGPropertyTearOff::addChild):
(WebCore::SVGPropertyTearOff::detachChildren):

LayoutTests:

* svg/transforms/svg-matrix-tearoff-crash-expected.txt: Added.
* svg/transforms/svg-matrix-tearoff-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164917 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/svg/transforms/svg-matrix-tearoff-crash-expected.txt [new file with mode: 0644]
LayoutTests/svg/transforms/svg-matrix-tearoff-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/svg/properties/SVGMatrixTearOff.h [moved from Source/WebCore/svg/properties/SVGStaticPropertyWithParentTearOff.h with 52% similarity]
Source/WebCore/svg/properties/SVGPropertyTearOff.h