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

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

Issue 1152623012: WIP: delegatesFocus (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/page/EventHandler.h ('k') | Source/core/page/FocusController.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) 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 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after
2081 if (!page->focusController().setFocusedElement(0, m_frame)) 2081 if (!page->focusController().setFocusedElement(0, m_frame))
2082 return true; 2082 return true;
2083 } 2083 }
2084 } 2084 }
2085 2085
2086 return false; 2086 return false;
2087 } 2087 }
2088 2088
2089 bool EventHandler::slideFocusOnShadowHostIfNecessary(const Element& element) 2089 bool EventHandler::slideFocusOnShadowHostIfNecessary(const Element& element)
2090 { 2090 {
2091 if (element.shadowRoot() && !element.tabStop()) { 2091 if (element.shadowRoot() && element.shadowRoot()->delegatesFocus()) {
2092 Document* doc = m_frame->document(); 2092 Document* doc = m_frame->document();
2093 if (element.containsIncludingShadowDOM(doc->focusedElement())) { 2093 if (element.containsIncludingShadowDOM(doc->focusedElement())) {
2094 // If the inner element is already focused, do nothing. 2094 // If the inner element is already focused, do nothing.
2095 return true; 2095 return true;
2096 } 2096 }
2097 2097
2098 // If the host has a focusable inner element, focus it. Otherwise, the h ost takes focus. 2098 // If the host has a focusable inner element, focus it. Otherwise, the h ost takes focus.
2099 Page* page = m_frame->page(); 2099 Page* page = m_frame->page();
2100 ASSERT(page); 2100 ASSERT(page);
2101 Node* next = page->focusController().findFocusableNode(WebFocusTypeForwa rd, *element.shadowRoot()); 2101 Node* next = page->focusController().findFocusableNode(WebFocusTypeForwa rd, *element.shadowRoot());
(...skipping 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after
4170 unsigned EventHandler::accessKeyModifiers() 4170 unsigned EventHandler::accessKeyModifiers()
4171 { 4171 {
4172 #if OS(MACOSX) 4172 #if OS(MACOSX)
4173 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4173 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4174 #else 4174 #else
4175 return PlatformEvent::AltKey; 4175 return PlatformEvent::AltKey;
4176 #endif 4176 #endif
4177 } 4177 }
4178 4178
4179 } // namespace blink 4179 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/EventHandler.h ('k') | Source/core/page/FocusController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698