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

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

Issue 1704333002: Do not use Node in FocusController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split a CL Created 4 years, 10 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
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 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1709 if (element.authorShadowRoot() && element.authorShadowRoot()->delegatesFocus ()) { 1709 if (element.authorShadowRoot() && element.authorShadowRoot()->delegatesFocus ()) {
1710 Document* doc = m_frame->document(); 1710 Document* doc = m_frame->document();
1711 if (element.containsIncludingShadowDOM(doc->focusedElement())) { 1711 if (element.containsIncludingShadowDOM(doc->focusedElement())) {
1712 // If the inner element is already focused, do nothing. 1712 // If the inner element is already focused, do nothing.
1713 return true; 1713 return true;
1714 } 1714 }
1715 1715
1716 // If the host has a focusable inner element, focus it. Otherwise, the h ost takes focus. 1716 // If the host has a focusable inner element, focus it. Otherwise, the h ost takes focus.
1717 Page* page = m_frame->page(); 1717 Page* page = m_frame->page();
1718 ASSERT(page); 1718 ASSERT(page);
1719 Element* next = page->focusController().findFocusableElement(WebFocusTyp eForward, *element.authorShadowRoot()); 1719 Element* found = page->focusController().findFocusableElementInShadowHos t(element);
1720 if (next && element.containsIncludingShadowDOM(next)) { 1720 if (found && element.containsIncludingShadowDOM(found)) {
1721 // Use WebFocusTypeForward instead of WebFocusTypeMouse here to mean the focus has slided. 1721 // Use WebFocusTypeForward instead of WebFocusTypeMouse here to mean the focus has slided.
1722 next->focus(FocusParams(SelectionBehaviorOnFocus::Reset, WebFocusTyp eForward, nullptr)); 1722 found->focus(FocusParams(SelectionBehaviorOnFocus::Reset, WebFocusTy peForward, nullptr));
1723 return true; 1723 return true;
1724 } 1724 }
1725 } 1725 }
1726 return false; 1726 return false;
1727 } 1727 }
1728 1728
1729 namespace { 1729 namespace {
1730 1730
1731 ScrollResult scrollAreaWithWheelEvent(const PlatformWheelEvent& event, Scrollabl eArea& scrollableArea) 1731 ScrollResult scrollAreaWithWheelEvent(const PlatformWheelEvent& event, Scrollabl eArea& scrollableArea)
1732 { 1732 {
(...skipping 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after
3974 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() 3974 PlatformEvent::Modifiers EventHandler::accessKeyModifiers()
3975 { 3975 {
3976 #if OS(MACOSX) 3976 #if OS(MACOSX)
3977 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); 3977 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
3978 #else 3978 #else
3979 return PlatformEvent::AltKey; 3979 return PlatformEvent::AltKey;
3980 #endif 3980 #endif
3981 } 3981 }
3982 3982
3983 } // namespace blink 3983 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/page/FocusController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698