| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2014 Google, Inc. | 4 * Copyright (C) 2014 Google, Inc. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName) { | 162 void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName) { |
| 163 // Reattach so the isValid() check will be run again during layoutObject | 163 // Reattach so the isValid() check will be run again during layoutObject |
| 164 // creation. | 164 // creation. |
| 165 if (SVGTests::isKnownAttribute(attrName)) { | 165 if (SVGTests::isKnownAttribute(attrName)) { |
| 166 SVGElement::InvalidationGuard invalidationGuard(this); | 166 SVGElement::InvalidationGuard invalidationGuard(this); |
| 167 lazyReattachIfAttached(); | 167 lazyReattachIfAttached(); |
| 168 return; | 168 return; |
| 169 } | 169 } |
| 170 | 170 |
| 171 if (attrName == SVGNames::transformAttr) { | 171 if (attrName == SVGNames::transformAttr) { |
| 172 LayoutObject* object = layoutObject(); | 172 SVGElement::InvalidationGuard invalidationGuard(this); |
| 173 if (!object) | |
| 174 return; | |
| 175 | |
| 176 invalidateSVGPresentationAttributeStyle(); | 173 invalidateSVGPresentationAttributeStyle(); |
| 177 | |
| 178 SVGElement::InvalidationGuard invalidationGuard(this); | |
| 179 // TODO(fs): The InvalidationGuard will make sure all instances are | 174 // TODO(fs): The InvalidationGuard will make sure all instances are |
| 180 // invalidated, but the style recalc will propagate to instances too. So | 175 // invalidated, but the style recalc will propagate to instances too. So |
| 181 // there is some redundant operations being performed here. Could we get | 176 // there is some redundant operations being performed here. Could we get |
| 182 // away with removing the InvalidationGuard? | 177 // away with removing the InvalidationGuard? |
| 183 setNeedsStyleRecalc(LocalStyleChange, | 178 setNeedsStyleRecalc(LocalStyleChange, |
| 184 StyleChangeReasonForTracing::fromAttribute(attrName)); | 179 StyleChangeReasonForTracing::fromAttribute(attrName)); |
| 185 markForLayoutAndParentResourceInvalidation(object); | 180 if (LayoutObject* object = layoutObject()) |
| 181 markForLayoutAndParentResourceInvalidation(object); |
| 186 return; | 182 return; |
| 187 } | 183 } |
| 188 | 184 |
| 189 SVGElement::svgAttributeChanged(attrName); | 185 SVGElement::svgAttributeChanged(attrName); |
| 190 } | 186 } |
| 191 | 187 |
| 192 SVGElement* SVGGraphicsElement::nearestViewportElement() const { | 188 SVGElement* SVGGraphicsElement::nearestViewportElement() const { |
| 193 for (Element* current = parentOrShadowHostElement(); current; | 189 for (Element* current = parentOrShadowHostElement(); current; |
| 194 current = current->parentOrShadowHostElement()) { | 190 current = current->parentOrShadowHostElement()) { |
| 195 if (isViewportElement(*current)) | 191 if (isViewportElement(*current)) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 218 | 214 |
| 219 return layoutObject()->objectBoundingBox(); | 215 return layoutObject()->objectBoundingBox(); |
| 220 } | 216 } |
| 221 | 217 |
| 222 SVGRectTearOff* SVGGraphicsElement::getBBoxFromJavascript() { | 218 SVGRectTearOff* SVGGraphicsElement::getBBoxFromJavascript() { |
| 223 return SVGRectTearOff::create(SVGRect::create(getBBox()), 0, | 219 return SVGRectTearOff::create(SVGRect::create(getBBox()), 0, |
| 224 PropertyIsNotAnimVal); | 220 PropertyIsNotAnimVal); |
| 225 } | 221 } |
| 226 | 222 |
| 227 } // namespace blink | 223 } // namespace blink |
| OLD | NEW |