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

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

Issue 16194013: Mouse press should focus on any types of form controls. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 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/html/TextFieldInputType.cpp ('k') | Source/core/page/FocusDirection.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 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after
2073 } 2073 }
2074 2074
2075 // Only change the focus when clicking scrollbars if it can transfered t o a mouse focusable node. 2075 // Only change the focus when clicking scrollbars if it can transfered t o a mouse focusable node.
2076 if ((!node || !node->isMouseFocusable()) && isInsideScrollbar(mouseEvent .position())) 2076 if ((!node || !node->isMouseFocusable()) && isInsideScrollbar(mouseEvent .position()))
2077 return false; 2077 return false;
2078 2078
2079 // If focus shift is blocked, we eat the event. Note we should never cl ear swallowEvent 2079 // If focus shift is blocked, we eat the event. Note we should never cl ear swallowEvent
2080 // if the page already set it (e.g., by canceling default behavior). 2080 // if the page already set it (e.g., by canceling default behavior).
2081 if (Page* page = m_frame->page()) { 2081 if (Page* page = m_frame->page()) {
2082 if (node && node->isMouseFocusable()) { 2082 if (node && node->isMouseFocusable()) {
2083 if (!page->focusController()->setFocusedNode(node, m_frame)) 2083 if (!page->focusController()->setFocusedNode(node, m_frame, Focu sDirectionMouse))
2084 swallowEvent = true; 2084 swallowEvent = true;
2085 } else if (!node || !node->focused()) { 2085 } else if (!node || !node->focused()) {
2086 if (!page->focusController()->setFocusedNode(0, m_frame)) 2086 if (!page->focusController()->setFocusedNode(0, m_frame))
2087 swallowEvent = true; 2087 swallowEvent = true;
2088 } 2088 }
2089 } 2089 }
2090 } 2090 }
2091 2091
2092 return !swallowEvent; 2092 return !swallowEvent;
2093 } 2093 }
(...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after
3861 unsigned EventHandler::accessKeyModifiers() 3861 unsigned EventHandler::accessKeyModifiers()
3862 { 3862 {
3863 #if OS(DARWIN) 3863 #if OS(DARWIN)
3864 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3864 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3865 #else 3865 #else
3866 return PlatformEvent::AltKey; 3866 return PlatformEvent::AltKey;
3867 #endif 3867 #endif
3868 } 3868 }
3869 3869
3870 } // namespace WebCore 3870 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/TextFieldInputType.cpp ('k') | Source/core/page/FocusDirection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698