| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1992 return; | 1992 return; |
| 1993 | 1993 |
| 1994 if (isDisabledFormControl(this) && event.isMouseEvent()) | 1994 if (isDisabledFormControl(this) && event.isMouseEvent()) |
| 1995 return; | 1995 return; |
| 1996 | 1996 |
| 1997 fireEventListeners(&event); | 1997 fireEventListeners(&event); |
| 1998 } | 1998 } |
| 1999 | 1999 |
| 2000 void Node::dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event> event) | 2000 void Node::dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event> event) |
| 2001 { | 2001 { |
| 2002 dispatchScopedEventDispatchMediator(EventDispatchMediator::create(event)); | 2002 EventDispatcher::dispatchScopedEvent(*this, event->createMediator()); |
| 2003 } | |
| 2004 | |
| 2005 void Node::dispatchScopedEventDispatchMediator(PassRefPtrWillBeRawPtr<EventDispa
tchMediator> eventDispatchMediator) | |
| 2006 { | |
| 2007 EventDispatcher::dispatchScopedEvent(*this, eventDispatchMediator); | |
| 2008 } | 2003 } |
| 2009 | 2004 |
| 2010 bool Node::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) | 2005 bool Node::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) |
| 2011 { | 2006 { |
| 2012 if (event->isMouseEvent()) | 2007 return EventDispatcher::dispatchEvent(*this, event->createMediator()); |
| 2013 return EventDispatcher::dispatchEvent(*this, MouseEventDispatchMediator:
:create(static_pointer_cast<MouseEvent>(event), MouseEventDispatchMediator::Synt
heticMouseEvent)); | |
| 2014 if (event->isTouchEvent()) | |
| 2015 return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event)); | |
| 2016 if (event->isPointerEvent()) | |
| 2017 return dispatchPointerEvent(static_pointer_cast<PointerEvent>(event)); | |
| 2018 | |
| 2019 return EventDispatcher::dispatchEvent(*this, EventDispatchMediator::create(e
vent)); | |
| 2020 } | 2008 } |
| 2021 | 2009 |
| 2022 void Node::dispatchSubtreeModifiedEvent() | 2010 void Node::dispatchSubtreeModifiedEvent() |
| 2023 { | 2011 { |
| 2024 if (isInShadowTree()) | 2012 if (isInShadowTree()) |
| 2025 return; | 2013 return; |
| 2026 | 2014 |
| 2027 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); | 2015 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); |
| 2028 | 2016 |
| 2029 if (!document().hasListenerType(Document::DOMSUBTREEMODIFIED_LISTENER)) | 2017 if (!document().hasListenerType(Document::DOMSUBTREEMODIFIED_LISTENER)) |
| 2030 return; | 2018 return; |
| 2031 | 2019 |
| 2032 dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMSubtreeModified
, true)); | 2020 dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMSubtreeModified
, true)); |
| 2033 } | 2021 } |
| 2034 | 2022 |
| 2035 bool Node::dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> un
derlyingEvent) | 2023 bool Node::dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> un
derlyingEvent) |
| 2036 { | 2024 { |
| 2037 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); | 2025 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); |
| 2038 RefPtrWillBeRawPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActiv
ate, true, true, document().domWindow(), detail); | 2026 RefPtrWillBeRawPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActiv
ate, true, true, document().domWindow(), detail); |
| 2039 event->setUnderlyingEvent(underlyingEvent); | 2027 event->setUnderlyingEvent(underlyingEvent); |
| 2040 dispatchScopedEvent(event); | 2028 dispatchScopedEvent(event); |
| 2041 return event->defaultHandled(); | 2029 return event->defaultHandled(); |
| 2042 } | 2030 } |
| 2043 | 2031 |
| 2044 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& event) | 2032 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& nativeEvent) |
| 2045 { | 2033 { |
| 2046 return EventDispatcher::dispatchEvent(*this, KeyboardEventDispatchMediator::
create(KeyboardEvent::create(event, document().domWindow()))); | 2034 return dispatchEvent(KeyboardEvent::create(nativeEvent, document().domWindow
())); |
| 2047 } | 2035 } |
| 2048 | 2036 |
| 2049 bool Node::dispatchMouseEvent(const PlatformMouseEvent& event, const AtomicStrin
g& eventType, | 2037 bool Node::dispatchMouseEvent(const PlatformMouseEvent& nativeEvent, const Atomi
cString& eventType, |
| 2050 int detail, Node* relatedTarget) | 2038 int detail, Node* relatedTarget) |
| 2051 { | 2039 { |
| 2052 return EventDispatcher::dispatchEvent(*this, MouseEventDispatchMediator::cre
ate(MouseEvent::create(eventType, document().domWindow(), event, detail, related
Target))); | 2040 RefPtrWillBeRawPtr<MouseEvent> event = MouseEvent::create(eventType, documen
t().domWindow(), nativeEvent, detail, relatedTarget); |
| 2041 event->setTrusted(true); |
| 2042 return dispatchEvent(event); |
| 2053 } | 2043 } |
| 2054 | 2044 |
| 2055 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) | 2045 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) |
| 2056 { | 2046 { |
| 2057 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(documen
t().domWindow(), event); | 2047 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(documen
t().domWindow(), event); |
| 2058 if (!gestureEvent.get()) | 2048 if (!gestureEvent.get()) |
| 2059 return false; | 2049 return false; |
| 2060 return EventDispatcher::dispatchEvent(*this, GestureEventDispatchMediator::c
reate(gestureEvent)); | 2050 return dispatchEvent(gestureEvent); |
| 2061 } | |
| 2062 | |
| 2063 bool Node::dispatchTouchEvent(PassRefPtrWillBeRawPtr<TouchEvent> event) | |
| 2064 { | |
| 2065 return EventDispatcher::dispatchEvent(*this, TouchEventDispatchMediator::cre
ate(event)); | |
| 2066 } | |
| 2067 | |
| 2068 bool Node::dispatchPointerEvent(PassRefPtrWillBeRawPtr<PointerEvent> event) | |
| 2069 { | |
| 2070 return EventDispatcher::dispatchEvent(*this, PointerEventDispatchMediator::c
reate(event)); | |
| 2071 } | 2051 } |
| 2072 | 2052 |
| 2073 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve
ntOptions eventOptions) | 2053 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve
ntOptions eventOptions) |
| 2074 { | 2054 { |
| 2075 EventDispatcher::dispatchSimulatedClick(*this, underlyingEvent, eventOptions
); | 2055 EventDispatcher::dispatchSimulatedClick(*this, underlyingEvent, eventOptions
); |
| 2076 } | 2056 } |
| 2077 | 2057 |
| 2078 bool Node::dispatchWheelEvent(const PlatformWheelEvent& event) | 2058 bool Node::dispatchWheelEvent(const PlatformWheelEvent& event) |
| 2079 { | 2059 { |
| 2080 return EventDispatcher::dispatchEvent(*this, WheelEventDispatchMediator::cre
ate(event, document().domWindow())); | 2060 return dispatchEvent(WheelEvent::create(event, document().domWindow())); |
| 2081 } | 2061 } |
| 2082 | 2062 |
| 2083 void Node::dispatchInputEvent() | 2063 void Node::dispatchInputEvent() |
| 2084 { | 2064 { |
| 2085 dispatchScopedEvent(Event::createBubble(EventTypeNames::input)); | 2065 dispatchScopedEvent(Event::createBubble(EventTypeNames::input)); |
| 2086 } | 2066 } |
| 2087 | 2067 |
| 2088 void Node::defaultEventHandler(Event* event) | 2068 void Node::defaultEventHandler(Event* event) |
| 2089 { | 2069 { |
| 2090 if (event->target() != this) | 2070 if (event->target() != this) |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2411 | 2391 |
| 2412 void showNodePath(const blink::Node* node) | 2392 void showNodePath(const blink::Node* node) |
| 2413 { | 2393 { |
| 2414 if (node) | 2394 if (node) |
| 2415 node->showNodePathForThis(); | 2395 node->showNodePathForThis(); |
| 2416 else | 2396 else |
| 2417 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2397 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
| 2418 } | 2398 } |
| 2419 | 2399 |
| 2420 #endif | 2400 #endif |
| OLD | NEW |