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

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

Issue 16194013: Mouse press should focus on any types of form controls. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase, common->default, etc. Created 7 years, 6 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 | Annotate | Revision Log
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 m_event->setEventPhase(0); 193 m_event->setEventPhase(0);
194 194
195 // Pass the data from the preDispatchEventHandler to the postDispatchEventHa ndler. 195 // Pass the data from the preDispatchEventHandler to the postDispatchEventHa ndler.
196 m_node->postDispatchEventHandler(m_event.get(), preDispatchEventHandlerResul t); 196 m_node->postDispatchEventHandler(m_event.get(), preDispatchEventHandlerResul t);
197 197
198 // Call default event handlers. While the DOM does have a concept of prevent ing 198 // Call default event handlers. While the DOM does have a concept of prevent ing
199 // default handling, the detail of which handlers are called is an internal 199 // default handling, the detail of which handlers are called is an internal
200 // implementation detail and not part of the DOM. 200 // implementation detail and not part of the DOM.
201 if (!m_event->defaultPrevented() && !m_event->defaultHandled()) { 201 if (!m_event->defaultPrevented() && !m_event->defaultHandled()) {
202 // Non-bubbling events call only one default event handler, the one for the target. 202 // Non-bubbling events call only one default event handler, the one for the target.
203 m_node->willCallDefaultEventHandler(*m_event);
203 m_node->defaultEventHandler(m_event.get()); 204 m_node->defaultEventHandler(m_event.get());
204 ASSERT(!m_event->defaultPrevented()); 205 ASSERT(!m_event->defaultPrevented());
205 if (m_event->defaultHandled()) 206 if (m_event->defaultHandled())
206 return; 207 return;
207 // For bubbling events, call default event handlers on the same targets in the 208 // For bubbling events, call default event handlers on the same targets in the
208 // same order as the bubbling phase. 209 // same order as the bubbling phase.
209 if (m_event->bubbles()) { 210 if (m_event->bubbles()) {
210 size_t size = m_event->eventPath().size(); 211 size_t size = m_event->eventPath().size();
211 for (size_t i = 1; i < size; ++i) { 212 for (size_t i = 1; i < size; ++i) {
213 m_event->eventPath()[i]->node()->willCallDefaultEventHandler(*m_ event);
212 m_event->eventPath()[i]->node()->defaultEventHandler(m_event.get ()); 214 m_event->eventPath()[i]->node()->defaultEventHandler(m_event.get ());
213 ASSERT(!m_event->defaultPrevented()); 215 ASSERT(!m_event->defaultPrevented());
214 if (m_event->defaultHandled()) 216 if (m_event->defaultHandled())
215 return; 217 return;
216 } 218 }
217 } 219 }
218 } 220 }
219 } 221 }
220 222
221 const EventContext* EventDispatcher::topEventContext() 223 const EventContext* EventDispatcher::topEventContext()
222 { 224 {
223 return m_event->eventPath().isEmpty() ? 0 : m_event->eventPath().last().get( ); 225 return m_event->eventPath().isEmpty() ? 0 : m_event->eventPath().last().get( );
224 } 226 }
225 227
226 } 228 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698