Skip to content
  • rniwa@webkit.org's avatar
    2011-05-13 Ryosuke Niwa <rniwa@webkit.org> · 91cc070e
    rniwa@webkit.org authored
            Reviewed by Darin Adler.
    
            click event shouldn't fire when the target is ever removed in mouseup
            https://bugs.webkit.org/show_bug.cgi?id=60600
    
            Added tests to ensure WebKit does not fire click event when the target node
            is removed in mouseup event.
    
            * fast/events/remove-target-in-mouseup-deep-expected.txt: Added.
            * fast/events/remove-target-in-mouseup-deep.html: Added.
            * fast/events/remove-target-in-mouseup-expected.txt: Added.
            * fast/events/remove-target-in-mouseup-insertback-expected.txt: Added.
            * fast/events/remove-target-in-mouseup-insertback.html: Added.
            * fast/events/remove-target-in-mouseup-twice-expected.txt: Added.
            * fast/events/remove-target-in-mouseup-twice.html: Added.
            * fast/events/remove-target-in-mouseup.html: Added.
    2011-05-13  Ryosuke Niwa  <rniwa@webkit.org>
    
            Reviewed by Darin Adler.
    
            click event shouldn't fire when the target is ever removed in mouseup
            https://bugs.webkit.org/show_bug.cgi?id=60600
    
            Fixed the bug by invalidating m_clickNode when it or one of its ancestors has been removed
            from the document. New behavior matches Internet Explorer and Firefox.
    
            Tests: fast/events/remove-target-in-mouseup-deep.html
                   fast/events/remove-target-in-mouseup-insertback.html
                   fast/events/remove-target-in-mouseup-twice.html
                   fast/events/remove-target-in-mouseup.html
    
            * dom/Document.cpp:
            (WebCore::Document::nodeChildrenWillBeRemoved): Calls EventHandler::nodeWillBeRemoved.
            (WebCore::Document::nodeWillBeRemoved): Calls EventHandler::nodeWillBeRemoved.
            * page/EventHandler.cpp:
            (WebCore::EventHandler::nodeWillBeRemoved): Added; invalidates m_clickNode when m_clickNode
            or one of its ancestor is removed from the document.
            * page/EventHandler.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    91cc070e