Title: [127237] trunk/Source/WebCore
Revision
127237
Author
[email protected]
Date
2012-08-31 00:58:38 -0700 (Fri, 31 Aug 2012)

Log Message

Web Inspector: render path to file and line number as subtitles in selector dialog.
https://bugs.webkit.org/show_bug.cgi?id=95481

Reviewed by Vsevolod Vlasov.

In case several files have matching names, we should render the path next to it.
Using the same subtitle field, we now also render line number for JS and Style outlines.

* inspector/front-end/FilteredItemSelectionDialog.js:
(WebInspector.FilteredItemSelectionDialog.prototype.get _itemsLoaded):
(WebInspector.FilteredItemSelectionDialog.prototype._createItemElement):
(WebInspector.FilteredItemSelectionDialog.prototype._filterItems):
(WebInspector.SelectionDialogContentProvider.prototype.itemSuffixAt):
(WebInspector._javascript_OutlineDialog.prototype.itemSuffixAt):
(WebInspector._javascript_OutlineDialog.prototype.itemSubtitleAt):
(WebInspector.OpenResourceDialog.prototype.itemSuffixAt):
(WebInspector.OpenResourceDialog.prototype.itemSubtitleAt):
* inspector/front-end/StyleSheetOutlineDialog.js:
(WebInspector.StyleSheetOutlineDialog.prototype.itemSuffixAt):
(WebInspector.StyleSheetOutlineDialog.prototype.itemSubtitleAt):
* inspector/front-end/filteredItemSelectionDialog.css:
(.js-outline-dialog > .container > div.item):
(.js-outline-dialog span.subtitle):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (127236 => 127237)


--- trunk/Source/WebCore/ChangeLog	2012-08-31 07:36:34 UTC (rev 127236)
+++ trunk/Source/WebCore/ChangeLog	2012-08-31 07:58:38 UTC (rev 127237)
@@ -1,3 +1,29 @@
+2012-08-31  Pavel Feldman  <[email protected]>
+
+        Web Inspector: render path to file and line number as subtitles in selector dialog.
+        https://bugs.webkit.org/show_bug.cgi?id=95481
+
+        Reviewed by Vsevolod Vlasov.
+
+        In case several files have matching names, we should render the path next to it.
+        Using the same subtitle field, we now also render line number for JS and Style outlines.
+
+        * inspector/front-end/FilteredItemSelectionDialog.js:
+        (WebInspector.FilteredItemSelectionDialog.prototype.get _itemsLoaded):
+        (WebInspector.FilteredItemSelectionDialog.prototype._createItemElement):
+        (WebInspector.FilteredItemSelectionDialog.prototype._filterItems):
+        (WebInspector.SelectionDialogContentProvider.prototype.itemSuffixAt):
+        (WebInspector._javascript_OutlineDialog.prototype.itemSuffixAt):
+        (WebInspector._javascript_OutlineDialog.prototype.itemSubtitleAt):
+        (WebInspector.OpenResourceDialog.prototype.itemSuffixAt):
+        (WebInspector.OpenResourceDialog.prototype.itemSubtitleAt):
+        * inspector/front-end/StyleSheetOutlineDialog.js:
+        (WebInspector.StyleSheetOutlineDialog.prototype.itemSuffixAt):
+        (WebInspector.StyleSheetOutlineDialog.prototype.itemSubtitleAt):
+        * inspector/front-end/filteredItemSelectionDialog.css:
+        (.js-outline-dialog > .container > div.item):
+        (.js-outline-dialog span.subtitle):
+
 2012-08-31  Yoshifumi Inoue  <[email protected]>
 
         [Forms] Left/Right keys in multiple fields time input UI should move focus physical left/right instead of logical left/right regardless text direction.

Modified: trunk/Source/WebCore/inspector/front-end/FilteredItemSelectionDialog.js (127236 => 127237)


