| Index: third_party/WebKit/Source/devtools/front_end/ui/Widget.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Widget.js b/third_party/WebKit/Source/devtools/front_end/ui/Widget.js
|
| index bc4af9ba13e484b657ff7ac471fe64203eaaaa76..5691997e2dd70e3676319696f619367345dea6bf 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/Widget.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/Widget.js
|
| @@ -424,7 +424,7 @@ WebInspector.Widget.prototype = {
|
| },
|
|
|
| /**
|
| - * @param {!Element} element
|
| + * @param {?Element} element
|
| */
|
| setDefaultFocusedElement: function(element)
|
| {
|
| @@ -442,9 +442,13 @@ WebInspector.Widget.prototype = {
|
|
|
| focus: function()
|
| {
|
| + if (!this.isShowing())
|
| + return;
|
| +
|
| var element = this._defaultFocusedElement;
|
| - if (element && !element.isAncestor(this.element.ownerDocument.activeElement)) {
|
| - WebInspector.setCurrentFocusElement(element);
|
| + if (element) {
|
| + if (!element.hasFocus())
|
| + element.focus();
|
| return;
|
| }
|
|
|
| @@ -466,8 +470,7 @@ WebInspector.Widget.prototype = {
|
| */
|
| hasFocus: function()
|
| {
|
| - var activeElement = this.element.ownerDocument.activeElement;
|
| - return activeElement && activeElement.isSelfOrDescendant(this.element);
|
| + return this.element.hasFocus();
|
| },
|
|
|
| /**
|
|
|