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 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2157 { | 2157 { |
2158 if (!hasEventTargetData()) | 2158 if (!hasEventTargetData()) |
2159 return; | 2159 return; |
2160 | 2160 |
2161 if (isDisabledFormControl(this) && event->isMouseEvent()) | 2161 if (isDisabledFormControl(this) && event->isMouseEvent()) |
2162 return; | 2162 return; |
2163 | 2163 |
2164 fireEventListeners(event); | 2164 fireEventListeners(event); |
2165 } | 2165 } |
2166 | 2166 |
2167 void Node::dispatchScopedEvent(PassRefPtr<Event> event) | 2167 void Node::dispatchScopedEvent(PassRefPtrWillBeRawPtr<Event> event) |
2168 { | 2168 { |
2169 dispatchScopedEventDispatchMediator(EventDispatchMediator::create(event)); | 2169 dispatchScopedEventDispatchMediator(EventDispatchMediator::create(event)); |
2170 } | 2170 } |
2171 | 2171 |
2172 void Node::dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator>
eventDispatchMediator) | 2172 void Node::dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator>
eventDispatchMediator) |
2173 { | 2173 { |
2174 EventDispatcher::dispatchScopedEvent(this, eventDispatchMediator); | 2174 EventDispatcher::dispatchScopedEvent(this, eventDispatchMediator); |
2175 } | 2175 } |
2176 | 2176 |
2177 bool Node::dispatchEvent(PassRefPtr<Event> event) | 2177 bool Node::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) |
2178 { | 2178 { |
2179 if (event->isMouseEvent()) | 2179 if (event->isMouseEvent()) |
2180 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::
create(static_pointer_cast<MouseEvent>(event), MouseEventDispatchMediator::Synth
eticMouseEvent)); | 2180 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::
create(static_pointer_cast<MouseEvent>(event), MouseEventDispatchMediator::Synth
eticMouseEvent)); |
2181 if (event->isTouchEvent()) | 2181 if (event->isTouchEvent()) |
2182 return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event)); | 2182 return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event)); |
2183 return EventDispatcher::dispatchEvent(this, EventDispatchMediator::create(ev
ent)); | 2183 return EventDispatcher::dispatchEvent(this, EventDispatchMediator::create(ev
ent)); |
2184 } | 2184 } |
2185 | 2185 |
2186 void Node::dispatchSubtreeModifiedEvent() | 2186 void Node::dispatchSubtreeModifiedEvent() |
2187 { | 2187 { |
2188 if (isInShadowTree()) | 2188 if (isInShadowTree()) |
2189 return; | 2189 return; |
2190 | 2190 |
2191 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); | 2191 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); |
2192 | 2192 |
2193 if (!document().hasListenerType(Document::DOMSUBTREEMODIFIED_LISTENER)) | 2193 if (!document().hasListenerType(Document::DOMSUBTREEMODIFIED_LISTENER)) |
2194 return; | 2194 return; |
2195 | 2195 |
2196 dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMSubtreeModified
, true)); | 2196 dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMSubtreeModified
, true)); |
2197 } | 2197 } |
2198 | 2198 |
2199 bool Node::dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEven
t) | 2199 bool Node::dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> un
derlyingEvent) |
2200 { | 2200 { |
2201 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); | 2201 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); |
2202 RefPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActivate, true, t
rue, document().domWindow(), detail); | 2202 RefPtrWillBeRawPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActiv
ate, true, true, document().domWindow(), detail); |
2203 event->setUnderlyingEvent(underlyingEvent); | 2203 event->setUnderlyingEvent(underlyingEvent); |
2204 dispatchScopedEvent(event); | 2204 dispatchScopedEvent(event); |
2205 return event->defaultHandled(); | 2205 return event->defaultHandled(); |
2206 } | 2206 } |
2207 | 2207 |
2208 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& event) | 2208 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& event) |
2209 { | 2209 { |
2210 return EventDispatcher::dispatchEvent(this, KeyboardEventDispatchMediator::c
reate(KeyboardEvent::create(event, document().domWindow()))); | 2210 return EventDispatcher::dispatchEvent(this, KeyboardEventDispatchMediator::c
reate(KeyboardEvent::create(event, document().domWindow()))); |
2211 } | 2211 } |
2212 | 2212 |
2213 bool Node::dispatchMouseEvent(const PlatformMouseEvent& event, const AtomicStrin
g& eventType, | 2213 bool Node::dispatchMouseEvent(const PlatformMouseEvent& event, const AtomicStrin
g& eventType, |
2214 int detail, Node* relatedTarget) | 2214 int detail, Node* relatedTarget) |
2215 { | 2215 { |
2216 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::crea
te(MouseEvent::create(eventType, document().domWindow(), event, detail, relatedT
arget))); | 2216 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::crea
te(MouseEvent::create(eventType, document().domWindow(), event, detail, relatedT
arget))); |
2217 } | 2217 } |
2218 | 2218 |
2219 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) | 2219 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) |
2220 { | 2220 { |
2221 RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document().domWindo
w(), event); | 2221 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(documen
t().domWindow(), event); |
2222 if (!gestureEvent.get()) | 2222 if (!gestureEvent.get()) |
2223 return false; | 2223 return false; |
2224 return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::cr
eate(gestureEvent)); | 2224 return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::cr
eate(gestureEvent)); |
2225 } | 2225 } |
2226 | 2226 |
2227 bool Node::dispatchTouchEvent(PassRefPtr<TouchEvent> event) | 2227 bool Node::dispatchTouchEvent(PassRefPtrWillBeRawPtr<TouchEvent> event) |
2228 { | 2228 { |
2229 return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::crea
te(event)); | 2229 return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::crea
te(event)); |
2230 } | 2230 } |
2231 | 2231 |
2232 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve
ntOptions eventOptions) | 2232 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve
ntOptions eventOptions) |
2233 { | 2233 { |
2234 EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, eventOptions)
; | 2234 EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, eventOptions)
; |
2235 } | 2235 } |
2236 | 2236 |
2237 bool Node::dispatchWheelEvent(const PlatformWheelEvent& event) | 2237 bool Node::dispatchWheelEvent(const PlatformWheelEvent& event) |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2527 node->showTreeForThis(); | 2527 node->showTreeForThis(); |
2528 } | 2528 } |
2529 | 2529 |
2530 void showNodePath(const WebCore::Node* node) | 2530 void showNodePath(const WebCore::Node* node) |
2531 { | 2531 { |
2532 if (node) | 2532 if (node) |
2533 node->showNodePathForThis(); | 2533 node->showNodePathForThis(); |
2534 } | 2534 } |
2535 | 2535 |
2536 #endif | 2536 #endif |
OLD | NEW |