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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 2921363002: DevTools: Add keyboard focus highlight when focusing window (Closed)
Patch Set: move listener to windowFocused Created 3 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
index 13125efcf06748cf6851afa7b85e67f57636e3ac..d8b5ded911a07a2fd5aaed0aca41d4783bcde53b 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
@@ -711,6 +711,19 @@ UI.createShadowRootWithCoreStyles = function(element, cssFile) {
UI._windowFocused = function(document, event) {
if (event.target.document.nodeType === Node.DOCUMENT_NODE)
document.body.classList.remove('inactive');
+ UI._keyboardFocus = true;
+ var listener = () => {
+ var activeElement = document.deepActiveElement();
+ if (activeElement)
+ activeElement.removeAttribute('data-keyboard-focus');
+ UI._keyboardFocus = false;
+ };
+ document.defaultView.requestAnimationFrame(() => {
+ UI._keyboardFocus = false;
+ document.removeEventListener('mousedown', listener, true);
+ });
+ document.addEventListener('mousedown', listener, true);
+
};
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698