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

Side by Side Diff: Source/core/svg/SVGElement.cpp

Issue 293983020: SVG: Remove JSC specific workaround in SVGElement::removeEventListener (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ASSERT_UNUSED 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org> 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org>
3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2008 Apple Inc. All rights reserved.
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 // Remove event listener from regular DOM element 840 // Remove event listener from regular DOM element
841 if (!Node::removeEventListener(eventType, listener, useCapture)) 841 if (!Node::removeEventListener(eventType, listener, useCapture))
842 return false; 842 return false;
843 843
844 // Remove event listener from all shadow tree DOM element instances 844 // Remove event listener from all shadow tree DOM element instances
845 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = instances.end(); 845 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = instances.end();
846 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = instances.begin(); it != end; ++it) { 846 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = instances.begin(); it != end; ++it) {
847 SVGElement* shadowTreeElement = *it; 847 SVGElement* shadowTreeElement = *it;
848 ASSERT(shadowTreeElement); 848 ASSERT(shadowTreeElement);
849 849
850 if (shadowTreeElement->Node::removeEventListener(eventType, listener, us eCapture)) 850 bool removeSuccess = shadowTreeElement->Node::removeEventListener(eventT ype, listener, useCapture);
851 continue; 851 ASSERT_UNUSED(removeSuccess, removeSuccess);
kouhei (in TOK) 2014/05/23 09:35:30 The failing tests manually remove certain eventhan
852
853 // This case can only be hit for event listeners created from markup
854 ASSERT(listener->wasCreatedFromMarkup());
855
856 // If the event listener 'listener' has been created from markup and has been fired before
857 // then JSLazyEventListener::parseCode() has been called and m_jsFunctio n of that listener
858 // has been created (read: it's not 0 anymore). During shadow tree creat ion, the event
859 // listener DOM attribute has been cloned, and another event listener ha s been setup in
860 // the shadow tree. If that event listener has not been used yet, m_jsFu nction is still 0,
861 // and tryRemoveEventListener() above will fail. Work around that very s eldom problem.
862 EventTargetData* data = shadowTreeElement->eventTargetData();
863 ASSERT(data);
864
865 data->eventListenerMap.removeFirstEventListenerCreatedFromMarkup(eventTy pe);
866 } 852 }
867 853
868 return true; 854 return true;
869 } 855 }
870 856
871 static bool hasLoadListener(Element* element) 857 static bool hasLoadListener(Element* element)
872 { 858 {
873 if (element->hasEventListeners(EventTypeNames::load)) 859 if (element->hasEventListeners(EventTypeNames::load))
874 return true; 860 return true;
875 861
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 animatableAttributes.add(SVGNames::zAttr); 1165 animatableAttributes.add(SVGNames::zAttr);
1180 } 1166 }
1181 1167
1182 if (name == classAttr) 1168 if (name == classAttr)
1183 return true; 1169 return true;
1184 1170
1185 return animatableAttributes.contains(name); 1171 return animatableAttributes.contains(name);
1186 } 1172 }
1187 #endif 1173 #endif
1188 } 1174 }
OLDNEW
« 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