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

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

Issue 1433103002: Use FocusParams in FocusController::setFocusedElement and Document::setFocusedElement arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1800 if (!element && targetedEvent.hitTestResult().scrollbar()) 1800 if (!element && targetedEvent.hitTestResult().scrollbar())
1801 return true; 1801 return true;
1802 1802
1803 if (Page* page = m_frame->page()) { 1803 if (Page* page = m_frame->page()) {
1804 // If focus shift is blocked, we eat the event. Note we should never 1804 // If focus shift is blocked, we eat the event. Note we should never
1805 // clear swallowEvent if the page already set it (e.g., by canceling 1805 // clear swallowEvent if the page already set it (e.g., by canceling
1806 // default behavior). 1806 // default behavior).
1807 if (element) { 1807 if (element) {
1808 if (slideFocusOnShadowHostIfNecessary(*element)) 1808 if (slideFocusOnShadowHostIfNecessary(*element))
1809 return true; 1809 return true;
1810 if (!page->focusController().setFocusedElement(element, m_frame, Web FocusTypeMouse, sourceCapabilities)) 1810 if (!page->focusController().setFocusedElement(element, m_frame, Foc usParams(SelectionBehaviorOnFocus::None, WebFocusTypeMouse, sourceCapabilities)) )
1811 return true; 1811 return true;
1812 } else { 1812 } else {
1813 // We call setFocusedElement even with !element in order to blur 1813 // We call setFocusedElement even with !element in order to blur
1814 // current focus element when a link is clicked; this is expected by 1814 // current focus element when a link is clicked; this is expected by
1815 // some sites that rely on onChange handlers running from form 1815 // some sites that rely on onChange handlers running from form
1816 // fields before the button click is processed. 1816 // fields before the button click is processed.
1817 if (!page->focusController().setFocusedElement(0, m_frame, WebFocusT ypeNone, sourceCapabilities)) 1817 if (!page->focusController().setFocusedElement(nullptr, m_frame, Foc usParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, sourceCapabilities)))
1818 return true; 1818 return true;
1819 } 1819 }
1820 } 1820 }
1821 1821
1822 return false; 1822 return false;
1823 } 1823 }
1824 1824
1825 bool EventHandler::slideFocusOnShadowHostIfNecessary(const Element& element) 1825 bool EventHandler::slideFocusOnShadowHostIfNecessary(const Element& element)
1826 { 1826 {
1827 if (element.authorShadowRoot() && element.authorShadowRoot()->delegatesFocus ()) { 1827 if (element.authorShadowRoot() && element.authorShadowRoot()->delegatesFocus ()) {
(...skipping 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after
4087 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() 4087 PlatformEvent::Modifiers EventHandler::accessKeyModifiers()
4088 { 4088 {
4089 #if OS(MACOSX) 4089 #if OS(MACOSX)
4090 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); 4090 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
4091 #else 4091 #else
4092 return PlatformEvent::AltKey; 4092 return PlatformEvent::AltKey;
4093 #endif 4093 #endif
4094 } 4094 }
4095 4095
4096 } // namespace blink 4096 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/RadioInputType.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