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

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

Issue 455223002: Make anchors mouse-focusable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase 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
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/events/EventDispatcher.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 #include "core/events/UIEvent.h" 74 #include "core/events/UIEvent.h"
75 #include "core/events/WheelEvent.h" 75 #include "core/events/WheelEvent.h"
76 #include "core/frame/EventHandlerRegistry.h" 76 #include "core/frame/EventHandlerRegistry.h"
77 #include "core/frame/LocalFrame.h" 77 #include "core/frame/LocalFrame.h"
78 #include "core/html/HTMLAnchorElement.h" 78 #include "core/html/HTMLAnchorElement.h"
79 #include "core/html/HTMLDialogElement.h" 79 #include "core/html/HTMLDialogElement.h"
80 #include "core/html/HTMLFrameOwnerElement.h" 80 #include "core/html/HTMLFrameOwnerElement.h"
81 #include "core/html/HTMLStyleElement.h" 81 #include "core/html/HTMLStyleElement.h"
82 #include "core/page/ContextMenuController.h" 82 #include "core/page/ContextMenuController.h"
83 #include "core/page/EventHandler.h" 83 #include "core/page/EventHandler.h"
84 #include "core/page/FocusController.h"
84 #include "core/page/Page.h" 85 #include "core/page/Page.h"
85 #include "core/frame/Settings.h" 86 #include "core/frame/Settings.h"
86 #include "core/rendering/FlowThreadController.h" 87 #include "core/rendering/FlowThreadController.h"
87 #include "core/rendering/RenderBox.h" 88 #include "core/rendering/RenderBox.h"
88 #include "core/svg/graphics/SVGImage.h" 89 #include "core/svg/graphics/SVGImage.h"
89 #include "platform/EventDispatchForbiddenScope.h" 90 #include "platform/EventDispatchForbiddenScope.h"
90 #include "platform/Partitions.h" 91 #include "platform/Partitions.h"
91 #include "platform/TraceEvent.h" 92 #include "platform/TraceEvent.h"
92 #include "platform/TracedValue.h" 93 #include "platform/TracedValue.h"
93 #include "wtf/HashSet.h" 94 #include "wtf/HashSet.h"
(...skipping 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 dispatchScopedEvent(Event::createBubble(EventTypeNames::input)); 2175 dispatchScopedEvent(Event::createBubble(EventTypeNames::input));
2175 } 2176 }
2176 2177
2177 void Node::defaultEventHandler(Event* event) 2178 void Node::defaultEventHandler(Event* event)
2178 { 2179 {
2179 if (event->target() != this) 2180 if (event->target() != this)
2180 return; 2181 return;
2181 const AtomicString& eventType = event->type(); 2182 const AtomicString& eventType = event->type();
2182 if (eventType == EventTypeNames::keydown || eventType == EventTypeNames::key press) { 2183 if (eventType == EventTypeNames::keydown || eventType == EventTypeNames::key press) {
2183 if (event->isKeyboardEvent()) { 2184 if (event->isKeyboardEvent()) {
2185 if (eventType == EventTypeNames::keydown) {
2186 if (Page* page = document().page()) {
2187 if (page->focusController().setWasFocusedByMouse(false) && r enderer())
2188 renderer()->setShouldDoFullPaintInvalidation(true);
2189 }
2190 }
robwu 2014/08/19 17:03:56 These lines are bugging me a little bit. Previousl
2184 if (LocalFrame* frame = document().frame()) 2191 if (LocalFrame* frame = document().frame())
2185 frame->eventHandler().defaultKeyboardEventHandler(toKeyboardEven t(event)); 2192 frame->eventHandler().defaultKeyboardEventHandler(toKeyboardEven t(event));
2186 } 2193 }
2187 } else if (eventType == EventTypeNames::click) { 2194 } else if (eventType == EventTypeNames::click) {
2188 int detail = event->isUIEvent() ? static_cast<UIEvent*>(event)->detail() : 0; 2195 int detail = event->isUIEvent() ? static_cast<UIEvent*>(event)->detail() : 0;
2189 if (dispatchDOMActivateEvent(detail, event)) 2196 if (dispatchDOMActivateEvent(detail, event))
2190 event->setDefaultHandled(); 2197 event->setDefaultHandled();
2191 } else if (eventType == EventTypeNames::contextmenu) { 2198 } else if (eventType == EventTypeNames::contextmenu) {
2192 if (Page* page = document().page()) 2199 if (Page* page = document().page())
2193 page->contextMenuController().handleContextMenuEvent(event); 2200 page->contextMenuController().handleContextMenuEvent(event);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2230 2237
2231 if (startNode && startNode->renderer()) { 2238 if (startNode && startNode->renderer()) {
2232 if (LocalFrame* frame = document().frame()) 2239 if (LocalFrame* frame = document().frame())
2233 frame->eventHandler().defaultWheelEventHandler(startNode, wheelE vent); 2240 frame->eventHandler().defaultWheelEventHandler(startNode, wheelE vent);
2234 } 2241 }
2235 } else if (event->type() == EventTypeNames::webkitEditableContentChanged) { 2242 } else if (event->type() == EventTypeNames::webkitEditableContentChanged) {
2236 dispatchInputEvent(); 2243 dispatchInputEvent();
2237 } 2244 }
2238 } 2245 }
2239 2246
2240 void Node::willCallDefaultEventHandler(const Event&)
2241 {
2242 }
2243
2244 bool Node::willRespondToMouseMoveEvents() 2247 bool Node::willRespondToMouseMoveEvents()
2245 { 2248 {
2246 if (isDisabledFormControl(this)) 2249 if (isDisabledFormControl(this))
2247 return false; 2250 return false;
2248 return hasEventListeners(EventTypeNames::mousemove) || hasEventListeners(Eve ntTypeNames::mouseover) || hasEventListeners(EventTypeNames::mouseout); 2251 return hasEventListeners(EventTypeNames::mousemove) || hasEventListeners(Eve ntTypeNames::mouseover) || hasEventListeners(EventTypeNames::mouseout);
2249 } 2252 }
2250 2253
2251 bool Node::willRespondToMouseClickEvents() 2254 bool Node::willRespondToMouseClickEvents()
2252 { 2255 {
2253 if (isDisabledFormControl(this)) 2256 if (isDisabledFormControl(this))
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 node->showTreeForThis(); 2485 node->showTreeForThis();
2483 } 2486 }
2484 2487
2485 void showNodePath(const blink::Node* node) 2488 void showNodePath(const blink::Node* node)
2486 { 2489 {
2487 if (node) 2490 if (node)
2488 node->showNodePathForThis(); 2491 node->showNodePathForThis();
2489 } 2492 }
2490 2493
2491 #endif 2494 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/events/EventDispatcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698