Web Inspector: add filter for draw actions in Recordings
authorwebkit@devinrousso.com <webkit@devinrousso.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Aug 2017 00:57:42 +0000 (00:57 +0000)
committerwebkit@devinrousso.com <webkit@devinrousso.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Aug 2017 00:57:42 +0000 (00:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175448
<rdar://problem/34040764>

Reviewed by Matt Baker.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Views/RecordingNavigationSidebarPanel.js:
(WI.RecordingNavigationSidebarPanel.prototype.initialLayout):
(WI.RecordingNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters):
Add button to filter visual actions.
Drive-by fix: ensure that frame folders are still visible when filtering.

* UserInterface/Images/Paint.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/PaintFlashing.svg.
* UserInterface/Images/gtk/Paint.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/gtk/PaintFlashing.svg.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
Rename PaintFlashing.svg to Paint.svg.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Images/Paint.svg [moved from Source/WebInspectorUI/UserInterface/Images/PaintFlashing.svg with 100% similarity]
Source/WebInspectorUI/UserInterface/Images/gtk/Paint.svg [moved from Source/WebInspectorUI/UserInterface/Images/gtk/PaintFlashing.svg with 100% similarity]
Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js
Source/WebInspectorUI/UserInterface/Views/RecordingNavigationSidebarPanel.js

index 809c019..bc854cd 100644 (file)
@@ -1,3 +1,25 @@
+2017-08-24  Devin Rousso  <webkit@devinrousso.com>
+
+        Web Inspector: add filter for draw actions in Recordings
+        https://bugs.webkit.org/show_bug.cgi?id=175448
+        <rdar://problem/34040764>
+
+        Reviewed by Matt Baker.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        
+        * UserInterface/Views/RecordingNavigationSidebarPanel.js:
+        (WI.RecordingNavigationSidebarPanel.prototype.initialLayout):
+        (WI.RecordingNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters):
+        Add button to filter visual actions.
+        Drive-by fix: ensure that frame folders are still visible when filtering.
+
+        * UserInterface/Images/Paint.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/PaintFlashing.svg.
+        * UserInterface/Images/gtk/Paint.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/gtk/PaintFlashing.svg.
+        * UserInterface/Views/DOMTreeContentView.js:
+        (WI.DOMTreeContentView):
+        Rename PaintFlashing.svg to Paint.svg.
+
 2017-08-24  Ross Kirsling  <ross.kirsling@sony.com>
 
         Web Inspector: Create experimental Layers tab
index 824798f..03a1f85 100644 (file)
@@ -608,6 +608,7 @@ localizedStrings["Offset"] = "Offset";
 localizedStrings["Once"] = "Once";
 localizedStrings["Online"] = "Online";
 localizedStrings["Only show resources with issues"] = "Only show resources with issues";
+localizedStrings["Only show visual actions"] = "Only show visual actions";
 localizedStrings["Opacity"] = "Opacity";
 localizedStrings["Open"] = "Open";
 localizedStrings["Open Settings"] = "Open Settings";
@@ -791,6 +792,7 @@ localizedStrings["Show Path"] = "Show Path";
 localizedStrings["Show Remaining (%d)"] = "Show Remaining (%d)";
 localizedStrings["Show Scope Chain on pause"] = "Show Scope Chain on pause";
 localizedStrings["Show Source"] = "Show Source";
+localizedStrings["Show all actions"] = "Show all actions";
 localizedStrings["Show all resources"] = "Show all resources";
 localizedStrings["Show compositing borders"] = "Show compositing borders";
 localizedStrings["Show errors logged to the Console"] = "Show errors logged to the Console";
index 3cec6c5..6b1bc36 100644 (file)
@@ -36,7 +36,7 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView
         this._compositingBordersButtonNavigationItem.enabled = !!PageAgent.getCompositingBordersVisible;
 
         WI.showPaintRectsSetting.addEventListener(WI.Setting.Event.Changed, this._showPaintRectsSettingChanged, this);
-        this._paintFlashingButtonNavigationItem = new WI.ActivateButtonNavigationItem("paint-flashing", WI.UIString("Enable paint flashing"), WI.UIString("Disable paint flashing"), "Images/PaintFlashing.svg", 16, 16);
+        this._paintFlashingButtonNavigationItem = new WI.ActivateButtonNavigationItem("paint-flashing", WI.UIString("Enable paint flashing"), WI.UIString("Disable paint flashing"), "Images/Paint.svg", 16, 16);
         this._paintFlashingButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._togglePaintFlashing, this);
         this._paintFlashingButtonNavigationItem.enabled = !!PageAgent.setShowPaintRects;
         this._paintFlashingButtonNavigationItem.activated = PageAgent.setShowPaintRects && WI.showPaintRectsSetting.value;
index 6c298da..5576f2f 100644 (file)
@@ -140,6 +140,27 @@ WI.RecordingNavigationSidebarPanel = class RecordingNavigationSidebarPanel exten
 
         const element = null;
         this.addSubview(new WI.NavigationBar(element, [importNavigationItem, exportNavigationItem]));
+
+        let filterFunction = (treeElement) => {
+            if (!(treeElement instanceof WI.RecordingActionTreeElement))
+                return false;
+
+            return treeElement.representedObject.isVisual;
+        };
+
+        const activatedByDefault = false;
+        const defaultToolTip = WI.UIString("Only show visual actions");
+        const activatedToolTip = WI.UIString("Show all actions");
+        this.filterBar.addFilterBarButton("recording-show-visual-only", filterFunction, activatedByDefault, defaultToolTip, activatedToolTip, "Images/Paint.svg", 15, 15);
+    }
+
+    matchTreeElementAgainstCustomFilters(treeElement)
+    {
+        // Keep recording frame tree elements.
+        if (treeElement instanceof WI.FolderTreeElement)
+            return true;
+
+        return super.matchTreeElementAgainstCustomFilters(treeElement);
     }
 
     // Private