OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 | 27 |
28 #if ENABLE(GESTURE_EVENTS) | 28 #if ENABLE(GESTURE_EVENTS) |
29 | 29 |
30 #include "GestureEvent.h" | 30 #include "GestureEvent.h" |
31 | 31 |
32 #include "Element.h" | |
33 #include <wtf/text/AtomicString.h> | 32 #include <wtf/text/AtomicString.h> |
34 | 33 |
35 namespace WebCore { | 34 namespace WebCore { |
36 | 35 |
37 PassRefPtr<GestureEvent> GestureEvent::create() | 36 PassRefPtr<GestureEvent> GestureEvent::create() |
38 { | 37 { |
39 return adoptRef(new GestureEvent); | 38 return adoptRef(new GestureEvent); |
40 } | 39 } |
41 | 40 |
42 PassRefPtr<GestureEvent> GestureEvent::create(PassRefPtr<AbstractView> view, con
st PlatformGestureEvent& event) | 41 PassRefPtr<GestureEvent> GestureEvent::create(PassRefPtr<AbstractView> view, con
st PlatformGestureEvent& event) |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 { | 111 { |
113 } | 112 } |
114 | 113 |
115 GestureEvent* GestureEventDispatchMediator::event() const | 114 GestureEvent* GestureEventDispatchMediator::event() const |
116 { | 115 { |
117 return static_cast<GestureEvent*>(EventDispatchMediator::event()); | 116 return static_cast<GestureEvent*>(EventDispatchMediator::event()); |
118 } | 117 } |
119 | 118 |
120 bool GestureEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) co
nst | 119 bool GestureEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) co
nst |
121 { | 120 { |
122 if (dispatcher->node()->isElementNode() && toElement(dispatcher->node())->di
sabled()) | 121 if (dispatcher->node()->disabled()) |
123 return true; | 122 return true; |
124 | 123 |
125 dispatcher->dispatch(); | 124 dispatcher->dispatch(); |
126 ASSERT(!event()->defaultPrevented()); | 125 ASSERT(!event()->defaultPrevented()); |
127 return event()->defaultHandled() || event()->defaultPrevented(); | 126 return event()->defaultHandled() || event()->defaultPrevented(); |
128 } | 127 } |
129 | 128 |
130 } // namespace WebCore | 129 } // namespace WebCore |
131 | 130 |
132 #endif // ENABLE(GESTURE_EVENTS) | 131 #endif // ENABLE(GESTURE_EVENTS) |
OLD | NEW |