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

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

Issue 2491233002: Make UA DOMActivate events composed events (Closed)
Patch Set: wip Created 4 years, 1 month 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 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 #endif 2088 #endif
2089 2089
2090 if (!document().hasListenerType(Document::DOMSUBTREEMODIFIED_LISTENER)) 2090 if (!document().hasListenerType(Document::DOMSUBTREEMODIFIED_LISTENER))
2091 return; 2091 return;
2092 2092
2093 dispatchScopedEvent( 2093 dispatchScopedEvent(
2094 MutationEvent::create(EventTypeNames::DOMSubtreeModified, true)); 2094 MutationEvent::create(EventTypeNames::DOMSubtreeModified, true));
2095 } 2095 }
2096 2096
2097 DispatchEventResult Node::dispatchDOMActivateEvent(int detail, 2097 DispatchEventResult Node::dispatchDOMActivateEvent(int detail,
2098 Event* underlyingEvent) { 2098 Event& underlyingEvent) {
2099 #if DCHECK_IS_ON() 2099 #if DCHECK_IS_ON()
2100 DCHECK(!EventDispatchForbiddenScope::isEventDispatchForbidden()); 2100 DCHECK(!EventDispatchForbiddenScope::isEventDispatchForbidden());
2101 #endif 2101 #endif
2102 UIEvent* event = UIEvent::create(); 2102 UIEvent* event = UIEvent::create();
2103 event->initUIEvent(EventTypeNames::DOMActivate, true, true, 2103 event->initUIEvent(EventTypeNames::DOMActivate, true, true,
2104 document().domWindow(), detail); 2104 document().domWindow(), detail);
2105 event->setUnderlyingEvent(underlyingEvent); 2105 event->setUnderlyingEvent(&underlyingEvent);
2106 event->setComposed(underlyingEvent.composed());
2106 dispatchScopedEvent(event); 2107 dispatchScopedEvent(event);
2107 2108
2108 // TODO(dtapuska): Dispatching scoped events shouldn't check the return 2109 // TODO(dtapuska): Dispatching scoped events shouldn't check the return
2109 // type because the scoped event could get put off in the delayed queue. 2110 // type because the scoped event could get put off in the delayed queue.
2110 return EventTarget::dispatchEventResult(*event); 2111 return EventTarget::dispatchEventResult(*event);
2111 } 2112 }
2112 2113
2113 DispatchEventResult Node::dispatchMouseEvent( 2114 DispatchEventResult Node::dispatchMouseEvent(
2114 const PlatformMouseEvent& nativeEvent, 2115 const PlatformMouseEvent& nativeEvent,
2115 const AtomicString& eventType, 2116 const AtomicString& eventType,
(...skipping 23 matching lines...) Expand all
2139 if (eventType == EventTypeNames::keydown || 2140 if (eventType == EventTypeNames::keydown ||
2140 eventType == EventTypeNames::keypress) { 2141 eventType == EventTypeNames::keypress) {
2141 if (event->isKeyboardEvent()) { 2142 if (event->isKeyboardEvent()) {
2142 if (LocalFrame* frame = document().frame()) 2143 if (LocalFrame* frame = document().frame())
2143 frame->eventHandler().defaultKeyboardEventHandler( 2144 frame->eventHandler().defaultKeyboardEventHandler(
2144 toKeyboardEvent(event)); 2145 toKeyboardEvent(event));
2145 } 2146 }
2146 } else if (eventType == EventTypeNames::click) { 2147 } else if (eventType == EventTypeNames::click) {
2147 int detail = 2148 int detail =
2148 event->isUIEvent() ? static_cast<UIEvent*>(event)->detail() : 0; 2149 event->isUIEvent() ? static_cast<UIEvent*>(event)->detail() : 0;
2149 if (dispatchDOMActivateEvent(detail, event) != 2150 if (dispatchDOMActivateEvent(detail, *event) !=
2150 DispatchEventResult::NotCanceled) 2151 DispatchEventResult::NotCanceled)
2151 event->setDefaultHandled(); 2152 event->setDefaultHandled();
2152 } else if (eventType == EventTypeNames::contextmenu) { 2153 } else if (eventType == EventTypeNames::contextmenu) {
2153 if (Page* page = document().page()) 2154 if (Page* page = document().page())
2154 page->contextMenuController().handleContextMenuEvent(event); 2155 page->contextMenuController().handleContextMenuEvent(event);
2155 } else if (eventType == EventTypeNames::textInput) { 2156 } else if (eventType == EventTypeNames::textInput) {
2156 if (event->hasInterface(EventNames::TextEvent)) { 2157 if (event->hasInterface(EventNames::TextEvent)) {
2157 if (LocalFrame* frame = document().frame()) 2158 if (LocalFrame* frame = document().frame())
2158 frame->eventHandler().defaultTextInputEventHandler(toTextEvent(event)); 2159 frame->eventHandler().defaultTextInputEventHandler(toTextEvent(event));
2159 } 2160 }
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
2490 if (node) { 2491 if (node) {
2491 std::stringstream stream; 2492 std::stringstream stream;
2492 node->printNodePathTo(stream); 2493 node->printNodePathTo(stream);
2493 LOG(INFO) << stream.str(); 2494 LOG(INFO) << stream.str();
2494 } else { 2495 } else {
2495 LOG(INFO) << "Cannot showNodePath for <null>"; 2496 LOG(INFO) << "Cannot showNodePath for <null>";
2496 } 2497 }
2497 } 2498 }
2498 2499
2499 #endif 2500 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/events/Event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698