diff options
Diffstat (limited to 'WebCore/svg/SVGPolyElement.cpp')
-rw-r--r-- | WebCore/svg/SVGPolyElement.cpp | 70 |
1 files changed, 40 insertions, 30 deletions
diff --git a/WebCore/svg/SVGPolyElement.cpp b/WebCore/svg/SVGPolyElement.cpp index 800bdfa..8475309 100644 --- a/WebCore/svg/SVGPolyElement.cpp +++ b/WebCore/svg/SVGPolyElement.cpp @@ -1,32 +1,33 @@ /* - Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> - 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> - - 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) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> + * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> + * + * 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) #include "SVGPolyElement.h" +#include "Attribute.h" #include "Document.h" #include "FloatPoint.h" -#include "MappedAttribute.h" #include "RenderPath.h" +#include "RenderSVGResource.h" #include "SVGNames.h" #include "SVGParserUtilities.h" #include "SVGPointList.h" @@ -60,17 +61,15 @@ SVGPointList* SVGPolyElement::animatedPoints() const return 0; } -void SVGPolyElement::parseMappedAttribute(MappedAttribute* attr) +void SVGPolyElement::parseMappedAttribute(Attribute* attr) { const AtomicString& value = attr->value(); if (attr->name() == SVGNames::pointsAttr) { ExceptionCode ec = 0; points()->clear(ec); - if (!pointsListFromSVGData(points(), value)) { - points()->clear(ec); + if (!pointsListFromSVGData(points(), value)) document()->accessSVGExtensions()->reportError("Problem parsing points=\"" + value + "\""); - } } else { if (SVGTests::parseMappedAttribute(attr)) return; @@ -88,17 +87,28 @@ void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName) // The points property is not a regular SVGAnimatedProperty, still we use the same SVG<->XML DOM synchronization framework. if (attrName == SVGNames::pointsAttr) - setSynchronizedSVGAttributes(false); + invalidateSVGAttributes(); + + RenderPath* renderer = static_cast<RenderPath*>(this->renderer()); + if (!renderer) + return; - if (!renderer()) + if (SVGStyledTransformableElement::isKnownAttribute(attrName)) { + renderer->setNeedsTransformUpdate(); + RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); return; + } + + if (attrName == SVGNames::pointsAttr) { + renderer->setNeedsPathUpdate(); + RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); + return; + } - if (attrName == SVGNames::pointsAttr - || SVGTests::isKnownAttribute(attrName) + if (SVGTests::isKnownAttribute(attrName) || SVGLangSpace::isKnownAttribute(attrName) - || SVGExternalResourcesRequired::isKnownAttribute(attrName) - || SVGStyledTransformableElement::isKnownAttribute(attrName)) - renderer()->setNeedsLayout(true); + || SVGExternalResourcesRequired::isKnownAttribute(attrName)) + RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); } void SVGPolyElement::synchronizeProperty(const QualifiedName& attrName) |