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

Unified Diff: Source/core/svg/animation/SVGSMILElement.cpp

Issue 145583005: [SVG] Remove existing event listeners when eventBase conditions are cleared (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaselined and worked on review comments Created 6 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 | « Source/core/svg/animation/SVGSMILElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/animation/SVGSMILElement.cpp
diff --git a/Source/core/svg/animation/SVGSMILElement.cpp b/Source/core/svg/animation/SVGSMILElement.cpp
index cb08bd6bbbf467d531b0aa159e00a935a3284104..7b2da5bc0d44c065cba85ed74e4c8f81cbb98a44 100644
--- a/Source/core/svg/animation/SVGSMILElement.cpp
+++ b/Source/core/svg/animation/SVGSMILElement.cpp
@@ -189,8 +189,7 @@ SVGSMILElement::~SVGSMILElement()
smilBeginEventSender().cancelEvent(this);
smilRepeatEventSender().cancelEvent(this);
smilRepeatNEventSender().cancelEvent(this);
- disconnectSyncBaseConditions();
- disconnectEventBaseConditions();
+ clearConditions();
if (m_timeContainer && m_targetElement && hasValidAttributeName())
m_timeContainer->unschedule(this, m_targetElement, m_attributeName);
}
@@ -200,6 +199,13 @@ void SVGSMILElement::clearResourceAndEventBaseReferences()
document().accessSVGExtensions()->removeAllTargetReferencesForElement(this);
}
+void SVGSMILElement::clearConditions()
+{
+ disconnectSyncBaseConditions();
+ disconnectEventBaseConditions();
+ m_conditions.clear();
+}
+
void SVGSMILElement::buildPendingResource()
{
clearResourceAndEventBaseReferences();
@@ -322,8 +328,7 @@ void SVGSMILElement::removedFrom(ContainerNode* rootParent)
{
if (rootParent->inDocument()) {
clearResourceAndEventBaseReferences();
- disconnectSyncBaseConditions();
- disconnectEventBaseConditions();
+ clearConditions();
setTargetElement(0);
setAttributeName(anyQName());
animationAttributeChanged();
@@ -505,8 +510,7 @@ void SVGSMILElement::parseAttribute(const QualifiedName& name, const AtomicStrin
{
if (name == SVGNames::beginAttr) {
if (!m_conditions.isEmpty()) {
- disconnectSyncBaseConditions();
- m_conditions.clear();
+ clearConditions();
parseBeginOrEnd(fastGetAttribute(SVGNames::endAttr), End);
}
parseBeginOrEnd(value.string(), Begin);
@@ -514,8 +518,7 @@ void SVGSMILElement::parseAttribute(const QualifiedName& name, const AtomicStrin
connectSyncBaseConditions();
} else if (name == SVGNames::endAttr) {
if (!m_conditions.isEmpty()) {
- disconnectSyncBaseConditions();
- m_conditions.clear();
+ clearConditions();
parseBeginOrEnd(fastGetAttribute(SVGNames::beginAttr), Begin);
}
parseBeginOrEnd(value.string(), End);
« no previous file with comments | « Source/core/svg/animation/SVGSMILElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698