Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: Source/core/dom/Node.cpp

Issue 1144313003: Added PointerEvent firing on touch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed the gyp rule for nuked ThreadLocalEventNames.h Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #include "core/editing/htmlediting.h" 65 #include "core/editing/htmlediting.h"
66 #include "core/editing/markup.h" 66 #include "core/editing/markup.h"
67 #include "core/events/Event.h" 67 #include "core/events/Event.h"
68 #include "core/events/EventDispatchMediator.h" 68 #include "core/events/EventDispatchMediator.h"
69 #include "core/events/EventDispatcher.h" 69 #include "core/events/EventDispatcher.h"
70 #include "core/events/EventListener.h" 70 #include "core/events/EventListener.h"
71 #include "core/events/GestureEvent.h" 71 #include "core/events/GestureEvent.h"
72 #include "core/events/KeyboardEvent.h" 72 #include "core/events/KeyboardEvent.h"
73 #include "core/events/MouseEvent.h" 73 #include "core/events/MouseEvent.h"
74 #include "core/events/MutationEvent.h" 74 #include "core/events/MutationEvent.h"
75 #include "core/events/PointerEvent.h"
75 #include "core/events/TextEvent.h" 76 #include "core/events/TextEvent.h"
76 #include "core/events/TouchEvent.h" 77 #include "core/events/TouchEvent.h"
77 #include "core/events/UIEvent.h" 78 #include "core/events/UIEvent.h"
78 #include "core/events/WheelEvent.h" 79 #include "core/events/WheelEvent.h"
79 #include "core/frame/EventHandlerRegistry.h" 80 #include "core/frame/EventHandlerRegistry.h"
80 #include "core/frame/LocalDOMWindow.h" 81 #include "core/frame/LocalDOMWindow.h"
81 #include "core/frame/LocalFrame.h" 82 #include "core/frame/LocalFrame.h"
82 #include "core/frame/Settings.h" 83 #include "core/frame/Settings.h"
83 #include "core/html/HTMLAnchorElement.h" 84 #include "core/html/HTMLAnchorElement.h"
84 #include "core/html/HTMLDialogElement.h" 85 #include "core/html/HTMLDialogElement.h"
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after
2100 dispatchScopedEventDispatchMediator(EventDispatchMediator::create(event)); 2101 dispatchScopedEventDispatchMediator(EventDispatchMediator::create(event));
2101 } 2102 }
2102 2103
2103 void Node::dispatchScopedEventDispatchMediator(PassRefPtrWillBeRawPtr<EventDispa tchMediator> eventDispatchMediator) 2104 void Node::dispatchScopedEventDispatchMediator(PassRefPtrWillBeRawPtr<EventDispa tchMediator> eventDispatchMediator)
2104 { 2105 {
2105 EventDispatcher::dispatchScopedEvent(*this, eventDispatchMediator); 2106 EventDispatcher::dispatchScopedEvent(*this, eventDispatchMediator);
2106 } 2107 }
2107 2108
2108 bool Node::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) 2109 bool Node::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event)
2109 { 2110 {
2110 if (event->isMouseEvent()) 2111 // For a PointerEvent, MouseEvent or TouchEvent, the 'relatedTarget' propert y must be updated
2111 return EventDispatcher::dispatchEvent(*this, MouseEventDispatchMediator: :create(static_pointer_cast<MouseEvent>(event), MouseEventDispatchMediator::Synt heticMouseEvent)); 2112 // during dispatch. This generic dispatcher can't handle this.
Rick Byers 2015/06/11 04:14:56 Doesn't the Javascript EventTarget.dispatchEvent c
mustaq 2015/06/12 16:05:23 Good catch! Back to my first patch here.
2112 if (event->isTouchEvent()) 2113 RELEASE_ASSERT(!event->isPointerEvent() && !event->isMouseEvent() && !event- >isTouchEvent());
2113 return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event)); 2114
2114 return EventDispatcher::dispatchEvent(*this, EventDispatchMediator::create(e vent)); 2115 return EventDispatcher::dispatchEvent(*this, EventDispatchMediator::create(e vent));
2115 } 2116 }
2116 2117
2117 void Node::dispatchSubtreeModifiedEvent() 2118 void Node::dispatchSubtreeModifiedEvent()
2118 { 2119 {
2119 if (isInShadowTree()) 2120 if (isInShadowTree())
2120 return; 2121 return;
2121 2122
2122 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); 2123 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden());
2123 2124
(...skipping 29 matching lines...) Expand all
2153 if (!gestureEvent.get()) 2154 if (!gestureEvent.get())
2154 return false; 2155 return false;
2155 return EventDispatcher::dispatchEvent(*this, GestureEventDispatchMediator::c reate(gestureEvent)); 2156 return EventDispatcher::dispatchEvent(*this, GestureEventDispatchMediator::c reate(gestureEvent));
2156 } 2157 }
2157 2158
2158 bool Node::dispatchTouchEvent(PassRefPtrWillBeRawPtr<TouchEvent> event) 2159 bool Node::dispatchTouchEvent(PassRefPtrWillBeRawPtr<TouchEvent> event)
2159 { 2160 {
2160 return EventDispatcher::dispatchEvent(*this, TouchEventDispatchMediator::cre ate(event)); 2161 return EventDispatcher::dispatchEvent(*this, TouchEventDispatchMediator::cre ate(event));
2161 } 2162 }
2162 2163
2164 bool Node::dispatchPointerEvent(PassRefPtrWillBeRawPtr<PointerEvent> event)
2165 {
2166 return EventDispatcher::dispatchEvent(*this, PointerEventDispatchMediator::c reate(event));
2167 }
2168
2163 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve ntOptions eventOptions) 2169 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve ntOptions eventOptions)
2164 { 2170 {
2165 EventDispatcher::dispatchSimulatedClick(*this, underlyingEvent, eventOptions ); 2171 EventDispatcher::dispatchSimulatedClick(*this, underlyingEvent, eventOptions );
2166 } 2172 }
2167 2173
2168 bool Node::dispatchWheelEvent(const PlatformWheelEvent& event) 2174 bool Node::dispatchWheelEvent(const PlatformWheelEvent& event)
2169 { 2175 {
2170 return EventDispatcher::dispatchEvent(*this, WheelEventDispatchMediator::cre ate(event, document().domWindow())); 2176 return EventDispatcher::dispatchEvent(*this, WheelEventDispatchMediator::cre ate(event, document().domWindow()));
2171 } 2177 }
2172 2178
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
2501 2507
2502 void showNodePath(const blink::Node* node) 2508 void showNodePath(const blink::Node* node)
2503 { 2509 {
2504 if (node) 2510 if (node)
2505 node->showNodePathForThis(); 2511 node->showNodePathForThis();
2506 else 2512 else
2507 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2513 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2508 } 2514 }
2509 2515
2510 #endif 2516 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698