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

Unified Diff: Source/core/frame/FrameView.cpp

Issue 701493002: Merge 183455 "Focus unfocusable node upon reference fragment nav..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2171/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
===================================================================
--- Source/core/frame/FrameView.cpp (revision 184784)
+++ Source/core/frame/FrameView.cpp (working copy)
@@ -1360,7 +1360,8 @@
maintainScrollPositionAtAnchor(anchorNode ? static_cast<Node*>(anchorNode) : m_frame->document());
// If the anchor accepts keyboard focus, move focus there to aid users relying on keyboard navigation.
- if (anchorNode && anchorNode->isFocusable())
+ // If anchorNode is not focusable, setFocusedElement() will still clear focus, which matches the behavior of other browsers.
+ if (anchorNode)
m_frame->document()->setFocusedElement(anchorNode);
return true;
« no previous file with comments | « LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698