Title: [251429] trunk/Source/WebInspectorUI
Revision
251429
Author
[email protected]
Date
2019-10-22 07:46:03 -0700 (Tue, 22 Oct 2019)

Log Message

Web Inspector: REGRESSION: Sources: when editing style sheets, the content is sometimes suddenly replaced with the original content of the resource
https://bugs.webkit.org/show_bug.cgi?id=203235

Reviewed by Timothy Hatcher.

Each `WI.CSSStyleSheet` manages it's own state about when it should ignore events from the
backend telling it that it was modified, such as if the frontend caused the update. In these
cases, the `WI.CSSStyleSheet` itself was early-returning, but the `WI.CSSManager` wasn't,
meaning that the `WI.CSSManager` would then override the content even though the specific
`WI.CSSStyleSheet` knows that its content shouldn't update. To compound this issue, the
`WI.CSSManager` updates any `WI.CSSStyleSheet` using a `Throttler`, so any updates would be
further delayed (first by the protocol travel time) by this, leading to the timing based
intermittent issue. `WI.CSSStyleSheet` already exposes when it should be updated or not via
`WI.CSSStyleSheet.prototype.noteContentDidChange`. Rather than have `WI.CSSManager` just
call that function, it should examine the returned boolean to see if it should continue to
process the update, or if the `WI.CSSStyleSheet` knows that it should be ignored.

* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype.styleSheetChanged):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (251428 => 251429)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-10-22 11:34:03 UTC (rev 251428)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-10-22 14:46:03 UTC (rev 251429)
@@ -1,3 +1,25 @@
+2019-10-22  Devin Rousso  <[email protected]>
+
+        Web Inspector: REGRESSION: Sources: when editing style sheets, the content is sometimes suddenly replaced with the original content of the resource
+        https://bugs.webkit.org/show_bug.cgi?id=203235
+
+        Reviewed by Timothy Hatcher.
+
+        Each `WI.CSSStyleSheet` manages it's own state about when it should ignore events from the
+        backend telling it that it was modified, such as if the frontend caused the update. In these
+        cases, the `WI.CSSStyleSheet` itself was early-returning, but the `WI.CSSManager` wasn't,
+        meaning that the `WI.CSSManager` would then override the content even though the specific
+        `WI.CSSStyleSheet` knows that its content shouldn't update. To compound this issue, the
+        `WI.CSSManager` updates any `WI.CSSStyleSheet` using a `Throttler`, so any updates would be
+        further delayed (first by the protocol travel time) by this, leading to the timing based
+        intermittent issue. `WI.CSSStyleSheet` already exposes when it should be updated or not via
+        `WI.CSSStyleSheet.prototype.noteContentDidChange`. Rather than have `WI.CSSManager` just
+        call that function, it should examine the returned boolean to see if it should continue to
+        process the update, or if the `WI.CSSStyleSheet` knows that it should be ignored.
+
+        * UserInterface/Controllers/CSSManager.js:
+        (WI.CSSManager.prototype.styleSheetChanged):
+
 2019-10-21  Devin Rousso  <[email protected]>
 
         Web Inspector: REGRESSION(r251227): Uncaught Exception: undefined is not an object (evaluating 'agent.enable')

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js (251428 => 251429)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js	2019-10-22 11:34:03 UTC (rev 251428)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js	2019-10-22 14:46:03 UTC (rev 251429)
@@ -465,7 +465,9 @@
         if (styleSheet.isInlineStyleAttributeStyleSheet())
             return;
 
-        styleSheet.noteContentDidChange();
+        if (!styleSheet.noteContentDidChange())
+            return;
+
         this._updateResourceContent(styleSheet);
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to