Title: [281441] trunk/Source/WebInspectorUI
Revision
281441
Author
rcali...@apple.com
Date
2021-08-23 07:20:50 -0700 (Mon, 23 Aug 2021)

Log Message

Web Inspector: CSS Changes: changes are not updated live
https://bugs.webkit.org/show_bug.cgi?id=229153
<rdar://problem/81989328>

Reviewed by Devin Rousso.

Dispatch an event whenever the list of modified styles changes.
Re-layout the Changes details sidebar panel in response to this event
to reflect the latest state of the modified styles.

* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype.addModifiedStyle):
(WI.CSSManager.prototype.removeModifiedStyle):
* UserInterface/Views/ChangesDetailsSidebarPanel.js:
(WI.ChangesDetailsSidebarPanel.prototype.attached):
(WI.ChangesDetailsSidebarPanel.prototype.detached):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (281440 => 281441)


--- trunk/Source/WebInspectorUI/ChangeLog	2021-08-23 13:22:29 UTC (rev 281440)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-08-23 14:20:50 UTC (rev 281441)
@@ -1,3 +1,22 @@
+2021-08-23  Razvan Caliman  <rcali...@apple.com>
+
+        Web Inspector: CSS Changes: changes are not updated live
+        https://bugs.webkit.org/show_bug.cgi?id=229153
+        <rdar://problem/81989328>
+
+        Reviewed by Devin Rousso.
+
+        Dispatch an event whenever the list of modified styles changes.
+        Re-layout the Changes details sidebar panel in response to this event
+        to reflect the latest state of the modified styles.
+
+        * UserInterface/Controllers/CSSManager.js:
+        (WI.CSSManager.prototype.addModifiedStyle):
+        (WI.CSSManager.prototype.removeModifiedStyle):
+        * UserInterface/Views/ChangesDetailsSidebarPanel.js:
+        (WI.ChangesDetailsSidebarPanel.prototype.attached):
+        (WI.ChangesDetailsSidebarPanel.prototype.detached):
+
 2021-08-19  Alex Christensen  <achristen...@webkit.org>
 
         Remove more non-inclusive language from Source

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js (281440 => 281441)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js	2021-08-23 13:22:29 UTC (rev 281440)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js	2021-08-23 14:20:50 UTC (rev 281441)
@@ -355,6 +355,8 @@
     addModifiedStyle(style)
     {
         this._modifiedStyles.set(style.stringId, style);
+
+        this.dispatchEventToListeners(WI.CSSManager.Event.ModifiedStylesChanged);
     }
 
     getModifiedStyle(style)
@@ -365,6 +367,8 @@
     removeModifiedStyle(style)
     {
         this._modifiedStyles.delete(style.stringId);
+
+        this.dispatchEventToListeners(WI.CSSManager.Event.ModifiedStylesChanged);
     }
 
     // PageObserver
@@ -674,6 +678,7 @@
 WI.CSSManager.Event = {
     StyleSheetAdded: "css-manager-style-sheet-added",
     StyleSheetRemoved: "css-manager-style-sheet-removed",
+    ModifiedStylesChanged: "css-manager-modified-styles-changed",
     DefaultAppearanceDidChange: "css-manager-default-appearance-did-change",
     ForcedAppearanceDidChange: "css-manager-forced-appearance-did-change",
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ChangesDetailsSidebarPanel.js (281440 => 281441)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ChangesDetailsSidebarPanel.js	2021-08-23 13:22:29 UTC (rev 281440)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ChangesDetailsSidebarPanel.js	2021-08-23 14:20:50 UTC (rev 281441)
@@ -45,11 +45,13 @@
         super.attached();
 
         WI.Frame.addEventListener(WI.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+        WI.CSSManager.addEventListener(WI.CSSManager.Event.ModifiedStylesChanged, this.needsLayout, this);
     }
 
     detached()
     {
         WI.Frame.removeEventListener(WI.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+        WI.CSSManager.removeEventListener(WI.CSSManager.Event.ModifiedStylesChanged, this.needsLayout, this);
 
         super.detached();
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to