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

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 tab-to-focusable_node test 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..43bf342079bf7cee34bf6509325c78cc4af6bb19 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 it does not accept keyboard focus, then still remove the focus for consistency with other browsers (http://crbug.com/417636)
dmazzoni 2014/10/08 18:19:06 This comment doesn't make sense - you say "remove
robwu 2014/10/08 20:10:23 setFocusedElement first unfocuses the old element.
dmazzoni 2014/10/08 20:26:27 Oh, I get it now. I'd probably write the comment s
robwu 2014/10/09 06:12:57 Done.
+ 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