Changing WebInspector.currentFocusElement to/from an input element
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Apr 2008 20:05:38 +0000 (20:05 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Apr 2008 20:05:38 +0000 (20:05 +0000)
does not change the actual focus of that input element. You see this
in the search field.

Reviewed by Adam Roben.

* page/inspector/inspector.js:
(WebInspector.set currentFocusElement): Call blur and focus if the
node implements them.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@31641 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/inspector/inspector.js

index 295c929..fa43535 100644 (file)
@@ -1,3 +1,15 @@
+2008-04-04  Timothy Hatcher  <timothy@apple.com>
+
+        Changing WebInspector.currentFocusElement to/from an input element
+        does not change the actual focus of that input element. You see this
+        in the search field.
+
+        Reviewed by Adam Roben.
+
+        * page/inspector/inspector.js:
+        (WebInspector.set currentFocusElement): Call blur and focus if the
+        node implements them.
+
 2008-04-04  David Hyatt  <hyatt@apple.com>
 
         Improve the background size heuristic for SVGs used as background images with no intrinsic size specified.
index fe25699..ebeb7b9 100644 (file)
@@ -90,6 +90,8 @@ var WebInspector = {
         if (this._currentFocusElement) {
             this._currentFocusElement.removeStyleClass("focused");
             this._currentFocusElement.addStyleClass("blurred");
+            if (this._currentFocusElement.blur)
+                this._currentFocusElement.blur();
             if (this._currentFocusElement.blurred)
                 this._currentFocusElement.blurred();
         }
@@ -99,6 +101,8 @@ var WebInspector = {
         if (x) {
             x.addStyleClass("focused");
             x.removeStyleClass("blurred");
+            if (this._currentFocusElement.focus)
+                this._currentFocusElement.focus();
             if (this._currentFocusElement.focused)
                 this._currentFocusElement.focused();
         }