Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp

Issue 2755813004: Invalidate SVG 'transform' pres. attribute style even if not attached (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/transforms/svgdom-manipulation-before-attach-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName) { 129 void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName) {
130 // Reattach so the isValid() check will be run again during layoutObject 130 // Reattach so the isValid() check will be run again during layoutObject
131 // creation. 131 // creation.
132 if (SVGTests::isKnownAttribute(attrName)) { 132 if (SVGTests::isKnownAttribute(attrName)) {
133 SVGElement::InvalidationGuard invalidationGuard(this); 133 SVGElement::InvalidationGuard invalidationGuard(this);
134 lazyReattachIfAttached(); 134 lazyReattachIfAttached();
135 return; 135 return;
136 } 136 }
137 137
138 if (attrName == SVGNames::transformAttr) { 138 if (attrName == SVGNames::transformAttr) {
139 LayoutObject* object = layoutObject(); 139 SVGElement::InvalidationGuard invalidationGuard(this);
140 if (!object)
141 return;
142
143 invalidateSVGPresentationAttributeStyle(); 140 invalidateSVGPresentationAttributeStyle();
144
145 SVGElement::InvalidationGuard invalidationGuard(this);
146 // TODO(fs): The InvalidationGuard will make sure all instances are 141 // TODO(fs): The InvalidationGuard will make sure all instances are
147 // invalidated, but the style recalc will propagate to instances too. So 142 // invalidated, but the style recalc will propagate to instances too. So
148 // there is some redundant operations being performed here. Could we get 143 // there is some redundant operations being performed here. Could we get
149 // away with removing the InvalidationGuard? 144 // away with removing the InvalidationGuard?
150 setNeedsStyleRecalc(LocalStyleChange, 145 setNeedsStyleRecalc(LocalStyleChange,
151 StyleChangeReasonForTracing::fromAttribute(attrName)); 146 StyleChangeReasonForTracing::fromAttribute(attrName));
152 markForLayoutAndParentResourceInvalidation(object); 147 if (LayoutObject* object = layoutObject())
148 markForLayoutAndParentResourceInvalidation(object);
153 return; 149 return;
154 } 150 }
155 151
156 SVGElement::svgAttributeChanged(attrName); 152 SVGElement::svgAttributeChanged(attrName);
157 } 153 }
158 154
159 SVGElement* SVGGraphicsElement::nearestViewportElement() const { 155 SVGElement* SVGGraphicsElement::nearestViewportElement() const {
160 for (Element* current = parentOrShadowHostElement(); current; 156 for (Element* current = parentOrShadowHostElement(); current;
161 current = current->parentOrShadowHostElement()) { 157 current = current->parentOrShadowHostElement()) {
162 if (isViewportElement(*current)) 158 if (isViewportElement(*current))
(...skipping 22 matching lines...) Expand all
185 181
186 return layoutObject()->objectBoundingBox(); 182 return layoutObject()->objectBoundingBox();
187 } 183 }
188 184
189 SVGRectTearOff* SVGGraphicsElement::getBBoxFromJavascript() { 185 SVGRectTearOff* SVGGraphicsElement::getBBoxFromJavascript() {
190 return SVGRectTearOff::create(SVGRect::create(getBBox()), 0, 186 return SVGRectTearOff::create(SVGRect::create(getBBox()), 0,
191 PropertyIsNotAnimVal); 187 PropertyIsNotAnimVal);
192 } 188 }
193 189
194 } // namespace blink 190 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/transforms/svgdom-manipulation-before-attach-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698