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

Unified Diff: sky/engine/core/dom/Node.cpp

Issue 870073003: Remove mouse events from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: sky/engine/core/dom/Node.cpp
diff --git a/sky/engine/core/dom/Node.cpp b/sky/engine/core/dom/Node.cpp
index 4bb54e7f4b94ea9717224b0a4f1f628956d69cfc..4e75b3c9a2a684b860df22515520796c10ff1ce5 100644
--- a/sky/engine/core/dom/Node.cpp
+++ b/sky/engine/core/dom/Node.cpp
@@ -61,11 +61,9 @@
#include "sky/engine/core/events/EventListener.h"
#include "sky/engine/core/events/GestureEvent.h"
#include "sky/engine/core/events/KeyboardEvent.h"
-#include "sky/engine/core/events/MouseEvent.h"
#include "sky/engine/core/events/TextEvent.h"
#include "sky/engine/core/events/TouchEvent.h"
#include "sky/engine/core/events/UIEvent.h"
-#include "sky/engine/core/events/WheelEvent.h"
#include "sky/engine/core/frame/LocalFrame.h"
#include "sky/engine/core/frame/Settings.h"
#include "sky/engine/core/html/HTMLAnchorElement.h"
@@ -1455,8 +1453,6 @@ void Node::dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator>
bool Node::dispatchEvent(PassRefPtr<Event> event)
{
- if (event->isMouseEvent())
- return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::create(static_pointer_cast<MouseEvent>(event), MouseEventDispatchMediator::SyntheticMouseEvent));
if (event->isTouchEvent())
return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event));
return EventDispatcher::dispatchEvent(this, EventDispatchMediator::create(event));
@@ -1476,12 +1472,6 @@ bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& event)
return EventDispatcher::dispatchEvent(this, KeyboardEventDispatchMediator::create(KeyboardEvent::create(event, document().domWindow())));
}
-bool Node::dispatchMouseEvent(const PlatformMouseEvent& event, const AtomicString& eventType,
- int detail, Node* relatedTarget)
-{
- return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::create(MouseEvent::create(eventType, document().domWindow(), event, detail, relatedTarget)));
-}
-
bool Node::dispatchGestureEvent(const PlatformGestureEvent& event)
{
RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document().domWindow(), event);
@@ -1495,16 +1485,6 @@ bool Node::dispatchTouchEvent(PassRefPtr<TouchEvent> event)
return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::create(event));
}
-void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEventOptions eventOptions)
-{
- EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, eventOptions);
-}
-
-bool Node::dispatchWheelEvent(const PlatformWheelEvent& event)
-{
- return EventDispatcher::dispatchEvent(this, WheelEventDispatchMediator::create(event, document().domWindow()));
-}
-
void Node::dispatchInputEvent()
{
dispatchScopedEvent(Event::createBubble(EventTypeNames::input));
@@ -1529,19 +1509,6 @@ void Node::defaultEventHandler(Event* event)
if (LocalFrame* frame = document().frame())
frame->eventHandler().defaultTextInputEventHandler(toTextEvent(event));
}
- } else if ((eventType == EventTypeNames::wheel || eventType == EventTypeNames::mousewheel) && event->hasInterface(EventNames::WheelEvent)) {
- WheelEvent* wheelEvent = toWheelEvent(event);
-
- // If we don't have a renderer, send the wheel event to the first node we find with a renderer.
- // This is needed for <option> and <optgroup> elements so that <select>s get a wheel scroll.
- Node* startNode = this;
- while (startNode && !startNode->renderer())
- startNode = startNode->parentOrShadowHostNode();
-
- if (startNode && startNode->renderer()) {
- if (LocalFrame* frame = document().frame())
- frame->eventHandler().defaultWheelEventHandler(startNode, wheelEvent);
- }
} else if (event->type() == EventTypeNames::webkitEditableContentChanged) {
dispatchInputEvent();
}

Powered by Google App Engine
This is Rietveld 408576698