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

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

Issue 2094873002: DevTools: fix deepActiveElement and focus on Dialog when document blurs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo accidental rebase Created 4 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 | « third_party/WebKit/Source/devtools/front_end/settings/FrameworkBlackboxSettingsTab.js ('k') | 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/Dialog.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
index a15b39a0ccea3dff0f1e678ed7805db4dbfe87d2..74ac91b55619e675524460ebe09c3c72de00e529 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
@@ -41,7 +41,7 @@ WebInspector.Dialog = function()
this.contentElement.createChild("content");
this.contentElement.tabIndex = 0;
this.contentElement.addEventListener("focus", this._onFocus.bind(this), false);
- this.contentElement.addEventListener("keydown", this._onKeyDown.bind(this), false);
+ this._keyDownBound = this._onKeyDown.bind(this);
this._wrapsContent = false;
this._dimmed = false;
@@ -50,7 +50,6 @@ WebInspector.Dialog = function()
}
/**
- * TODO(dgozman): remove this method (it's only used for shortcuts handling).
* @return {boolean}
*/
WebInspector.Dialog.hasInstance = function()
@@ -73,6 +72,7 @@ WebInspector.Dialog.prototype = {
this._glassPane = new WebInspector.GlassPane(document, this._dimmed);
this._glassPane.element.addEventListener("click", this._onGlassPaneClick.bind(this), false);
+ this.element.ownerDocument.body.addEventListener("keydown", this._keyDownBound, false);
// When a dialog closes, focus should be restored to the previous focused element when
// possible, otherwise the default inspector view element.
@@ -89,6 +89,7 @@ WebInspector.Dialog.prototype = {
*/
detach: function()
{
+ this.element.ownerDocument.body.removeEventListener("keydown", this._keyDownBound, false);
WebInspector.Widget.prototype.detach.call(this);
this._glassPane.dispose();
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/settings/FrameworkBlackboxSettingsTab.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698