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

Unified Diff: third_party/WebKit/Source/core/svg/SVGSVGElement.cpp

Issue 2747153002: Dirty pres. attribute style on <svg> dimension change when 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/svgdom-manipulation-of-svg-root-width-before-attach-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
index eec5eb4625d4fd4ce95c32121b79cb9a1acc8b7d..0206083aec5460f851ef289eace97eb73169bb8d 100644
--- a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
@@ -265,7 +265,10 @@ void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) {
// to mark it for updating.
if (widthOrHeightChanged) {
LayoutObject* layoutObject = this->layoutObject();
- if (layoutObject && layoutObject->isSVGRoot()) {
+ // If the element is not attached, we cannot be sure if it is (going to
+ // be) an outermost root, so always mark presentation attributes dirty in
+ // that case.
+ if (!layoutObject || layoutObject->isSVGRoot()) {
invalidateSVGPresentationAttributeStyle();
setNeedsStyleRecalc(LocalStyleChange,
StyleChangeReasonForTracing::create(
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/svgdom-manipulation-of-svg-root-width-before-attach-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698