Title: [239449] trunk/Source/WebInspectorUI
Revision
239449
Author
[email protected]
Date
2018-12-20 10:15:46 -0800 (Thu, 20 Dec 2018)

Log Message

Web Inspector: Audits: don't cache default audits
https://bugs.webkit.org/show_bug.cgi?id=192918
<rdar://problem/46626543>

Reviewed by Brian Burg.

Instead of adding the default audits to the "audits" `WI.ObjectStore`, which preserves them
across WebInspector sessions, load them every time WebInspector is opened (unless there are
existing audits) so that the localized strings are able to respond to locale changes.

* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype.removeTest):
(WI.AuditManager.prototype.addDefaultTestsIfNeeded):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (239448 => 239449)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-12-20 18:14:52 UTC (rev 239448)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-12-20 18:15:46 UTC (rev 239449)
@@ -1,5 +1,21 @@
 2018-12-20  Devin Rousso  <[email protected]>
 
+        Web Inspector: Audits: don't cache default audits
+        https://bugs.webkit.org/show_bug.cgi?id=192918
+        <rdar://problem/46626543>
+
+        Reviewed by Brian Burg.
+
+        Instead of adding the default audits to the "audits" `WI.ObjectStore`, which preserves them
+        across WebInspector sessions, load them every time WebInspector is opened (unless there are
+        existing audits) so that the localized strings are able to respond to locale changes.
+
+        * UserInterface/Controllers/AuditManager.js:
+        (WI.AuditManager.prototype.removeTest):
+        (WI.AuditManager.prototype.addDefaultTestsIfNeeded):
+
+2018-12-20  Devin Rousso  <[email protected]>
+
         Web Inspector: Dark Mode: unreadable background color for tables containing object previews
         https://bugs.webkit.org/show_bug.cgi?id=192887
         <rdar://problem/46855270>

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/AuditManager.js (239448 => 239449)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/AuditManager.js	2018-12-20 18:14:52 UTC (rev 239448)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/AuditManager.js	2018-12-20 18:15:46 UTC (rev 239449)
@@ -172,7 +172,8 @@
 
         this.dispatchEventToListeners(WI.AuditManager.Event.TestRemoved, {test});
 
-        WI.objectStores.audits.deleteObject(test);
+        if (!test.__default)
+            WI.objectStores.audits.deleteObject(test);
     }
 
     // Private
@@ -253,8 +254,8 @@
         ];
 
         for (let test of defaultTests) {
+            test.__default = true;
             this._addTest(test);
-            WI.objectStores.audits.addObject(test);
         }
     }
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to