| Index: third_party/WebKit/Source/devtools/front_end/ui/SwatchPopoverHelper.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SwatchPopoverHelper.js b/third_party/WebKit/Source/devtools/front_end/ui/SwatchPopoverHelper.js
|
| index ae761d33eb43aafdce5afd60f4bff4e324ece546..60d17ce143aa1d4d8e84f7a9918444ce14cb6595 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/SwatchPopoverHelper.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/SwatchPopoverHelper.js
|
| @@ -67,13 +67,12 @@ WebInspector.SwatchPopoverHelper.prototype = {
|
|
|
| reposition: function()
|
| {
|
| - if (!this._previousFocusElement)
|
| - this._previousFocusElement = WebInspector.currentFocusElement();
|
| // Unbind "blur" listener to avoid reenterability: |popover.showView| will hide the popover and trigger it synchronously.
|
| this._view.contentElement.removeEventListener("focusout", this._boundFocusOut, false);
|
| this._popover.showView(this._view, this._anchorElement);
|
| this._view.contentElement.addEventListener("focusout", this._boundFocusOut, false);
|
| - WebInspector.setCurrentFocusElement(this._view.contentElement);
|
| + if (!this._focusRestorer)
|
| + this._focusRestorer = new WebInspector.WidgetFocusRestorer(this._view);
|
| },
|
|
|
| /**
|
| @@ -93,8 +92,7 @@ WebInspector.SwatchPopoverHelper.prototype = {
|
| if (this._hiddenCallback)
|
| this._hiddenCallback.call(null, !!commitEdit);
|
|
|
| - WebInspector.setCurrentFocusElement(this._previousFocusElement);
|
| - delete this._previousFocusElement;
|
| + this._focusRestorer.restore();
|
| delete this._anchorElement;
|
| if (this._view) {
|
| this._view.detach();
|
|
|