diff options
Diffstat (limited to 'WebCore/svg/SVGAnimateMotionElement.cpp')
-rw-r--r-- | WebCore/svg/SVGAnimateMotionElement.cpp | 71 |
1 files changed, 39 insertions, 32 deletions
diff --git a/WebCore/svg/SVGAnimateMotionElement.cpp b/WebCore/svg/SVGAnimateMotionElement.cpp index 9355436..4ddda73 100644 --- a/WebCore/svg/SVGAnimateMotionElement.cpp +++ b/WebCore/svg/SVGAnimateMotionElement.cpp @@ -1,36 +1,36 @@ /* - Copyright (C) 2007 Eric Seidel <eric@webkit.org> - (C) 2007 Rob Buis <buis@kde.org> - Copyright (C) 2008 Apple Inc. All Rights Reserved. - - This file is part of the WebKit project - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ + * Copyright (C) 2007 Eric Seidel <eric@webkit.org> + * Copyright (C) 2007 Rob Buis <buis@kde.org> + * Copyright (C) 2008 Apple Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ #include "config.h" #if ENABLE(SVG) && ENABLE(SVG_ANIMATION) #include "SVGAnimateMotionElement.h" -#include "MappedAttribute.h" +#include "Attribute.h" #include "RenderObject.h" +#include "RenderSVGResource.h" #include "SVGElementInstance.h" #include "SVGMPathElement.h" #include "SVGParserUtilities.h" +#include "SVGPathParserFactory.h" #include "SVGPathElement.h" #include "SVGTransformList.h" #include <math.h> @@ -83,11 +83,12 @@ bool SVGAnimateMotionElement::hasValidTarget() const return false; } -void SVGAnimateMotionElement::parseMappedAttribute(MappedAttribute* attr) +void SVGAnimateMotionElement::parseMappedAttribute(Attribute* attr) { if (attr->name() == SVGNames::pathAttr) { m_path = Path(); - pathFromSVGData(m_path, attr->value()); + SVGPathParserFactory* factory = SVGPathParserFactory::self(); + factory->buildPathFromString(attr->value(), m_path); } else SVGAnimationElement::parseMappedAttribute(attr); } @@ -179,7 +180,10 @@ void SVGAnimateMotionElement::calculateAnimatedValue(float percentage, unsigned, AffineTransform* transform = target->supplementalTransform(); if (!transform) return; - + + if (target->renderer()) + target->renderer()->setNeedsTransformUpdate(); + if (!isAdditive()) transform->makeIdentity(); @@ -211,9 +215,12 @@ void SVGAnimateMotionElement::applyResultsToTarget() { // We accumulate to the target element transform list so there is not much to do here. SVGElement* targetElement = this->targetElement(); - if (targetElement && targetElement->renderer()) - targetElement->renderer()->setNeedsLayout(true); - + if (!targetElement) + return; + + if (RenderObject* renderer = targetElement->renderer()) + RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); + // ...except in case where we have additional instances in <use> trees. const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement(); const HashSet<SVGElementInstance*>::const_iterator end = instances.end(); @@ -223,8 +230,10 @@ void SVGAnimateMotionElement::applyResultsToTarget() AffineTransform* transform = shadowTreeElement->supplementalTransform(); AffineTransform* t = targetElement->supplementalTransform(); transform->setMatrix(t->a(), t->b(), t->c(), t->d(), t->e(), t->f()); - if (shadowTreeElement->renderer()) - shadowTreeElement->renderer()->setNeedsLayout(true); + if (RenderObject* renderer = shadowTreeElement->renderer()) { + renderer->setNeedsTransformUpdate(); + RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); + } } } @@ -243,5 +252,3 @@ float SVGAnimateMotionElement::calculateDistance(const String& fromString, const } #endif // ENABLE(SVG) - -// vim:ts=4:noet |