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

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

Issue 1463823003: Return a enumeration of the state of handling of InputEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after
2000 2000
2001 bool Node::dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> un derlyingEvent) 2001 bool Node::dispatchDOMActivateEvent(int detail, PassRefPtrWillBeRawPtr<Event> un derlyingEvent)
2002 { 2002 {
2003 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); 2003 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden());
2004 RefPtrWillBeRawPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActiv ate, true, true, document().domWindow(), detail); 2004 RefPtrWillBeRawPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActiv ate, true, true, document().domWindow(), detail);
2005 event->setUnderlyingEvent(underlyingEvent); 2005 event->setUnderlyingEvent(underlyingEvent);
2006 dispatchScopedEvent(event); 2006 dispatchScopedEvent(event);
2007 return event->defaultHandled(); 2007 return event->defaultHandled();
2008 } 2008 }
2009 2009
2010 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& nativeEvent)
2011 {
2012 return dispatchEvent(KeyboardEvent::create(nativeEvent, document().domWindow ()));
2013 }
2014
2015 bool Node::dispatchMouseEvent(const PlatformMouseEvent& nativeEvent, const Atomi cString& eventType, 2010 bool Node::dispatchMouseEvent(const PlatformMouseEvent& nativeEvent, const Atomi cString& eventType,
2016 int detail, Node* relatedTarget) 2011 int detail, Node* relatedTarget)
2017 { 2012 {
2018 RefPtrWillBeRawPtr<MouseEvent> event = MouseEvent::create(eventType, documen t().domWindow(), nativeEvent, detail, relatedTarget); 2013 RefPtrWillBeRawPtr<MouseEvent> event = MouseEvent::create(eventType, documen t().domWindow(), nativeEvent, detail, relatedTarget);
2019 return dispatchEvent(event); 2014 return dispatchEvent(event);
2020 } 2015 }
2021 2016
2022 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event)
2023 {
2024 RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(documen t().domWindow(), event);
2025 if (!gestureEvent.get())
2026 return false;
2027 return dispatchEvent(gestureEvent);
2028 }
2029
2030 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve ntOptions eventOptions, SimulatedClickCreationScope scope) 2017 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve ntOptions eventOptions, SimulatedClickCreationScope scope)
2031 { 2018 {
2032 EventDispatcher::dispatchSimulatedClick(*this, underlyingEvent, eventOptions , scope); 2019 EventDispatcher::dispatchSimulatedClick(*this, underlyingEvent, eventOptions , scope);
2033 } 2020 }
2034 2021
2035 bool Node::dispatchWheelEvent(const PlatformWheelEvent& event)
2036 {
2037 return dispatchEvent(WheelEvent::create(event, document().domWindow()));
2038 }
2039
2040 void Node::dispatchInputEvent() 2022 void Node::dispatchInputEvent()
2041 { 2023 {
2042 dispatchScopedEvent(Event::createBubble(EventTypeNames::input)); 2024 dispatchScopedEvent(Event::createBubble(EventTypeNames::input));
2043 } 2025 }
2044 2026
2045 void Node::defaultEventHandler(Event* event) 2027 void Node::defaultEventHandler(Event* event)
2046 { 2028 {
2047 if (event->target() != this) 2029 if (event->target() != this)
2048 return; 2030 return;
2049 const AtomicString& eventType = event->type(); 2031 const AtomicString& eventType = event->type();
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
2369 2351
2370 void showNodePath(const blink::Node* node) 2352 void showNodePath(const blink::Node* node)
2371 { 2353 {
2372 if (node) 2354 if (node)
2373 node->showNodePathForThis(); 2355 node->showNodePathForThis();
2374 else 2356 else
2375 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2357 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2376 } 2358 }
2377 2359
2378 #endif 2360 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698