Web Inspector: Global Breakpoints should always be visible
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Dec 2015 20:42:42 +0000 (20:42 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Dec 2015 20:42:42 +0000 (20:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151066

Reviewed by Timothy Hatcher.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
Turn off filtering for Global Breakpoints elements.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype.suppressFilteringOnTreeElements):
Allow filtering to be turned off for specific tree elements.
(WebInspector.NavigationSidebarPanel.prototype.applyFiltersToTreeElement):
Make element visible if filtering suppressed.
(WebInspector.NavigationSidebarPanel.prototype._checkForEmptyFilterResults):
Visible elements with filtering disabled aren't considered when
showing/hiding the empty content placeholder.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js

index f75bddf..6e13a24 100644 (file)
@@ -1,3 +1,23 @@
+2015-12-08  Matt Baker  <mattbaker@apple.com>
+
+        Web Inspector: Global Breakpoints should always be visible
+        https://bugs.webkit.org/show_bug.cgi?id=151066
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel):
+        Turn off filtering for Global Breakpoints elements.
+
+        * UserInterface/Views/NavigationSidebarPanel.js:
+        (WebInspector.NavigationSidebarPanel.prototype.suppressFilteringOnTreeElements):
+        Allow filtering to be turned off for specific tree elements.
+        (WebInspector.NavigationSidebarPanel.prototype.applyFiltersToTreeElement):
+        Make element visible if filtering suppressed.
+        (WebInspector.NavigationSidebarPanel.prototype._checkForEmptyFilterResults):
+        Visible elements with filtering disabled aren't considered when
+        showing/hiding the empty content placeholder.
+
 2015-12-07  Brian Burg  <bburg@apple.com>
 
         Web Inspector: Uncaught Exception page should have better styles and handle more error cases
index 5c09cef..8b563b8 100644 (file)
@@ -122,6 +122,8 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
         this._globalBreakpointsFolderTreeElement.appendChild(this._allUncaughtExceptionsBreakpointTreeElement);
         this._globalBreakpointsFolderTreeElement.expand();
 
+        this.suppressFilteringOnTreeElements([this._globalBreakpointsFolderTreeElement, this._allExceptionsBreakpointTreeElement, this._allUncaughtExceptionsBreakpointTreeElement]);
+
         var breakpointsRow = new WebInspector.DetailsSectionRow;
         breakpointsRow.element.appendChild(this._breakpointsContentTreeOutline.element);
 
index 9591a96..5ad3dd6 100644 (file)
@@ -177,6 +177,16 @@ WebInspector.NavigationSidebarPanel = class NavigationSidebarPanel extends WebIn
         return contentTreeOutline;
     }
 
+    suppressFilteringOnTreeElements(treeElements)
+    {
+        console.assert(Array.isArray(treeElements), "TreeElements should be an array.");
+
+        for (let treeElement of treeElements)
+            treeElement[WebInspector.NavigationSidebarPanel.SuppressFilteringSymbol] = true;
+
+        this._updateFilter();
+    }
+
     treeElementForRepresentedObject(representedObject)
     {
         return this._contentTreeOutline.getCachedTreeElement(representedObject);
@@ -385,7 +395,9 @@ WebInspector.NavigationSidebarPanel = class NavigationSidebarPanel extends WebIn
             }
         }
 
-        if (matchTextFilter(filterableData.text) && this.matchTreeElementAgainstFilterFunctions(treeElement, flags) && this.matchTreeElementAgainstCustomFilters(treeElement, flags)) {
+        let suppressFiltering = treeElement[WebInspector.NavigationSidebarPanel.SuppressFilteringSymbol];
+
+        if (suppressFiltering || (matchTextFilter(filterableData.text) && this.matchTreeElementAgainstFilterFunctions(treeElement, flags) && this.matchTreeElementAgainstCustomFilters(treeElement, flags))) {
             // Make this element visible since it matches.
             makeVisible();
 
@@ -498,7 +510,7 @@ WebInspector.NavigationSidebarPanel = class NavigationSidebarPanel extends WebIn
         // Iterate over all the top level tree elements. If any are visible, return early.
         var currentTreeElement = this._contentTreeOutline.children[0];
         while (currentTreeElement) {
-            if (!currentTreeElement.hidden) {
+            if (!currentTreeElement.hidden && !currentTreeElement[WebInspector.NavigationSidebarPanel.SuppressFilteringSymbol]) {
                 // Not hidden, so hide any empty content message.
                 this.hideEmptyContentPlaceholder();
                 this._emptyFilterResults = false;
@@ -717,6 +729,7 @@ WebInspector.NavigationSidebarPanel = class NavigationSidebarPanel extends WebIn
     }
 };
 
+WebInspector.NavigationSidebarPanel.SuppressFilteringSymbol = Symbol("supresss-filtering");
 WebInspector.NavigationSidebarPanel.WasExpandedDuringFilteringSymbol = Symbol("was-expanded-during-filtering");
 
 WebInspector.NavigationSidebarPanel.OverflowShadowElementStyleClassName = "overflow-shadow";