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

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 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 m_event->setEventPhase(0); 192 m_event->setEventPhase(0);
193 193
194 // Pass the data from the preDispatchEventHandler to the postDispatchEventHa ndler. 194 // Pass the data from the preDispatchEventHandler to the postDispatchEventHa ndler.
195 m_node->postDispatchEventHandler(m_event.get(), preDispatchEventHandlerResul t); 195 m_node->postDispatchEventHandler(m_event.get(), preDispatchEventHandlerResul t);
196 196
197 // Call default event handlers. While the DOM does have a concept of prevent ing 197 // Call default event handlers. While the DOM does have a concept of prevent ing
198 // default handling, the detail of which handlers are called is an internal 198 // default handling, the detail of which handlers are called is an internal
199 // implementation detail and not part of the DOM. 199 // implementation detail and not part of the DOM.
200 if (!m_event->defaultPrevented() && !m_event->defaultHandled()) { 200 if (!m_event->defaultPrevented() && !m_event->defaultHandled()) {
201 // Non-bubbling events call only one default event handler, the one for the target. 201 // Non-bubbling events call only one default event handler, the one for the target.
202 m_node->willCallDefaultEventHandler(*m_event);
202 m_node->defaultEventHandler(m_event.get()); 203 m_node->defaultEventHandler(m_event.get());
203 ASSERT(!m_event->defaultPrevented()); 204 ASSERT(!m_event->defaultPrevented());
204 if (m_event->defaultHandled()) 205 if (m_event->defaultHandled())
205 return; 206 return;
206 // For bubbling events, call default event handlers on the same targets in the 207 // For bubbling events, call default event handlers on the same targets in the
207 // same order as the bubbling phase. 208 // same order as the bubbling phase.
208 if (m_event->bubbles()) { 209 if (m_event->bubbles()) {
209 size_t size = m_event->eventPath().size(); 210 size_t size = m_event->eventPath().size();
210 for (size_t i = 1; i < size; ++i) { 211 for (size_t i = 1; i < size; ++i) {
212 m_event->eventPath()[i]->node()->willCallDefaultEventHandler(*m_ event);
211 m_event->eventPath()[i]->node()->defaultEventHandler(m_event.get ()); 213 m_event->eventPath()[i]->node()->defaultEventHandler(m_event.get ());
212 ASSERT(!m_event->defaultPrevented()); 214 ASSERT(!m_event->defaultPrevented());
213 if (m_event->defaultHandled()) 215 if (m_event->defaultHandled())
214 return; 216 return;
215 } 217 }
216 } 218 }
217 } 219 }
218 } 220 }
219 221
220 const EventContext* EventDispatcher::topEventContext() 222 const EventContext* EventDispatcher::topEventContext()
221 { 223 {
222 return m_event->eventPath().isEmpty() ? 0 : m_event->eventPath().last().get( ); 224 return m_event->eventPath().isEmpty() ? 0 : m_event->eventPath().last().get( );
223 } 225 }
224 226
225 } 227 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/submit/submit-focus-by-mouse-then-keydown-expected.html ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698