Changeset 42261 in webkit
- Timestamp:
- Apr 6, 2009 4:43:00 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r42260 r42261 1 2009-04-06 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Mark Rowe. 4 5 Bottleneck dispatching mutation events in a new dispatchMutationEvent 6 function. 7 8 * dom/CharacterData.cpp: 9 (WebCore::CharacterData::dispatchModifiedEvent): 10 * dom/ContainerNode.cpp: 11 (WebCore::dispatchChildInsertionEvents): 12 (WebCore::dispatchChildRemovalEvents): 13 * dom/Node.cpp: 14 (WebCore::Node::dispatchSubtreeModifiedEvent): 15 (WebCore::Node::dispatchMutationEvent): 16 * dom/Node.h: 17 1 18 2009-04-06 Dimitri Glazkov <dglazkov@chromium.org> 2 19 -
trunk/WebCore/dom/CharacterData.cpp
r40675 r42261 199 199 if (document()->hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTENER)) { 200 200 ExceptionCode ec; 201 dispatch Event(MutationEvent::create(eventNames().DOMCharacterDataModifiedEvent, true, false, 0, prevValue, m_data, String(), 0), ec);201 dispatchMutationEvent(eventNames().DOMCharacterDataModifiedEvent, true, 0, prevValue, m_data, ec); 202 202 } 203 203 dispatchSubtreeModifiedEvent(); -
trunk/WebCore/dom/ContainerNode.cpp
r41986 r42261 883 883 if (c->parentNode() && doc->hasListenerType(Document::DOMNODEINSERTED_LISTENER)) { 884 884 ec = 0; 885 c->dispatchEvent(MutationEvent::create(eventNames().DOMNodeInsertedEvent, true, false, 886 c->parentNode(), String(), String(), String(), 0), ec); 885 c->dispatchMutationEvent(eventNames().DOMNodeInsertedEvent, true, c->parentNode(), String(), String(), ec); 887 886 if (ec) 888 887 return; … … 893 892 for (; c; c = c->traverseNextNode(child)) { 894 893 ec = 0; 895 c->dispatchEvent(MutationEvent::create(eventNames().DOMNodeInsertedIntoDocumentEvent, false, false, 896 0, String(), String(), String(), 0), ec); 894 c->dispatchMutationEvent(eventNames().DOMNodeInsertedIntoDocumentEvent, false, 0, String(), String(), ec); 897 895 if (ec) 898 896 return; … … 913 911 if (c->parentNode() && doc->hasListenerType(Document::DOMNODEREMOVED_LISTENER)) { 914 912 ec = 0; 915 c->dispatchEvent(MutationEvent::create(eventNames().DOMNodeRemovedEvent, true, false, 916 c->parentNode(), String(), String(), String(), 0), ec); 913 c->dispatchMutationEvent(eventNames().DOMNodeRemovedEvent, true, c->parentNode(), String(), String(), ec); 917 914 if (ec) 918 915 return; … … 923 920 for (; c; c = c->traverseNextNode(child)) { 924 921 ec = 0; 925 c->dispatchEvent(MutationEvent::create(eventNames().DOMNodeRemovedFromDocumentEvent, false, false, 926 0, String(), String(), String(), 0), ec); 922 c->dispatchMutationEvent(eventNames().DOMNodeRemovedFromDocumentEvent, false, 0, String(), String(), ec); 927 923 if (ec) 928 924 return; -
trunk/WebCore/dom/Node.cpp
r42255 r42261 2505 2505 2506 2506 ExceptionCode ec = 0; 2507 dispatch Event(MutationEvent::create(eventNames().DOMSubtreeModifiedEvent, true, false, 0, String(), String(), String(), 0), ec);2507 dispatchMutationEvent(eventNames().DOMSubtreeModifiedEvent, true, 0, String(), String(), ec); 2508 2508 } 2509 2509 … … 2749 2749 ExceptionCode ec = 0; 2750 2750 dispatchEvent(WebKitTransitionEvent::create(eventType, propertyName, elapsedTime), ec); 2751 } 2752 2753 void Node::dispatchMutationEvent(const AtomicString& eventType, bool canBubble, PassRefPtr<Node> relatedNode, const String& prevValue, const String& newValue, ExceptionCode& ec) 2754 { 2755 ASSERT(!eventDispatchForbidden()); 2756 2757 dispatchEvent(MutationEvent::create(eventType, canBubble, false, relatedNode, prevValue, newValue, String(), 0), ec); 2751 2758 } 2752 2759 -
trunk/WebCore/dom/Node.h
r42255 r42261 546 546 void dispatchWebKitAnimationEvent(const AtomicString& eventType, const String& animationName, double elapsedTime); 547 547 void dispatchWebKitTransitionEvent(const AtomicString& eventType, const String& propertyName, double elapsedTime); 548 void dispatchMutationEvent(const AtomicString& type, bool canBubble, PassRefPtr<Node> relatedNode, const String& prevValue, const String& newValue, ExceptionCode&); 549 548 550 bool dispatchGenericEvent(PassRefPtr<Event>); 549 551
Note: See TracChangeset
for help on using the changeset viewer.