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

Side by Side Diff: third_party/WebKit/Source/core/page/FocusController.cpp

Issue 2377543002: Sequential focus navigation across frames should clear per-document starting point. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/sequential-focus-navigation-starting-point.html ('k') | no next file » | 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nuanti Ltd. 3 * Copyright (C) 2008 Nuanti Ltd.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 DCHECK(element->isFocusable()); 987 DCHECK(element->isFocusable());
988 988
989 // FIXME: It would be nice to just be able to call setFocusedElement(element ) 989 // FIXME: It would be nice to just be able to call setFocusedElement(element )
990 // here, but we can't do that because some elements (e.g. HTMLInputElement 990 // here, but we can't do that because some elements (e.g. HTMLInputElement
991 // and HTMLTextAreaElement) do extra work in their focus() methods. 991 // and HTMLTextAreaElement) do extra work in their focus() methods.
992 Document& newDocument = element->document(); 992 Document& newDocument = element->document();
993 993
994 if (&newDocument != document) { 994 if (&newDocument != document) {
995 // Focus is going away from this document, so clear the focused element. 995 // Focus is going away from this document, so clear the focused element.
996 document->clearFocusedElement(); 996 document->clearFocusedElement();
997 document->setSequentialFocusNavigationStartingPoint(nullptr);
997 } 998 }
998 999
999 setFocusedFrame(newDocument.frame()); 1000 setFocusedFrame(newDocument.frame());
1000 1001
1001 if (caretBrowsing) { 1002 if (caretBrowsing) {
1002 Position position = firstPositionInOrBeforeNode(element); 1003 Position position = firstPositionInOrBeforeNode(element);
1003 VisibleSelection newSelection(position, position); 1004 VisibleSelection newSelection(position, position);
1004 frame->selection().setSelection(newSelection); 1005 frame->selection().setSelection(newSelection);
1005 } 1006 }
1006 1007
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 return consumed; 1314 return consumed;
1314 } 1315 }
1315 1316
1316 DEFINE_TRACE(FocusController) 1317 DEFINE_TRACE(FocusController)
1317 { 1318 {
1318 visitor->trace(m_page); 1319 visitor->trace(m_page);
1319 visitor->trace(m_focusedFrame); 1320 visitor->trace(m_focusedFrame);
1320 } 1321 }
1321 1322
1322 } // namespace blink 1323 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/sequential-focus-navigation-starting-point.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698