Chromium Code Reviews| Index: Source/core/svg/SVGGraphicsElement.cpp |
| diff --git a/Source/core/svg/SVGGraphicsElement.cpp b/Source/core/svg/SVGGraphicsElement.cpp |
| index 9da02b36d0c5be6abf56906c9b2bd9bb4be5a591..fd28c05813e07c3011c03ca88f28671718a5cfc7 100644 |
| --- a/Source/core/svg/SVGGraphicsElement.cpp |
| +++ b/Source/core/svg/SVGGraphicsElement.cpp |
| @@ -27,6 +27,7 @@ |
| #include "core/rendering/svg/RenderSVGResource.h" |
| #include "core/rendering/svg/SVGPathData.h" |
| #include "core/svg/SVGElementInstance.h" |
| +#include "core/svg/SVGElementRareData.h" |
| #include "platform/transforms/AffineTransform.h" |
| namespace WebCore { |
| @@ -120,6 +121,13 @@ void SVGGraphicsElement::parseAttribute(const QualifiedName& name, const AtomicS |
| ASSERT_NOT_REACHED(); |
| } |
| +bool SVGGraphicsElement::cachedValidity() const |
|
pdr.
2013/10/25 06:13:12
Ditto for this name.
|
| +{ |
| + if (!hasSVGRareData()) |
| + return true; |
| + return svgRareData()->isValid(); |
| +} |
| + |
| void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName) |
| { |
| if (!isSupportedAttribute(attrName)) { |
| @@ -129,8 +137,16 @@ void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName) |
| SVGElementInstance::InvalidationGuard invalidationGuard(this); |
| - if (SVGTests::handleAttributeChange(this, attrName)) |
| + if (SVGTests::isKnownAttribute(attrName)) { |
| + // FIXME: Need to cast because both SVGTests and SVGElement have isValid() |
| + // and SVG code uses multiple inheritance way too much. |
| + bool validity = static_cast<SVGElement*>(this)->isValid(); |
|
pdr.
2013/10/25 06:13:12
Please use toSVGElement here instead of the static
|
| + if (cachedValidity() != validity) { |
| + lazyReattachIfAttached(); |
| + ensureSVGRareData()->setIsValid(validity); |
| + } |
| return; |
| + } |
| RenderObject* object = renderer(); |
| if (!object) |