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

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

Issue 2377193004: [DevTools] Rework some focus code. (Closed)
Patch Set: FocusRestorer Created 4 years, 3 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
Index: third_party/WebKit/Source/devtools/front_end/ui/InplaceEditor.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/InplaceEditor.js b/third_party/WebKit/Source/devtools/front_end/ui/InplaceEditor.js
index 4e5edea77088178d21ba36e5c5e2c267efc34d6e..ed4e6cc1d1a0bb668115deb1d3405ad18bf63a97 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/InplaceEditor.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/InplaceEditor.js
@@ -68,7 +68,7 @@ WebInspector.InplaceEditor.prototype = {
var oldTabIndex = element.getAttribute("tabIndex");
if (typeof oldTabIndex !== "number" || oldTabIndex < 0)
element.tabIndex = 0;
- WebInspector.setCurrentFocusElement(element);
+ this._focusRestorer = new WebInspector.ElementFocusRestorer(element);
editingContext.oldTabIndex = oldTabIndex;
},
@@ -149,7 +149,8 @@ WebInspector.InplaceEditor.prototype = {
if (pasteCallback)
element.removeEventListener("paste", pasteEventListener, true);
- WebInspector.restoreFocusFromElement(element);
+ if (self._focusRestorer)
+ self._focusRestorer.restore();
self.closeEditor(editingContext);
}

Powered by Google App Engine
This is Rietveld 408576698