Title: [238843] trunk/Source/WebInspectorUI
Revision
238843
Author
[email protected]
Date
2018-12-03 22:01:16 -0800 (Mon, 03 Dec 2018)

Log Message

Web Inspector: Audit: save the expanded state of test groups
https://bugs.webkit.org/show_bug.cgi?id=192346
<rdar://problem/46440704>

Reviewed by Matt Baker.

* UserInterface/Views/AuditTreeElement.js:
(WI.AuditTreeElement):
(WI.AuditTreeElement.prototype.onattach):
(WI.AuditTreeElement.prototype.onexpand): Added.
(WI.AuditTreeElement.prototype.oncollapse): Added.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (238842 => 238843)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-12-04 04:06:55 UTC (rev 238842)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-12-04 06:01:16 UTC (rev 238843)
@@ -1,5 +1,19 @@
 2018-12-03  Devin Rousso  <[email protected]>
 
+        Web Inspector: Audit: save the expanded state of test groups
+        https://bugs.webkit.org/show_bug.cgi?id=192346
+        <rdar://problem/46440704>
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/AuditTreeElement.js:
+        (WI.AuditTreeElement):
+        (WI.AuditTreeElement.prototype.onattach):
+        (WI.AuditTreeElement.prototype.onexpand): Added.
+        (WI.AuditTreeElement.prototype.oncollapse): Added.
+
+2018-12-03  Devin Rousso  <[email protected]>
+
         Web Inspector: Audit: sidebar briefly shows "No Filter Results" before populating default audits
         https://bugs.webkit.org/show_bug.cgi?id=192341
         <rdar://problem/46436550>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/AuditTreeElement.js (238842 => 238843)


--- trunk/Source/WebInspectorUI/UserInterface/Views/AuditTreeElement.js	2018-12-04 04:06:55 UTC (rev 238842)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/AuditTreeElement.js	2018-12-04 06:01:16 UTC (rev 238843)
@@ -49,6 +49,9 @@
 
         const subtitle = null;
         super(classNames, representedObject.name, subtitle, representedObject, options);
+
+        if (isTestGroup)
+            this._expandedSetting = new WI.Setting(`audit-tree-element-${this.representedObject.name}-expanded`, false);
     }
 
     // Protected
@@ -66,6 +69,9 @@
                 this.representedObject.addEventListener(WI.AuditTestBase.Event.Scheduled, this._handleTestGroupScheduled, this);
         }
 
+        if (this._expandedSetting && this._expandedSetting.value)
+            this.expand();
+
         this._updateLevel();
     }
 
@@ -96,6 +102,22 @@
         }
     }
 
+    onexpand()
+    {
+        console.assert(this.expanded);
+
+        if (this._expandedSetting)
+            this._expandedSetting.value = this.expanded;
+    }
+
+    oncollapse()
+    {
+        console.assert(!this.expanded);
+
+        if (this._expandedSetting)
+            this._expandedSetting.value = this.expanded;
+    }
+
     ondelete()
     {
         if (!(this.representedObject instanceof WI.AuditTestBase))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to