Move InstanceInvalidationGuard/UpdateBlocker to SVGElement from SVGElementInstance
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Feb 2015 18:07:10 +0000 (18:07 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Feb 2015 18:07:10 +0000 (18:07 +0000)
commita725941dc43c7836f81f73b6a53e10ad4d9792ce
tree1e6d0469c2d320c1ef4ad5b2ac4fa73a6ee4c89e
parentde8f23c0f01a052401a81903c013f0831afeca80
Move InstanceInvalidationGuard/UpdateBlocker to SVGElement from SVGElementInstance
https://bugs.webkit.org/show_bug.cgi?id=141148

Patch by Darin Adler <darin@apple.com> on 2015-02-05
Reviewed by Brent Fulgham and Anders Carlsson.

Inspired by this change Rob Buis made in Blink:

    http://src.chromium.org/viewvc/blink?view=revision&revision=173343

I actually wrote the whole thing and then discovered we did it almost identically.

* svg/SVGAnimatedTypeAnimator.cpp:
(WebCore::SVGElementAnimatedPropertyList::setInstanceUpdatesBlocked): Added this
helper function to get around a circular header dependency.
* svg/SVGAnimatedTypeAnimator.h:
(WebCore::SVGAnimatedTypeAnimator::executeAction): Use setInstanceUpdatesBlocked.

* svg/SVGElement.cpp:
(WebCore::SVGElement::removedFrom): Use invalidateInstances.
(WebCore::SVGElement::finishParsingChildren): Ditto.
(WebCore::SVGElement::svgAttributeChanged): Ditto.
(WebCore::SVGElement::childrenChanged): Ditto.
(WebCore::SVGElement::setInstanceUpdatesBlocked): Added an assertion that will
catch anyone who nests InstanceUpdateBlocker by accident.
(WebCore::SVGElement::invalidateInstances): Moved this here from
SVGElementInstance::invalidateAllInstancesOfElement. I had already modified this
so it had nothing to do with SVGElementInstance, so it was a simple matter of
converting this into a member function. Added a FIXME about the mysterious
updateStyleIfNeeded that makes multiple tests fail if it's removed.

* svg/SVGElement.h: Added public InstanceUpdateBlocker class, protected
InstanceInvalidationGuard class, and private invalidateInstances function.
Unlike the ones in SVGElementInstance these use references so they are then
not copyable without using the WTF_MAKE_NONCOPYABLE macro.

* svg/SVGElementInstance.cpp:
(WebCore::SVGElementInstance::invalidateAllInstancesOfElement): Deleted.
(WebCore::SVGElementInstance::InstanceUpdateBlocker::InstanceUpdateBlocker): Deleted.
(WebCore::SVGElementInstance::InstanceUpdateBlocker::~InstanceUpdateBlocker): Deleted.
* svg/SVGElementInstance.h: Removed InvalidationGuard, InstanceUpdateBlocker, and
invalidateAllInstancesOfElement. Didn't do any further cleanup since we soon will
delete this entire file.

* svg/SVGAElement.cpp:
(WebCore::SVGAElement::svgAttributeChanged): Updated to use new name and reference
instead of pointer.
* svg/SVGAnimateElementBase.cpp:
(WebCore::applyCSSPropertyToTargetAndInstances): Ditto.
(WebCore::removeCSSPropertyFromTargetAndInstances): Ditto.
(WebCore::notifyTargetAndInstancesAboutAnimValChange): Ditto.
* svg/SVGAnimatedPath.cpp:
(WebCore::SVGAnimatedPathAnimator::startAnimValAnimation): Ditto.
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::svgAttributeChanged): Ditto.
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::svgAttributeChanged): Ditto.
* svg/SVGComponentTransferFunctionElement.cpp:
(WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged): Ditto.
* svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::svgAttributeChanged): Ditto.
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::svgAttributeChanged): Ditto.
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::svgAttributeChanged): Ditto.
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::svgAttributeChanged): Ditto.
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::svgAttributeChanged): Ditto.
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged): Ditto.
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged): Ditto.
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): Ditto.
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::svgAttributeChanged): Ditto.
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): Ditto.
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::svgAttributeChanged): Ditto.
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::svgAttributeChanged): Ditto.
* svg/SVGFEMergeNodeElement.cpp:
(WebCore::SVGFEMergeNodeElement::svgAttributeChanged): Ditto.
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::svgAttributeChanged): Ditto.
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::svgAttributeChanged): Ditto.
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::svgAttributeChanged): Ditto.
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::svgAttributeChanged): Ditto.
* svg/SVGFETurbulenceElement.cpp:
(WebCore::SVGFETurbulenceElement::svgAttributeChanged): Ditto.
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::svgAttributeChanged): Ditto.
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged): Ditto.
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::svgAttributeChanged): Ditto.
* svg/SVGGElement.cpp:
(WebCore::SVGGElement::svgAttributeChanged): Ditto.
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::svgAttributeChanged): Ditto.
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::svgAttributeChanged): Ditto.
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::svgAttributeChanged): Ditto.
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::svgAttributeChanged): Ditto.
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::svgAttributeChanged): Ditto.
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::svgAttributeChanged): Ditto.
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::svgAttributeChanged): Ditto.
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::svgAttributeChanged): Ditto.
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::svgAttributeChanged): Ditto.
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::svgAttributeChanged): Ditto.
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::svgAttributeChanged): Ditto.
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::svgAttributeChanged): Ditto.
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::svgAttributeChanged): Ditto.
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::svgAttributeChanged): Ditto.
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::svgAttributeChanged): Ditto.
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::svgAttributeChanged): Ditto.
* svg/SVGSymbolElement.cpp:
(WebCore::SVGSymbolElement::svgAttributeChanged): Ditto.
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::svgAttributeChanged): Ditto.
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::svgAttributeChanged): Ditto.
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::svgAttributeChanged): Ditto.
* svg/SVGTextPositioningElement.cpp:
(WebCore::SVGTextPositioningElement::svgAttributeChanged): Ditto.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::svgAttributeChanged): Ditto.
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::svgAttributeChanged): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
58 files changed:
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGAElement.cpp
Source/WebCore/svg/SVGAnimateElementBase.cpp
Source/WebCore/svg/SVGAnimatedPath.cpp
Source/WebCore/svg/SVGAnimatedTypeAnimator.cpp
Source/WebCore/svg/SVGAnimatedTypeAnimator.h
Source/WebCore/svg/SVGCircleElement.cpp
Source/WebCore/svg/SVGClipPathElement.cpp
Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp
Source/WebCore/svg/SVGCursorElement.cpp
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGElement.h
Source/WebCore/svg/SVGElementInstance.cpp
Source/WebCore/svg/SVGElementInstance.h
Source/WebCore/svg/SVGEllipseElement.cpp
Source/WebCore/svg/SVGFEBlendElement.cpp
Source/WebCore/svg/SVGFEColorMatrixElement.cpp
Source/WebCore/svg/SVGFECompositeElement.cpp
Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp
Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
Source/WebCore/svg/SVGFEDisplacementMapElement.cpp
Source/WebCore/svg/SVGFEDropShadowElement.cpp
Source/WebCore/svg/SVGFEGaussianBlurElement.cpp
Source/WebCore/svg/SVGFEImageElement.cpp
Source/WebCore/svg/SVGFELightElement.cpp
Source/WebCore/svg/SVGFEMergeNodeElement.cpp
Source/WebCore/svg/SVGFEMorphologyElement.cpp
Source/WebCore/svg/SVGFEOffsetElement.cpp
Source/WebCore/svg/SVGFESpecularLightingElement.cpp
Source/WebCore/svg/SVGFETileElement.cpp
Source/WebCore/svg/SVGFETurbulenceElement.cpp
Source/WebCore/svg/SVGFilterElement.cpp
Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
Source/WebCore/svg/SVGForeignObjectElement.cpp
Source/WebCore/svg/SVGGElement.cpp
Source/WebCore/svg/SVGGradientElement.cpp
Source/WebCore/svg/SVGGraphicsElement.cpp
Source/WebCore/svg/SVGImageElement.cpp
Source/WebCore/svg/SVGLineElement.cpp
Source/WebCore/svg/SVGLinearGradientElement.cpp
Source/WebCore/svg/SVGMPathElement.cpp
Source/WebCore/svg/SVGMarkerElement.cpp
Source/WebCore/svg/SVGMaskElement.cpp
Source/WebCore/svg/SVGPathElement.cpp
Source/WebCore/svg/SVGPatternElement.cpp
Source/WebCore/svg/SVGPolyElement.cpp
Source/WebCore/svg/SVGRadialGradientElement.cpp
Source/WebCore/svg/SVGRectElement.cpp
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/svg/SVGScriptElement.cpp
Source/WebCore/svg/SVGStopElement.cpp
Source/WebCore/svg/SVGSymbolElement.cpp
Source/WebCore/svg/SVGTRefElement.cpp
Source/WebCore/svg/SVGTextContentElement.cpp
Source/WebCore/svg/SVGTextPathElement.cpp
Source/WebCore/svg/SVGTextPositioningElement.cpp
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/svg/animation/SVGSMILElement.cpp