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

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

Issue 272623003: Stop using SVGElementInstance in SVGElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Do shadow dom deletion later Created 6 years, 7 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 | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGElementInstance.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGElement.cpp
diff --git a/Source/core/svg/SVGElement.cpp b/Source/core/svg/SVGElement.cpp
index 254df4ec29e49a72ccb6c87193e4a04448401e6a..97616c699f9b45843027543816689fd54666aff3 100644
--- a/Source/core/svg/SVGElement.cpp
+++ b/Source/core/svg/SVGElement.cpp
@@ -42,7 +42,6 @@
#include "core/rendering/svg/RenderSVGResourceContainer.h"
#include "core/svg/SVGCursorElement.h"
#include "core/svg/SVGDocumentExtensions.h"
-#include "core/svg/SVGElementInstance.h"
#include "core/svg/SVGElementRareData.h"
#include "core/svg/SVGGraphicsElement.h"
#include "core/svg/SVGSVGElement.h"
@@ -528,28 +527,27 @@ SVGDocumentExtensions& SVGElement::accessDocumentSVGExtensions()
return document().accessSVGExtensions();
}
-void SVGElement::mapInstanceToElement(SVGElementInstance* instance)
+void SVGElement::mapInstanceToElement(SVGElement* instance)
{
ASSERT(instance);
+ ASSERT(instance->inUseShadowTree());
HashSet<SVGElement*>& instances = ensureSVGRareData()->elementInstances();
- ASSERT(!instances.contains(instance->shadowTreeElement()));
+ ASSERT(!instances.contains(instance));
- instances.add(instance->shadowTreeElement());
+ instances.add(instance);
}
-void SVGElement::removeInstanceMapping(SVGElementInstance* instance)
+void SVGElement::removeInstanceMapping(SVGElement* instance)
{
ASSERT(instance);
+ ASSERT(instance->inUseShadowTree());
ASSERT(hasSVGRareData());
- if (!instance->shadowTreeElement())
- return;
-
HashSet<SVGElement*>& instances = svgRareData()->elementInstances();
- ASSERT(instances.contains(instance->shadowTreeElement()));
+ ASSERT(instances.contains(instance));
- instances.remove(instance->shadowTreeElement());
+ instances.remove(instance);
}
const HashSet<SVGElement*>& SVGElement::instancesForElement() const
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGElementInstance.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698