Web Inspector: Timeline Filter Bars are not appearing at all
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Aug 2014 06:56:24 +0000 (06:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Aug 2014 06:56:24 +0000 (06:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=135740

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-08-07
Reviewed by Timothy Hatcher.

* UserInterface/Views/TimelineDataGrid.css:
(.data-grid.timeline.has-non-default-filter > .navigation-bar-container):
(.data-grid.timeline > .navigation-bar-container > .navigation-bar):
(body.mac-platform.legacy .data-grid.timeline > .navigation-bar-container > .navigation-bar):
Update the positioning and height for non-legacy because the console is now taller.

* UserInterface/Views/ScopeBar.js:
(WebInspector.ScopeBar.prototype.hasNonDefaultItemSelected):
Helper to know if there is a non-default filter.

* UserInterface/Views/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid.prototype.treeElementMatchesActiveScopeFilters):
(WebInspector.TimelineDataGrid.prototype._scopeBarSelectedItemsDidChange):
Update scope bar visibility. If non-default we want to always show it.

(WebInspector.TimelineDataGrid.prototype._updateScopeBarForcedVisibility):
If there is a non-default filter, force showing the bar.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/ScopeBar.js
Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.css
Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js

index c51615d..6592ec9 100644 (file)
@@ -1,5 +1,30 @@
 2014-08-07  Joseph Pecoraro  <pecoraro@apple.com>
 
+        Web Inspector: Timeline Filter Bars are not appearing at all
+        https://bugs.webkit.org/show_bug.cgi?id=135740
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/TimelineDataGrid.css:
+        (.data-grid.timeline.has-non-default-filter > .navigation-bar-container):
+        (.data-grid.timeline > .navigation-bar-container > .navigation-bar):
+        (body.mac-platform.legacy .data-grid.timeline > .navigation-bar-container > .navigation-bar):
+        Update the positioning and height for non-legacy because the console is now taller.
+
+        * UserInterface/Views/ScopeBar.js:
+        (WebInspector.ScopeBar.prototype.hasNonDefaultItemSelected):
+        Helper to know if there is a non-default filter.
+
+        * UserInterface/Views/TimelineDataGrid.js:
+        (WebInspector.TimelineDataGrid.prototype.treeElementMatchesActiveScopeFilters):
+        (WebInspector.TimelineDataGrid.prototype._scopeBarSelectedItemsDidChange):
+        Update scope bar visibility. If non-default we want to always show it.
+        
+        (WebInspector.TimelineDataGrid.prototype._updateScopeBarForcedVisibility):
+        If there is a non-default filter, force showing the bar.
+
+2014-08-07  Joseph Pecoraro  <pecoraro@apple.com>
+
         Web Inspector: breakpoints enabled state is not persisted across re-opening the inspector
         https://bugs.webkit.org/show_bug.cgi?id=135745
 
index c173551..b341d9f 100644 (file)
@@ -62,6 +62,13 @@ WebInspector.ScopeBar.prototype = {
         });
     },
 
+    hasNonDefaultItemSelected: function()
+    {
+        return this._items.some(function(item) {
+            return item.selected && item !== this._defaultItem;
+        }, this);
+    },
+
     updateLayout: function(expandOnly)
     {
         if (expandOnly)
index 5085f9c..3ecb6e0 100644 (file)
     visibility: hidden;
 }
 