--- trunk/Source/WebCore/inspector/front-end/FilteredItemSelectionDialog.js	2012-08-31 07:36:34 UTC (rev 127236)
+++ trunk/Source/WebCore/inspector/front-end/FilteredItemSelectionDialog.js	2012-08-31 07:58:38 UTC (rev 127237)
@@ -121,7 +121,7 @@
     _itemsLoaded: function(index, chunkLength, chunkIndex, chunkCount)
     {
         for (var i = index; i < index + chunkLength; ++i)
-            this._itemElementsContainer.appendChild(this._createItemElement(i, this._delegate.itemTitleAt(i)));
+            this._itemElementsContainer.appendChild(this._createItemElement(i));
         this._filterItems();
 
         if (chunkIndex === chunkCount)
@@ -137,19 +137,20 @@
      * @param {number} index
      * @param {string} title
      */
-    _createItemElement: function(index, title)
+    _createItemElement: function(index)
     {
         if (this._itemElements[index])
             return this._itemElements[index];
 
         var itemElement = document.createElement("div");
         itemElement.className = "item";
-        var titleElement = itemElement.createChild("span");
-        var subtitleElement = itemElement.createChild("span");
-        titleElement.textContent = title;
+        itemElement._titleElement = itemElement.createChild("span");
+        itemElement._titleElement.textContent = this._delegate.itemTitleAt(index);
+        itemElement._titleSuffixElement = itemElement.createChild("span");
+        itemElement._subtitleElement = itemElement.createChild("span", "subtitle");
+        itemElement._subtitleElement.textContent = this._delegate.itemSubtitleAt(index);
         this._elementIndexes.put(itemElement, index);
         this._itemElements.push(itemElement);
-
         return itemElement;
     },
 
@@ -223,7 +224,7 @@
         var firstElement;
         for (var i = 0; i < this._itemElements.length; ++i) {
             var itemElement = this._itemElements[i];
-            itemElement.lastChild.textContent = this._delegate.itemSubtitleAt(i);
+            itemElement._titleSuffixElement.textContent = this._delegate.itemSuffixAt(i);
             if (regex.test(this._delegate.itemKeyAt(i))) {
                 this._showItemElement(itemElement);
                 if (!firstElement)
@@ -438,6 +439,12 @@
      * @param {number} itemIndex
      * @return {string}
      */
+    itemSuffixAt: function(itemIndex) { },
+
+    /*
+     * @param {number} itemIndex
+     * @return {string}
+     */
     itemSubtitleAt: function(itemIndex) { },
 
     /**
@@ -512,11 +519,20 @@
      * @param {number} itemIndex
      * @return {string}
      */
-    itemSubtitleAt: function(itemIndex)
+    itemSuffixAt: function(itemIndex)
     {
         return "";
     },
 
+    /*
+     * @param {number} itemIndex
+     * @return {string}
+     */
+    itemSubtitleAt: function(itemIndex)
+    {
+        return ":" + (this._functionItems[itemIndex].line + 1);
+    },
+
     /**
      * @param {number} itemIndex
      * @return {string}
@@ -636,11 +652,20 @@
      * @param {number} itemIndex
      * @return {string}
      */
-    itemSubtitleAt: function(itemIndex)
+    itemSuffixAt: function(itemIndex)
     {
         return this._queryLineNumber || "";
     },
 
+    /*
+     * @param {number} itemIndex
+     * @return {string}
+     */
+    itemSubtitleAt: function(itemIndex)
+    {
+        return this._uiSourceCodes[itemIndex].parsedURL.folderPathComponents;
+    },
+
     /**
      * @param {number} itemIndex
      * @return {string}

Modified: trunk/Source/WebCore/inspector/front-end/StyleSheetOutlineDialog.js (127236 => 127237)


--- trunk/Source/WebCore/inspector/front-end/StyleSheetOutlineDialog.js	2012-08-31 07:36:34 UTC (rev 127236)
+++ trunk/Source/WebCore/inspector/front-end/StyleSheetOutlineDialog.js	2012-08-31 07:58:38 UTC (rev 127237)
@@ -68,11 +68,20 @@
      * @param {number} itemIndex
      * @return {string}
      */
-    itemSubtitleAt: function(itemIndex)
+    itemSuffixAt: function(itemIndex)
     {
         return "";
     },
 
+    /*
+     * @param {number} itemIndex
+     * @return {string}
+     */
+    itemSubtitleAt: function(itemIndex)
+    {
+        return ":" + (this._rules[itemIndex].sourceLine + 1);
+    },
+
     /**
      * @param {number} itemIndex
      * @return {string}

Modified: trunk/Source/WebCore/inspector/front-end/filteredItemSelectionDialog.css (127236 => 127237)


--- trunk/Source/WebCore/inspector/front-end/filteredItemSelectionDialog.css	2012-08-31 07:36:34 UTC (rev 127236)
+++ trunk/Source/WebCore/inspector/front-end/filteredItemSelectionDialog.css	2012-08-31 07:58:38 UTC (rev 127237)
@@ -28,9 +28,15 @@
     white-space: nowrap;
     text-overflow: ellipsis;
     overflow: hidden;
-    color: rgb(105, 105, 105);
+    color: rgb(95, 95, 95);
 }
 
+.js-outline-dialog span.subtitle {
+    color: rgb(155, 155, 155);
+    padding-right: 2px;
+    float: right;
+}
+
 .js-outline-dialog > .container > div.item.selected {
     background-color: rgb(224, 224, 224);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to