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

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

Issue 1313183006: Dont blur currently focused element on clicking scrollbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 2 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 | « no previous file | no next file » | 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 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 // The return value means 'continue default handling.' 1625 // The return value means 'continue default handling.'
1626 bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe tNode, int clickCount, const PlatformMouseEvent& mouseEvent) 1626 bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe tNode, int clickCount, const PlatformMouseEvent& mouseEvent)
1627 { 1627 {
1628 updateMouseEventTargetNode(targetNode, mouseEvent); 1628 updateMouseEventTargetNode(targetNode, mouseEvent);
1629 return !m_nodeUnderMouse || m_nodeUnderMouse->dispatchMouseEvent(mouseEvent, eventType, clickCount); 1629 return !m_nodeUnderMouse || m_nodeUnderMouse->dispatchMouseEvent(mouseEvent, eventType, clickCount);
1630 } 1630 }
1631 1631
1632 // The return value means 'swallow event' (was handled), as for other handle* fu nctions. 1632 // The return value means 'swallow event' (was handled), as for other handle* fu nctions.
1633 bool EventHandler::handleMouseFocus(const MouseEventWithHitTestResults& targeted Event, InputDeviceCapabilities* sourceCapabilities) 1633 bool EventHandler::handleMouseFocus(const MouseEventWithHitTestResults& targeted Event, InputDeviceCapabilities* sourceCapabilities)
1634 { 1634 {
1635 const PlatformMouseEvent& mouseEvent = targetedEvent.event();
1636
1637 // If clicking on a frame scrollbar, do not mess up with content focus. 1635 // If clicking on a frame scrollbar, do not mess up with content focus.
1638 if (FrameView* view = m_frame->view()) { 1636 if (targetedEvent.hitTestResult().scrollbar() && m_frame->contentLayoutObjec t()) {
1639 if (view->scrollbarAtRootFramePoint(mouseEvent.position())) 1637 if (targetedEvent.hitTestResult().scrollbar()->scrollableArea() == m_fra me->contentLayoutObject()->scrollableArea())
1640 return false; 1638 return false;
1641 } 1639 }
1642 1640
1643 // The layout needs to be up to date to determine if an element is focusable . 1641 // The layout needs to be up to date to determine if an element is focusable .
1644 m_frame->document()->updateLayoutIgnorePendingStylesheets(); 1642 m_frame->document()->updateLayoutIgnorePendingStylesheets();
1645 1643
1646 Element* element = nullptr; 1644 Element* element = nullptr;
1647 if (m_nodeUnderMouse) 1645 if (m_nodeUnderMouse)
1648 element = m_nodeUnderMouse->isElementNode() ? toElement(m_nodeUnderMouse ) : m_nodeUnderMouse->parentOrShadowHostElement(); 1646 element = m_nodeUnderMouse->isElementNode() ? toElement(m_nodeUnderMouse ) : m_nodeUnderMouse->parentOrShadowHostElement();
1649 for (; element; element = element->parentOrShadowHostElement()) { 1647 for (; element; element = element->parentOrShadowHostElement()) {
(...skipping 2388 matching lines...) Expand 10 before | Expand all | Expand 10 after
4038 unsigned EventHandler::accessKeyModifiers() 4036 unsigned EventHandler::accessKeyModifiers()
4039 { 4037 {
4040 #if OS(MACOSX) 4038 #if OS(MACOSX)
4041 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4039 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4042 #else 4040 #else
4043 return PlatformEvent::AltKey; 4041 return PlatformEvent::AltKey;
4044 #endif 4042 #endif
4045 } 4043 }
4046 4044
4047 } // namespace blink 4045 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698