Title: [109745] trunk/Source/WebCore
Revision
109745
Author
[email protected]
Date
2012-03-05 07:35:13 -0800 (Mon, 05 Mar 2012)

Log Message

Web Inspector: [Styles] Tabbing an empty new property in the middle of style moves the editor to the next section
https://bugs.webkit.org/show_bug.cgi?id=80264

Reviewed by Pavel Feldman.

* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylePropertyTreeElement.prototype.element.userInput.previousContent.context.moveDirection.alreadyNew):
(WebInspector.StylePropertyTreeElement.prototype):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (109744 => 109745)


--- trunk/Source/WebCore/ChangeLog	2012-03-05 15:30:54 UTC (rev 109744)
+++ trunk/Source/WebCore/ChangeLog	2012-03-05 15:35:13 UTC (rev 109745)
@@ -1,3 +1,14 @@
+2012-03-05  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: [Styles] Tabbing an empty new property in the middle of style moves the editor to the next section
+        https://bugs.webkit.org/show_bug.cgi?id=80264
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylePropertyTreeElement.prototype.element.userInput.previousContent.context.moveDirection.alreadyNew):
+        (WebInspector.StylePropertyTreeElement.prototype):
+
 2012-03-05  Rob Buis  <[email protected]>
 
         [BlackBerry] Update LocalizedStringsBlackBerry.cpp

Modified: trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js (109744 => 109745)


--- trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js	2012-03-05 15:30:54 UTC (rev 109744)
+++ trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js	2012-03-05 15:35:13 UTC (rev 109745)
@@ -2282,6 +2282,7 @@
         }
 
         // Make the Changes and trigger the moveToNextCallback after updating.
+        var moveToIndex = moveTo && this.treeOutline ? this.treeOutline.children.indexOf(moveTo) : -1;
         var blankInput = /^\s*$/.test(userInput);
         var isDataPasted = "originalName" in context;
         var isDirtyViaPaste = isDataPasted && (this.nameElement.textContent !== context.originalName || this.valueElement.textContent !== context.originalValue);
@@ -2304,8 +2305,6 @@
             moveToNextCallback.call(this, this._newProperty, false, this.treeOutline.section);
         }
 
-        var moveToIndex = moveTo && this.treeOutline ? this.treeOutline.children.indexOf(moveTo) : -1;
-
         // The Callback to start editing the next/previous property/selector.
         function moveToNextCallback(alreadyNew, valueChanged, section)
         {
@@ -2329,7 +2328,10 @@
                 else {
                     var treeElement = moveToIndex >= 0 ? propertyElements[moveToIndex] : null;
                     if (treeElement) {
-                        treeElement.startEditing(!isEditingName ? treeElement.nameElement : treeElement.valueElement);
+                        var elementToEdit = !isEditingName ? treeElement.nameElement : treeElement.valueElement;
+                        if (alreadyNew && blankInput)
+                            elementToEdit = moveDirection === "forward" ? treeElement.nameElement : treeElement.valueElement;
+                        treeElement.startEditing(elementToEdit);
                         return;
                     } else if (!alreadyNew)
                         moveToSelector = true;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to