Title: [205676] trunk/Source/WebInspectorUI
Revision
205676
Author
[email protected]
Date
2016-09-08 16:21:27 -0700 (Thu, 08 Sep 2016)

Log Message

Web Inspector: TimelineDataGridNode should refresh when graph column is resized
https://bugs.webkit.org/show_bug.cgi?id=161765
<rdar://problem/28215674>

Reviewed by Brian Burg.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid.prototype.resizerDragging):
Call `DataGridNode.didResizeColumn` for all visible nodes in the columns
to the left and right of the column resizer.

* UserInterface/Views/DataGridNode.js:
(WebInspector.DataGridNode.prototype.didResizeColumn):
Add protected base class method for subclasses to override.

* UserInterface/Views/TimelineDataGridNode.js:
(WebInspector.TimelineDataGridNode.prototype.didResizeColumn):
Refresh the node's graph when the "graph" column is resized.
Renamed `left/rightCellIndex` -> `left/rightColumnIndex`.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (205675 => 205676)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-09-08 23:19:38 UTC (rev 205675)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-09-08 23:21:27 UTC (rev 205676)
@@ -1,3 +1,25 @@
+2016-09-08  Matt Baker  <[email protected]>
+
+        Web Inspector: TimelineDataGridNode should refresh when graph column is resized
+        https://bugs.webkit.org/show_bug.cgi?id=161765
+        <rdar://problem/28215674>
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Views/DataGrid.js:
+        (WebInspector.DataGrid.prototype.resizerDragging):
+        Call `DataGridNode.didResizeColumn` for all visible nodes in the columns
+        to the left and right of the column resizer.
+
+        * UserInterface/Views/DataGridNode.js:
+        (WebInspector.DataGridNode.prototype.didResizeColumn):
+        Add protected base class method for subclasses to override.
+
+        * UserInterface/Views/TimelineDataGridNode.js:
+        (WebInspector.TimelineDataGridNode.prototype.didResizeColumn):
+        Refresh the node's graph when the "graph" column is resized.
+        Renamed `left/rightCellIndex` -> `left/rightColumnIndex`.
+
 2016-09-08  Nikita Vasilyev  <[email protected]>
 
         Web Inspector: Add a button to navigation bar to toggle Control Flow Profiler

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js (205675 => 205676)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js	2016-09-08 23:19:38 UTC (rev 205675)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js	2016-09-08 23:21:27 UTC (rev 205676)
@@ -1783,22 +1783,22 @@
         var dragPoint = (resizer.initialPosition - positionDelta) - this.element.totalOffsetLeft;
         // Constrain the dragpoint to be within the space made up by the
         // column directly to the left and the column directly to the right.
-        var leftCellIndex = resizer[WebInspector.DataGrid.PreviousColumnOrdinalSymbol];
-        var rightCellIndex = resizer[WebInspector.DataGrid.NextColumnOrdinalSymbol];
+        var leftColumnIndex = resizer[WebInspector.DataGrid.PreviousColumnOrdinalSymbol];
+        var rightColumnIndex = resizer[WebInspector.DataGrid.NextColumnOrdinalSymbol];
         var firstRowCells = this._headerTableBodyElement.rows[0].cells;
         var leftEdgeOfPreviousColumn = 0;
-        for (var i = 0; i < leftCellIndex; i++)
+        for (var i = 0; i < leftColumnIndex; i++)
             leftEdgeOfPreviousColumn += firstRowCells[i].offsetWidth;
 
         // Differences for other resize methods
         if (this.resizeMethod === WebInspector.DataGrid.ResizeMethod.Last) {
-            rightCellIndex = this.resizers.length;
+            rightColumnIndex = this.resizers.length;
         } else if (this.resizeMethod === WebInspector.DataGrid.ResizeMethod.First) {
-            leftEdgeOfPreviousColumn += firstRowCells[leftCellIndex].offsetWidth - firstRowCells[0].offsetWidth;
-            leftCellIndex = 0;
+            leftEdgeOfPreviousColumn += firstRowCells[leftColumnIndex].offsetWidth - firstRowCells[0].offsetWidth;
+            leftColumnIndex = 0;
         }
 
-        var rightEdgeOfNextColumn = leftEdgeOfPreviousColumn + firstRowCells[leftCellIndex].offsetWidth + firstRowCells[rightCellIndex].offsetWidth;
+        var rightEdgeOfNextColumn = leftEdgeOfPreviousColumn + firstRowCells[leftColumnIndex].offsetWidth + firstRowCells[rightColumnIndex].offsetWidth;
 
         // Give each column some padding so that they don't disappear.
         var leftMinimum = leftEdgeOfPreviousColumn + this.ColumnResizePadding;
@@ -1809,15 +1809,29 @@
         resizer.element.style.left = (dragPoint - this.CenterResizerOverBorderAdjustment) + "px";
 
         var percentLeftColumn = (((dragPoint - leftEdgeOfPreviousColumn) / this._dataTableElement.offsetWidth) * 100) + "%";
-        this._headerTableColumnGroupElement.children[leftCellIndex].style.width = percentLeftColumn;
-        this._dataTableColumnGroupElement.children[leftCellIndex].style.width = percentLeftColumn;
+        this._headerTableColumnGroupElement.children[leftColumnIndex].style.width = percentLeftColumn;
+        this._dataTableColumnGroupElement.children[leftColumnIndex].style.width = percentLeftColumn;
 
         var percentRightColumn = (((rightEdgeOfNextColumn - dragPoint) / this._dataTableElement.offsetWidth) * 100) + "%";
-        this._headerTableColumnGroupElement.children[rightCellIndex].style.width = percentRightColumn;
-        this._dataTableColumnGroupElement.children[rightCellIndex].style.width = percentRightColumn;
+        this._headerTableColumnGroupElement.children[rightColumnIndex].style.width = percentRightColumn;
+        this._dataTableColumnGroupElement.children[rightColumnIndex].style.width = percentRightColumn;
 
         this._positionResizerElements();
         this._positionHeaderViews();
+
+        const skipHidden = true;
+        const dontPopulate = true;
+
+        let leftColumnIdentifier = this.orderedColumns[leftColumnIndex];
+        let rightColumnIdentifier = this.orderedColumns[rightColumnIndex];
+        let child = this.children[0];
+
+        while (child) {
+            child.didResizeColumn(leftColumnIdentifier);
+            child.didResizeColumn(rightColumnIdentifier);
+            child = child.traverseNextNode(skipHidden, this, dontPopulate);
+        }
+
         event.preventDefault();
     }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DataGridNode.js (205675 => 205676)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DataGridNode.js	2016-09-08 23:19:38 UTC (rev 205675)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DataGridNode.js	2016-09-08 23:21:27 UTC (rev 205676)
@@ -732,6 +732,11 @@
         let value = this.data[columnIdentifier];
         return typeof value === "string" ? value : null;
     }
+
+    didResizeColumn(columnIdentifier)
+    {
+        // Override by subclasses.
+    }
 };
 
 // Used to create a new table row when entering new data by editing cells.

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js (205675 => 205676)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js	2016-09-08 23:19:38 UTC (rev 205675)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js	2016-09-08 23:21:27 UTC (rev 205676)
@@ -389,4 +389,12 @@
     {
         // Implemented by subclasses.
     }
+
+    didResizeColumn(columnIdentifier)
+    {
+        if (columnIdentifier !== "graph")
+            return;
+
+        this.needsGraphRefresh();
+    }
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to