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

Side by Side Diff: Source/core/input/EventHandler.cpp

Issue 1177373002: Change API name and return type of findFocusableNode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: *recursively Created 5 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
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/page/FocusController.h » ('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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after
2094 if (element.shadowRoot() && element.shadowRoot()->delegatesFocus()) { 2094 if (element.shadowRoot() && element.shadowRoot()->delegatesFocus()) {
2095 Document* doc = m_frame->document(); 2095 Document* doc = m_frame->document();
2096 if (element.containsIncludingShadowDOM(doc->focusedElement())) { 2096 if (element.containsIncludingShadowDOM(doc->focusedElement())) {
2097 // If the inner element is already focused, do nothing. 2097 // If the inner element is already focused, do nothing.
2098 return true; 2098 return true;
2099 } 2099 }
2100 2100
2101 // If the host has a focusable inner element, focus it. Otherwise, the h ost takes focus. 2101 // If the host has a focusable inner element, focus it. Otherwise, the h ost takes focus.
2102 Page* page = m_frame->page(); 2102 Page* page = m_frame->page();
2103 ASSERT(page); 2103 ASSERT(page);
2104 Node* next = page->focusController().findFocusableNode(WebFocusTypeForwa rd, *element.shadowRoot()); 2104 Element* next = page->focusController().findFocusableElement(WebFocusTyp eForward, *element.shadowRoot());
2105 if (next && next->isElementNode() && element.containsIncludingShadowDOM( next)) { 2105 if (next && element.containsIncludingShadowDOM(next)) {
2106 // Use WebFocusTypeForward instead of WebFocusTypeMouse here to mean the focus has slided. 2106 // Use WebFocusTypeForward instead of WebFocusTypeMouse here to mean the focus has slided.
2107 toElement(next)->focus(false, WebFocusTypeForward); 2107 next->focus(false, WebFocusTypeForward);
2108 return true; 2108 return true;
2109 } 2109 }
2110 } 2110 }
2111 return false; 2111 return false;
2112 } 2112 }
2113 2113
2114 bool EventHandler::handleWheelEvent(const PlatformWheelEvent& event) 2114 bool EventHandler::handleWheelEvent(const PlatformWheelEvent& event)
2115 { 2115 {
2116 #define RETURN_WHEEL_EVENT_HANDLED() \ 2116 #define RETURN_WHEEL_EVENT_HANDLED() \
2117 { \ 2117 { \
(...skipping 2086 matching lines...) Expand 10 before | Expand all | Expand 10 after
4204 unsigned EventHandler::accessKeyModifiers() 4204 unsigned EventHandler::accessKeyModifiers()
4205 { 4205 {
4206 #if OS(MACOSX) 4206 #if OS(MACOSX)
4207 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4207 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4208 #else 4208 #else
4209 return PlatformEvent::AltKey; 4209 return PlatformEvent::AltKey;
4210 #endif 4210 #endif
4211 } 4211 }
4212 4212
4213 } // namespace blink 4213 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/page/FocusController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698