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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 #include "core/dom/shadow/FlatTreeTraversal.h" | 58 #include "core/dom/shadow/FlatTreeTraversal.h" |
59 #include "core/dom/shadow/InsertionPoint.h" | 59 #include "core/dom/shadow/InsertionPoint.h" |
60 #include "core/dom/shadow/ShadowRoot.h" | 60 #include "core/dom/shadow/ShadowRoot.h" |
61 #include "core/editing/EditingUtilities.h" | 61 #include "core/editing/EditingUtilities.h" |
62 #include "core/editing/markers/DocumentMarkerController.h" | 62 #include "core/editing/markers/DocumentMarkerController.h" |
63 #include "core/events/Event.h" | 63 #include "core/events/Event.h" |
64 #include "core/events/EventDispatchMediator.h" | 64 #include "core/events/EventDispatchMediator.h" |
65 #include "core/events/EventDispatcher.h" | 65 #include "core/events/EventDispatcher.h" |
66 #include "core/events/EventListener.h" | 66 #include "core/events/EventListener.h" |
67 #include "core/events/GestureEvent.h" | 67 #include "core/events/GestureEvent.h" |
68 #include "core/events/InputEvent.h" | |
68 #include "core/events/KeyboardEvent.h" | 69 #include "core/events/KeyboardEvent.h" |
69 #include "core/events/MouseEvent.h" | 70 #include "core/events/MouseEvent.h" |
70 #include "core/events/MutationEvent.h" | 71 #include "core/events/MutationEvent.h" |
71 #include "core/events/PointerEvent.h" | 72 #include "core/events/PointerEvent.h" |
72 #include "core/events/TextEvent.h" | 73 #include "core/events/TextEvent.h" |
73 #include "core/events/TouchEvent.h" | 74 #include "core/events/TouchEvent.h" |
74 #include "core/events/UIEvent.h" | 75 #include "core/events/UIEvent.h" |
75 #include "core/events/WheelEvent.h" | 76 #include "core/events/WheelEvent.h" |
76 #include "core/frame/EventHandlerRegistry.h" | 77 #include "core/frame/EventHandlerRegistry.h" |
77 #include "core/frame/LocalDOMWindow.h" | 78 #include "core/frame/LocalDOMWindow.h" |
(...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2070 return dispatchEvent(event); | 2071 return dispatchEvent(event); |
2071 } | 2072 } |
2072 | 2073 |
2073 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve ntOptions eventOptions, SimulatedClickCreationScope scope) | 2074 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve ntOptions eventOptions, SimulatedClickCreationScope scope) |
2074 { | 2075 { |
2075 EventDispatcher::dispatchSimulatedClick(*this, underlyingEvent, eventOptions , scope); | 2076 EventDispatcher::dispatchSimulatedClick(*this, underlyingEvent, eventOptions , scope); |
2076 } | 2077 } |
2077 | 2078 |
2078 void Node::dispatchInputEvent() | 2079 void Node::dispatchInputEvent() |
2079 { | 2080 { |
2080 dispatchScopedEvent(Event::createBubble(EventTypeNames::input)); | 2081 InputEventInit eventInitDict; |
2082 eventInitDict.setBubbles(true); | |
2083 dispatchScopedEvent(InputEvent::create(EventTypeNames::input, eventInitDict) ); | |
chongz
2016/02/09 15:35:59
Do we prefer dictionary constructor or classic one
dtapuska
2016/02/09 15:49:11
this is fine I think; less code is often better. I
| |
2081 } | 2084 } |
2082 | 2085 |
2083 void Node::defaultEventHandler(Event* event) | 2086 void Node::defaultEventHandler(Event* event) |
2084 { | 2087 { |
2085 if (event->target() != this) | 2088 if (event->target() != this) |
2086 return; | 2089 return; |
2087 const AtomicString& eventType = event->type(); | 2090 const AtomicString& eventType = event->type(); |
2088 if (eventType == EventTypeNames::keydown || eventType == EventTypeNames::key press) { | 2091 if (eventType == EventTypeNames::keydown || eventType == EventTypeNames::key press) { |
2089 if (event->isKeyboardEvent()) { | 2092 if (event->isKeyboardEvent()) { |
2090 if (LocalFrame* frame = document().frame()) | 2093 if (LocalFrame* frame = document().frame()) |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2425 | 2428 |
2426 void showNodePath(const blink::Node* node) | 2429 void showNodePath(const blink::Node* node) |
2427 { | 2430 { |
2428 if (node) | 2431 if (node) |
2429 node->showNodePathForThis(); | 2432 node->showNodePathForThis(); |
2430 else | 2433 else |
2431 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2434 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
2432 } | 2435 } |
2433 | 2436 |
2434 #endif | 2437 #endif |
OLD | NEW |