diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-07 11:22:47 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-07 11:22:47 +0100 |
commit | cfd86b747d32ac22246a1aa908eaa720c63a88c1 (patch) | |
tree | 24d68c6f61c464ecba1e05670b80390ea3b0e50c /Source/WebCore/svg/SVGPathElement.cpp | |
parent | 69d7c744c9de19d152dbe2d8e46eb7dfd4511d1a (diff) | |
download | qtwebkit-cfd86b747d32ac22246a1aa908eaa720c63a88c1.tar.gz |
Imported WebKit commit 20271caf2e2c016d5cef40184cddeefeac4f1876 (http://svn.webkit.org/repository/webkit/trunk@133733)
New snapshot that contains all previous fixes as well as build fix for latest QtMultimedia API changes.
Diffstat (limited to 'Source/WebCore/svg/SVGPathElement.cpp')
-rw-r--r-- | Source/WebCore/svg/SVGPathElement.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/WebCore/svg/SVGPathElement.cpp b/Source/WebCore/svg/SVGPathElement.cpp index 04e25ea68..c56692b29 100644 --- a/Source/WebCore/svg/SVGPathElement.cpp +++ b/Source/WebCore/svg/SVGPathElement.cpp @@ -27,6 +27,7 @@ #include "RenderSVGPath.h" #include "RenderSVGResource.h" #include "SVGElementInstance.h" +#include "SVGMPathElement.h" #include "SVGNames.h" #include "SVGPathSegArc.h" #include "SVGPathSegClosePath.h" @@ -270,12 +271,41 @@ void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) if (renderer) renderer->setNeedsShapeUpdate(); + + invalidateMPathDependencies(); } if (renderer) RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); } +void SVGPathElement::invalidateMPathDependencies() +{ + // <mpath> can only reference <path> but this dependency is not handled in + // markForLayoutAndParentResourceInvalidation so we update any mpath dependencies manually. + ASSERT(document()); + if (HashSet<SVGElement*>* dependencies = document()->accessSVGExtensions()->setOfElementsReferencingTarget(this)) { + HashSet<SVGElement*>::iterator end = dependencies->end(); + for (HashSet<SVGElement*>::iterator it = dependencies->begin(); it != end; ++it) { + if ((*it)->hasTagName(SVGNames::mpathTag)) + static_cast<SVGMPathElement*>(*it)->targetPathChanged(); + } + } +} + +Node::InsertionNotificationRequest SVGPathElement::insertedInto(ContainerNode* rootParent) +{ + SVGStyledTransformableElement::insertedInto(rootParent); + invalidateMPathDependencies(); + return InsertionDone; +} + +void SVGPathElement::removedFrom(ContainerNode* rootParent) +{ + SVGStyledTransformableElement::removedFrom(rootParent); + invalidateMPathDependencies(); +} + SVGPathByteStream* SVGPathElement::pathByteStream() const { SVGAnimatedProperty* property = SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff>(this, dPropertyInfo()); |