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

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

Issue 637323002: Focus unfocusable node upon reference fragment navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove "focusable node" from test expectation Created 6 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 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
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 45e333d40163e98382cb41ec151153ddfe6c8ff5..bf2b95e0408db647b7e7d066a198b806ccdb6ef0 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -1362,7 +1362,8 @@ bool FrameView::scrollToAnchor(const String& name)
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