Web Inspector: Timelines: clicking a row in Script > Events grid triggers Location...
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Sep 2018 00:03:05 +0000 (00:03 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Sep 2018 00:03:05 +0000 (00:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189603
<rdar://problem/44431403>

Reviewed by Joseph Pecoraro.

TimelineDataGrid controls showing/hiding the call frame popover, with subclasses
overriding callFramePopoverAnchorElement to position it. This patch adds
another overridable base class method, shouldShowCallFramePopover, which subclasses
can use to block the popover when the Location column is hidden.

* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype.layout):
(WI.DataGrid.prototype._positionResizerElements):
(WI.DataGrid.prototype._isColumnVisible): Deleted.

* UserInterface/Views/LayoutTimelineDataGrid.js:
(WI.LayoutTimelineDataGrid.prototype.shouldShowCallFramePopover):
(WI.LayoutTimelineDataGrid):

* UserInterface/Views/ScriptTimelineDataGrid.js:
(WI.ScriptTimelineDataGrid.prototype.shouldShowCallFramePopover):
(WI.ScriptTimelineDataGrid):

* UserInterface/Views/TimelineDataGrid.js:
(WI.TimelineDataGrid.prototype.shouldShowCallFramePopover):
(WI.TimelineDataGrid.prototype._dataGridSelectedNodeChanged):

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/DataGrid.js
Source/WebInspectorUI/UserInterface/Views/LayoutTimelineDataGrid.js
Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGrid.js
Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js

index f86151b..d9585b6 100644 (file)
@@ -1,3 +1,33 @@
+2018-09-13  Matt Baker  <mattbaker@apple.com>
+
+        Web Inspector: Timelines: clicking a row in Script > Events grid triggers Location popover when column is hidden
+        https://bugs.webkit.org/show_bug.cgi?id=189603
+        <rdar://problem/44431403>
+
+        Reviewed by Joseph Pecoraro.
+
+        TimelineDataGrid controls showing/hiding the call frame popover, with subclasses
+        overriding callFramePopoverAnchorElement to position it. This patch adds
+        another overridable base class method, shouldShowCallFramePopover, which subclasses
+        can use to block the popover when the Location column is hidden.
+
+        * UserInterface/Views/DataGrid.js:
+        (WI.DataGrid.prototype.layout):
+        (WI.DataGrid.prototype._positionResizerElements):
+        (WI.DataGrid.prototype._isColumnVisible): Deleted.
+
+        * UserInterface/Views/LayoutTimelineDataGrid.js:
+        (WI.LayoutTimelineDataGrid.prototype.shouldShowCallFramePopover):
+        (WI.LayoutTimelineDataGrid):
+
+        * UserInterface/Views/ScriptTimelineDataGrid.js:
+        (WI.ScriptTimelineDataGrid.prototype.shouldShowCallFramePopover):
+        (WI.ScriptTimelineDataGrid):
+
+        * UserInterface/Views/TimelineDataGrid.js:
+        (WI.TimelineDataGrid.prototype.shouldShowCallFramePopover):
+        (WI.TimelineDataGrid.prototype._dataGridSelectedNodeChanged):
+
 2018-09-13  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Opening inspector with a selected element might immediately scroll that element off screen in the DOM Tree outline
index 2e6421c..9fa1545 100644 (file)
@@ -857,7 +857,7 @@ WI.DataGrid = class DataGrid extends WI.View
             let columnWidths = [];
             for (let i = 0; i < numColumns; ++i) {
                 let headerCellElement = cells[i];
-                if (this._isColumnVisible(headerCellElement.columnIdentifier)) {
+                if (this.isColumnVisible(headerCellElement.columnIdentifier)) {
                     let columnWidth = headerCellElement.offsetWidth;
                     let percentWidth = ((columnWidth / tableWidth) * 100) + "%";
                     columnWidths.push(percentWidth);
@@ -894,7 +894,7 @@ WI.DataGrid = class DataGrid extends WI.View
         this._cachedScrollableOffsetHeight = NaN;
     }
 
-    _isColumnVisible(columnIdentifier)
+    isColumnVisible(columnIdentifier)
     {
         return !this.columns.get(columnIdentifier)["hidden"];
     }
@@ -969,7 +969,7 @@ WI.DataGrid = class DataGrid extends WI.View
 
             leadingOffset = columnWidths[i];
 
-            if (this._isColumnVisible(this.orderedColumns[i])) {
+            if (this.isColumnVisible(this.orderedColumns[i])) {
                 resizer.element.style.removeProperty("display");
                 resizer.element.style.setProperty(WI.resolvedLayoutDirection() === WI.LayoutDirection.RTL ? "right" : "left", `${leadingOffset}px`);
                 resizer[WI.DataGrid.PreviousColumnOrdinalSymbol] = i;
index c49ab5e..4f3e052 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -31,4 +31,9 @@ WI.LayoutTimelineDataGrid = class LayoutTimelineDataGrid extends WI.TimelineData
     {
         return this.selectedNode.elementWithColumnIdentifier("location");
     }
+
+    shouldShowCallFramePopover()
+    {
+        return this.isColumnVisible("location");
+    }
 };
index 3597ad4..05f911e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -31,4 +31,9 @@ WI.ScriptTimelineDataGrid = class ScriptTimelineDataGrid extends WI.TimelineData
     {
         return this.selectedNode.elementWithColumnIdentifier("location");
     }
+
+    shouldShowCallFramePopover()
+    {
+        return this.isColumnVisible("location");
+    }
 };
index 63edac6..f8e46d8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -121,6 +121,12 @@ WI.TimelineDataGrid = class TimelineDataGrid extends WI.DataGrid
         return null;
     }
 
+    shouldShowCallFramePopover()
+    {
+        // Implemented by subclasses.
+        return false;
+    }
+
     addRowInSortOrder(dataGridNode, parentDataGridNode)
     {
         parentDataGridNode = parentDataGridNode || this;
@@ -320,7 +326,8 @@ WI.TimelineDataGrid = class TimelineDataGrid extends WI.DataGrid
             return;
         }
 
-        this._showPopoverForSelectedNodeSoon();
+        if (this.shouldShowCallFramePopover())
+            this._showPopoverForSelectedNodeSoon();
     }
 
     _showPopoverForSelectedNodeSoon()