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

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

Issue 20670002: REGRESSION: Click on focused link should not remove focus on it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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
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 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 // The layout needs to be up to date to determine if an element is focus able. 2031 // The layout needs to be up to date to determine if an element is focus able.
2032 m_frame->document()->updateLayoutIgnorePendingStylesheets(); 2032 m_frame->document()->updateLayoutIgnorePendingStylesheets();
2033 2033
2034 // Blur current focus node when a link/button is clicked; this 2034 // Blur current focus node when a link/button is clicked; this
2035 // is expected by some sites that rely on onChange handlers running 2035 // is expected by some sites that rely on onChange handlers running
2036 // from form fields before the button click is processed. 2036 // from form fields before the button click is processed.
2037 Node* node = m_nodeUnderMouse.get(); 2037 Node* node = m_nodeUnderMouse.get();
2038 2038
2039 // Walk up the DOM tree to search for a node to focus. 2039 // Walk up the DOM tree to search for a node to focus.
2040 while (node) { 2040 while (node) {
2041 if (node->isMouseFocusable()) { 2041 if (node->isFocusable()) {
2042 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus a 2042 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus a
2043 // node on mouse down if it's selected and inside a focused node . It will be 2043 // node on mouse down if it's selected and inside a focused node . It will be
2044 // focused if the user does a mouseup over it, however, because the mouseup 2044 // focused if the user does a mouseup over it, however, because the mouseup
2045 // will set a selection inside it, which will call setFocuseNode IfNeeded. 2045 // will set a selection inside it, which will call setFocuseNode IfNeeded.
2046 Node* n = node->isShadowRoot() ? toShadowRoot(node)->host() : no de; 2046 Node* n = node->isShadowRoot() ? toShadowRoot(node)->host() : no de;
2047 if (m_frame->selection()->isRange() 2047 if (m_frame->selection()->isRange()
2048 && m_frame->selection()->toNormalizedRange()->compareNode(n, IGNORE_EXCEPTION) == Range::NODE_INSIDE 2048 && m_frame->selection()->toNormalizedRange()->compareNode(n, IGNORE_EXCEPTION) == Range::NODE_INSIDE
2049 && n->isDescendantOf(m_frame->document()->focusedElement())) 2049 && n->isDescendantOf(m_frame->document()->focusedElement()))
2050 return true; 2050 return true;
2051 2051
(...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after
3838 unsigned EventHandler::accessKeyModifiers() 3838 unsigned EventHandler::accessKeyModifiers()
3839 { 3839 {
3840 #if OS(DARWIN) 3840 #if OS(DARWIN)
3841 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3841 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3842 #else 3842 #else
3843 return PlatformEvent::AltKey; 3843 return PlatformEvent::AltKey;
3844 #endif 3844 #endif
3845 } 3845 }
3846 3846
3847 } // namespace WebCore 3847 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698