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

Side by Side Diff: Source/core/events/EventDispatcher.cpp

Issue 455223002: Make anchors mouse-focusable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: De-duplicate using FocusController; update TestExpectations Created 6 years, 4 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 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 m_event->setEventPhase(0); 201 m_event->setEventPhase(0);
202 202
203 // Pass the data from the preDispatchEventHandler to the postDispatchEventHa ndler. 203 // Pass the data from the preDispatchEventHandler to the postDispatchEventHa ndler.
204 m_node->postDispatchEventHandler(m_event.get(), preDispatchEventHandlerResul t); 204 m_node->postDispatchEventHandler(m_event.get(), preDispatchEventHandlerResul t);
205 205
206 // Call default event handlers. While the DOM does have a concept of prevent ing 206 // Call default event handlers. While the DOM does have a concept of prevent ing
207 // default handling, the detail of which handlers are called is an internal 207 // default handling, the detail of which handlers are called is an internal
208 // implementation detail and not part of the DOM. 208 // implementation detail and not part of the DOM.
209 if (!m_event->defaultPrevented() && !m_event->defaultHandled()) { 209 if (!m_event->defaultPrevented() && !m_event->defaultHandled()) {
210 // Non-bubbling events call only one default event handler, the one for the target. 210 // Non-bubbling events call only one default event handler, the one for the target.
211 m_node->willCallDefaultEventHandler(*m_event);
212 m_node->defaultEventHandler(m_event.get()); 211 m_node->defaultEventHandler(m_event.get());
213 ASSERT(!m_event->defaultPrevented()); 212 ASSERT(!m_event->defaultPrevented());
214 if (m_event->defaultHandled()) 213 if (m_event->defaultHandled())
215 return; 214 return;
216 // For bubbling events, call default event handlers on the same targets in the 215 // For bubbling events, call default event handlers on the same targets in the
217 // same order as the bubbling phase. 216 // same order as the bubbling phase.
218 if (m_event->bubbles()) { 217 if (m_event->bubbles()) {
219 size_t size = m_event->eventPath().size(); 218 size_t size = m_event->eventPath().size();
220 for (size_t i = 1; i < size; ++i) { 219 for (size_t i = 1; i < size; ++i) {
221 m_event->eventPath()[i].node()->willCallDefaultEventHandler(*m_e vent);
222 m_event->eventPath()[i].node()->defaultEventHandler(m_event.get( )); 220 m_event->eventPath()[i].node()->defaultEventHandler(m_event.get( ));
223 ASSERT(!m_event->defaultPrevented()); 221 ASSERT(!m_event->defaultPrevented());
224 if (m_event->defaultHandled()) 222 if (m_event->defaultHandled())
225 return; 223 return;
226 } 224 }
227 } 225 }
228 } 226 }
229 } 227 }
230 228
231 const NodeEventContext* EventDispatcher::topNodeEventContext() 229 const NodeEventContext* EventDispatcher::topNodeEventContext()
232 { 230 {
233 return m_event->eventPath().isEmpty() ? 0 : &m_event->eventPath().last(); 231 return m_event->eventPath().isEmpty() ? 0 : &m_event->eventPath().last();
234 } 232 }
235 233
236 } 234 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698