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

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

Issue 2645383002: Move 'id'-related invalidation to SVGElement::attributeChanged (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | 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/SVGElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp
index 5ebdd6f1b632681a517a0e87bd03f273c6cb287b..e9776b30f7bb32fe77ffc64d37cd033d751e871b 100644
--- a/third_party/WebKit/Source/core/svg/SVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp
@@ -918,9 +918,20 @@ void SVGElement::attributeChanged(const AttributeModificationParams& params) {
AttributeModificationParams(params.name, params.oldValue, params.newValue,
AttributeModificationReason::kDirectly));
- if (params.name == HTMLNames::idAttr)
+ if (params.name == HTMLNames::idAttr) {
rebuildAllIncomingReferences();
+ LayoutObject* object = layoutObject();
+ // Notify resources about id changes, this is important as we cache
+ // resources by id in SVGDocumentExtensions
+ if (object && object->isSVGResourceContainer())
+ toLayoutSVGResourceContainer(object)->idChanged();
+ if (isConnected())
+ buildPendingResourcesIfNeeded();
+ invalidateInstances();
+ return;
+ }
+
// Changes to the style attribute are processed lazily (see
// Element::getAttribute() and related methods), so we don't want changes to
// the style attribute to result in extra work here.
@@ -942,18 +953,6 @@ void SVGElement::svgAttributeChanged(const QualifiedName& attrName) {
invalidateInstances();
return;
}
-
- if (attrName == HTMLNames::idAttr) {
- LayoutObject* object = layoutObject();
- // Notify resources about id changes, this is important as we cache
- // resources by id in SVGDocumentExtensions
- if (object && object->isSVGResourceContainer())
- toLayoutSVGResourceContainer(object)->idChanged();
- if (isConnected())
- buildPendingResourcesIfNeeded();
- invalidateInstances();
- return;
- }
}
void SVGElement::svgAttributeBaseValChanged(const QualifiedName& attribute) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698