Changeset 24267 in webkit


Ignore:
Timestamp:
Jul 13, 2007, 11:55:42 AM (18 years ago)
Author:
antti
Message:

LayoutTests:

Reviewed by Adele.


Test for <rdar://problem/5192256>
click() in onchange handler causes another change event (causes hang at http://forums.whirlpool.net.au/)

  • fast/events/onchange-click-hang-expected.txt: Added.
  • fast/events/onchange-click-hang.html: Added.

WebCore:

Reviewed by Adele.


Fix <rdar://problem/5192256>
click() in onchange handler causes another change event (causes hang at http://forums.whirlpool.net.au/)


Guard against generating a simulated event from within a simulated event in the same node. Try to
match Firefox behavior.

  • dom/EventTargetNode.cpp: (WebCore::EventTargetNode::dispatchSimulatedMouseEvent): (WebCore::EventTargetNode::dispatchSimulatedClick):
  • dom/Node.cpp: (WebCore::Node::Node):
  • dom/Node.h:
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r24266 r24267  
     12007-07-13  Antti Koivisto  <antti@apple.com>
     2
     3        Reviewed by Adele.
     4       
     5        Test for <rdar://problem/5192256>
     6        click() in onchange handler causes another change event (causes hang at http://forums.whirlpool.net.au/)
     7
     8        * fast/events/onchange-click-hang-expected.txt: Added.
     9        * fast/events/onchange-click-hang.html: Added.
     10
    1112007-07-13  Antti Koivisto  <antti@apple.com>
    212
  • trunk/WebCore/ChangeLog

    r24266 r24267  
     12007-07-13  Antti Koivisto  <antti@apple.com>
     2
     3        Reviewed by Adele.
     4       
     5        Fix <rdar://problem/5192256>
     6        click() in onchange handler causes another change event (causes hang at http://forums.whirlpool.net.au/)
     7       
     8        Guard against generating a simulated event from within a simulated event in the same node. Try to
     9        match Firefox behavior.
     10
     11        * dom/EventTargetNode.cpp:
     12        (WebCore::EventTargetNode::dispatchSimulatedMouseEvent):
     13        (WebCore::EventTargetNode::dispatchSimulatedClick):
     14        * dom/Node.cpp:
     15        (WebCore::Node::Node):
     16        * dom/Node.h:
     17
    1182007-07-13  Antti Koivisto  <antti@apple.com>
    219
  • trunk/WebCore/dom/EventTargetNode.cpp

    r20780 r24267  
    402402{
    403403    ASSERT(!eventDispatchForbidden());
     404   
     405    if (m_dispatchingSimulatedEvent)
     406        return;
    404407
    405408    bool ctrlKey = false;
     
    413416        metaKey = keyStateEvent->metaKey();
    414417    }
     418   
     419    m_dispatchingSimulatedEvent = true;
    415420
    416421    // Like Gecko, we just pass 0 for everything when we make a fake mouse event.
     
    418423    dispatchMouseEvent(eventType, 0, 0, 0, 0, 0, 0,
    419424        ctrlKey, altKey, shiftKey, metaKey, true, 0, underlyingEvent);
     425   
     426    m_dispatchingSimulatedEvent = false;
    420427}
    421428
    422429void EventTargetNode::dispatchSimulatedClick(PassRefPtr<Event> event, bool sendMouseEvents, bool showPressedLook)
    423430{
     431    if (m_dispatchingSimulatedEvent)
     432        return;
     433   
    424434    // send mousedown and mouseup before the click, if requested
    425435    if (sendMouseEvents)
  • trunk/WebCore/dom/Node.cpp

    r24099 r24267  
    154154      m_inActiveChain(false),
    155155      m_inDetach(false),
     156      m_dispatchingSimulatedEvent(false),
    156157      m_inSubtreeMark(false)
    157158{
  • trunk/WebCore/dom/Node.h

    r24099 r24267  
    483483
    484484    bool m_inDetach : 1;
     485    bool m_dispatchingSimulatedEvent : 1;
    485486
    486487public:
    487488    bool m_inSubtreeMark : 1;
     489    // 0 bits left
    488490
    489491private:
Note: See TracChangeset for help on using the changeset viewer.