Changeset 281441 in webkit


Ignore:
Timestamp:
Aug 23, 2021 7:20:50 AM (11 months ago)
Author:
Razvan Caliman
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):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r281258 r281441  
     12021-08-23  Razvan Caliman  <rcaliman@apple.com>
     2
     3        Web Inspector: CSS Changes: changes are not updated live
     4        https://bugs.webkit.org/show_bug.cgi?id=229153
     5        <rdar://problem/81989328>
     6
     7        Reviewed by Devin Rousso.
     8
     9        Dispatch an event whenever the list of modified styles changes.
     10        Re-layout the Changes details sidebar panel in response to this event
     11        to reflect the latest state of the modified styles.
     12
     13        * UserInterface/Controllers/CSSManager.js:
     14        (WI.CSSManager.prototype.addModifiedStyle):
     15        (WI.CSSManager.prototype.removeModifiedStyle):
     16        * UserInterface/Views/ChangesDetailsSidebarPanel.js:
     17        (WI.ChangesDetailsSidebarPanel.prototype.attached):
     18        (WI.ChangesDetailsSidebarPanel.prototype.detached):
     19
    1202021-08-19  Alex Christensen  <achristensen@webkit.org>
    221
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js

    r281229 r281441  
    356356    {
    357357        this._modifiedStyles.set(style.stringId, style);
     358
     359        this.dispatchEventToListeners(WI.CSSManager.Event.ModifiedStylesChanged);
    358360    }
    359361
     
    366368    {
    367369        this._modifiedStyles.delete(style.stringId);
     370
     371        this.dispatchEventToListeners(WI.CSSManager.Event.ModifiedStylesChanged);
    368372    }
    369373
     
    675679    StyleSheetAdded: "css-manager-style-sheet-added",
    676680    StyleSheetRemoved: "css-manager-style-sheet-removed",
     681    ModifiedStylesChanged: "css-manager-modified-styles-changed",
    677682    DefaultAppearanceDidChange: "css-manager-default-appearance-did-change",
    678683    ForcedAppearanceDidChange: "css-manager-forced-appearance-did-change",
  • trunk/Source/WebInspectorUI/UserInterface/Views/ChangesDetailsSidebarPanel.js

    r281139 r281441  
    4646
    4747        WI.Frame.addEventListener(WI.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
     48        WI.CSSManager.addEventListener(WI.CSSManager.Event.ModifiedStylesChanged, this.needsLayout, this);
    4849    }
    4950
     
    5152    {
    5253        WI.Frame.removeEventListener(WI.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
     54        WI.CSSManager.removeEventListener(WI.CSSManager.Event.ModifiedStylesChanged, this.needsLayout, this);
    5355
    5456        super.detached();
Note: See TracChangeset for help on using the changeset viewer.