+.data-grid.timeline.has-non-default-filter > .navigation-bar-container {
+    visibility: visible;
+}
+
 .data-grid.timeline:hover > .navigation-bar-container {
     pointer-events: all;
     visibility: visible;
 
 .data-grid.timeline > .navigation-bar-container > .navigation-bar {
     position: absolute;
-    top: 10px;
+    top: 4px;
     left: 0;
     right: 0;
-    height: 22px;
+    height: 28px;
 
     border-bottom: none;
     border-top: 1px solid rgb(200, 200, 200);
     background-color: white;
 }
 
+body.mac-platform.legacy .data-grid.timeline > .navigation-bar-container > .navigation-bar {
+    top: 10px;
+    height: 22px;
+}
+
 .timeline-data-grid-tree-outline {
     position: relative;
     padding: 0;
index c22199a..0b9eae6 100644 (file)
@@ -35,11 +35,11 @@ WebInspector.TimelineDataGrid = function(treeOutline, columns, delegate, editCal
 
     // Check if any of the cells can be filtered.
     for (var [identifier, column] of this.columns) {
-        var scopeBar = columns["scopeBar"];
+        var scopeBar = column.scopeBar;
         if (!scopeBar)
             continue;
         this._filterableColumns.push(identifier);
-        scopeBar.columnIdenfifier = identifier;
+        scopeBar.columnIdentifier = identifier;
         scopeBar.addEventListener(WebInspector.ScopeBar.Event.SelectionChanged, this._scopeBarSelectedItemsDidChange, this);
     }
 
@@ -49,11 +49,13 @@ WebInspector.TimelineDataGrid = function(treeOutline, columns, delegate, editCal
     }
 
     if (this._filterableColumns.length) {
-        var items = [new WebInspector.FlexibleSpaceNavigationItem, this.columns.get(this._filterableColumns[0])["scopeBar"], new WebInspector.FlexibleSpaceNavigationItem];
+        var items = [new WebInspector.FlexibleSpaceNavigationItem, this.columns.get(this._filterableColumns[0]).scopeBar, new WebInspector.FlexibleSpaceNavigationItem];
         this._navigationBar = new WebInspector.NavigationBar(null, items);
         var container = this.element.appendChild(document.createElement("div"));
         container.className = "navigation-bar-container";
         container.appendChild(this._navigationBar.element);
+
+        this._updateScopeBarForcedVisibility();
     }
 
     this.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridSelectedNodeChanged, this);
@@ -63,6 +65,7 @@ WebInspector.TimelineDataGrid = function(treeOutline, columns, delegate, editCal
 }
 
 WebInspector.TimelineDataGrid.StyleClassName = "timeline";
+WebInspector.TimelineDataGrid.HasNonDefaultFilterStyleClassName = "has-non-default-filter";
 WebInspector.TimelineDataGrid.DelayedPopoverShowTimeout = 250;
 WebInspector.TimelineDataGrid.DelayedPopoverHideContentClearTimeout = 500;
 
@@ -149,7 +152,7 @@ WebInspector.TimelineDataGrid.prototype = {
         console.assert(dataGridNode);
 
         for (var identifier of this._filterableColumns) {
-            var scopeBar = this.columns.get(identifier)["scopeBar"];
+            var scopeBar = this.columns.get(identifier).scopeBar;
             if (!scopeBar || scopeBar.defaultItem.selected)
                 continue;
 
@@ -353,9 +356,22 @@ WebInspector.TimelineDataGrid.prototype = {
         return (value1 < value2 ? -1 : (value1 > value2 ? 1 : 0)) * sortDirection;
     },
 
+    _updateScopeBarForcedVisibility: function()
+    {
+        for (var identifier of this._filterableColumns) {
+            var scopeBar = this.columns.get(identifier).scopeBar;
+            if (scopeBar) {
+                this.element.classList.toggle(WebInspector.TimelineDataGrid.HasNonDefaultFilterStyleClassName, scopeBar.hasNonDefaultItemSelected());
+                break;
+            }
+        }
+    },
+
     _scopeBarSelectedItemsDidChange: function(event)
     {
-        var columnIdentifier = event.target.columnIdenfifier;
+        this._updateScopeBarForcedVisibility();
+
+        var columnIdentifier = event.target.columnIdentifier;
         this.dispatchEventToListeners(WebInspector.TimelineDataGrid.Event.FiltersDidChange, {columnIdentifier: columnIdentifier});
     },