Chromium Code Reviews| 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..92c6870a60cad78b99297fccae01bda6caa19404 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,8 @@ 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; |
| + document.defaultView.requestAnimationFrame(() => UI._keyboardFocus = false); |
| }; |
| /** |
| @@ -1136,6 +1138,12 @@ UI.initializeUIUtils = function(document, themeSetting) { |
| UI._keyboardFocus = true; |
| document.defaultView.requestAnimationFrame(() => UI._keyboardFocus = false); |
| }, true); |
| + document.addEventListener('mousedown', () => { |
|
dgozman
2017/06/06 22:10:30
Let's move this listener to _windowFocused.
einbinder
2017/06/07 02:01:43
Done.
|
| + var activeElement = document.deepActiveElement(); |
| + if (activeElement) |
| + activeElement.removeAttribute('data-keyboard-focus'); |
| + UI._keyboardFocus = false; |
| + }, true); |
| if (!UI.themeSupport) |
| UI.themeSupport = new UI.ThemeSupport(themeSetting); |