Changeset 42261 in webkit


Ignore:
Timestamp:
Apr 6, 2009 4:43:00 PM (15 years ago)
Author:
weinig@apple.com
Message:

2009-04-06 Sam Weinig <sam@webkit.org>

Reviewed by Mark Rowe.

Bottleneck dispatching mutation events in a new dispatchMutationEvent
function.

  • dom/CharacterData.cpp: (WebCore::CharacterData::dispatchModifiedEvent):
  • dom/ContainerNode.cpp: (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents):
  • dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchMutationEvent):
  • dom/Node.h:
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r42260 r42261  
     12009-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
    1182009-04-06  Dimitri Glazkov  <dglazkov@chromium.org>
    219
  • trunk/WebCore/dom/CharacterData.cpp

    r40675 r42261  
    199199    if (document()->hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTENER)) {
    200200        ExceptionCode ec;
    201         dispatchEvent(MutationEvent::create(eventNames().DOMCharacterDataModifiedEvent, true, false, 0, prevValue, m_data, String(), 0), ec);
     201        dispatchMutationEvent(eventNames().DOMCharacterDataModifiedEvent, true, 0, prevValue, m_data, ec);
    202202    }
    203203    dispatchSubtreeModifiedEvent();
  • trunk/WebCore/dom/ContainerNode.cpp

    r41986 r42261  
    883883    if (c->parentNode() && doc->hasListenerType(Document::DOMNODEINSERTED_LISTENER)) {
    884884        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);
    887886        if (ec)
    888887            return;
     
    893892        for (; c; c = c->traverseNextNode(child)) {
    894893            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);
    897895            if (ec)
    898896                return;
     
    913911    if (c->parentNode() && doc->hasListenerType(Document::DOMNODEREMOVED_LISTENER)) {
    914912        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);
    917914        if (ec)
    918915            return;
     
    923920        for (; c; c = c->traverseNextNode(child)) {
    924921            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);
    927923            if (ec)
    928924                return;
  • trunk/WebCore/dom/Node.cpp

    r42255 r42261  
    25052505
    25062506    ExceptionCode ec = 0;
    2507     dispatchEvent(MutationEvent::create(eventNames().DOMSubtreeModifiedEvent, true, false, 0, String(), String(), String(), 0), ec);
     2507    dispatchMutationEvent(eventNames().DOMSubtreeModifiedEvent, true, 0, String(), String(), ec);
    25082508}
    25092509
     
    27492749    ExceptionCode ec = 0;
    27502750    dispatchEvent(WebKitTransitionEvent::create(eventType, propertyName, elapsedTime), ec);
     2751}
     2752
     2753void 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);
    27512758}
    27522759
  • trunk/WebCore/dom/Node.h

    r42255 r42261  
    546546    void dispatchWebKitAnimationEvent(const AtomicString& eventType, const String& animationName, double elapsedTime);
    547547    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
    548550    bool dispatchGenericEvent(PassRefPtr<Event>);
    549551
Note: See TracChangeset for help on using the changeset viewer.