Makes the selection surround just the name or value that was
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Aug 2008 16:47:34 +0000 (16:47 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Aug 2008 16:47:34 +0000 (16:47 +0000)
        double clicked when editing CSS properties. This regressed when
        the Inspector started using focus/blur events, since a focus on
        a content editable region changes the selection.

        https://bugs.webkit.org/show_bug.cgi?id=20280

        Reviewed by Adam Roben.

        * page/inspector/StylesSidebarPane.js:
        (WebInspector.StylePropertyTreeElement.prototype.startEditing):
        Change the selection after calling WebInspector.startEditing,
        since WebInspector.startEditing will set an initial selection
        due to a focus event.

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

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

index eaa88e4..633e1a9 100644 (file)
@@ -1,5 +1,22 @@
 2008-08-04  Timothy Hatcher  <timothy@apple.com>
 
+        Makes the selection surround just the name or value that was
+        double clicked when editing CSS properties. This regressed when
+        the Inspector started using focus/blur events, since a focus on
+        a content editable region changes the selection.
+
+        https://bugs.webkit.org/show_bug.cgi?id=20280
+
+        Reviewed by Adam Roben.
+
+        * page/inspector/StylesSidebarPane.js:
+        (WebInspector.StylePropertyTreeElement.prototype.startEditing):
+        Change the selection after calling WebInspector.startEditing,
+        since WebInspector.startEditing will set an initial selection
+        due to a focus event.
+
+2008-08-04  Timothy Hatcher  <timothy@apple.com>
+
         Changes the editing behavior in the Inspector to commit changes
         when focus is lost, instead of reverting the changes.
 
index 9fcf981..a4b6229 100644 (file)
@@ -687,11 +687,10 @@ WebInspector.StylePropertyTreeElement.prototype = {
         if (!selectElement)
             selectElement = this.listItemElement;
 
-        window.getSelection().setBaseAndExtent(selectElement, 0, selectElement, 1);
-
         this.listItemElement.handleKeyEvent = this.editingKeyDown.bind(this);
 
         WebInspector.startEditing(this.listItemElement, this.editingCommitted.bind(this), this.editingCancelled.bind(this), context);
+        window.getSelection().setBaseAndExtent(selectElement, 0, selectElement, 1);
     },
 
     editingKeyDown: function(event)