Title: [243208] trunk/Source/WebInspectorUI
Revision
243208
Author
[email protected]
Date
2019-03-20 09:28:16 -0700 (Wed, 20 Mar 2019)

Log Message

Web Inspector: changes to CSS resources only take affect once editing stops
https://bugs.webkit.org/show_bug.cgi?id=195774
<rdar://problem/48905413>

Reviewed by Timothy Hatcher.

* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound):
(WI.CSSManager.prototype._resourceContentDidChange):
(WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
(WI.CSSManager.prototype._updateResourceContent):
Use a `Throttler` instead of a 500ms debounce.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (243207 => 243208)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-03-20 16:21:37 UTC (rev 243207)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-03-20 16:28:16 UTC (rev 243208)
@@ -1,5 +1,20 @@
 2019-03-20  Devin Rousso  <[email protected]>
 
+        Web Inspector: changes to CSS resources only take affect once editing stops
+        https://bugs.webkit.org/show_bug.cgi?id=195774
+        <rdar://problem/48905413>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Controllers/CSSManager.js:
+        (WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound):
+        (WI.CSSManager.prototype._resourceContentDidChange):
+        (WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
+        (WI.CSSManager.prototype._updateResourceContent):
+        Use a `Throttler` instead of a 500ms debounce.
+
+2019-03-20  Devin Rousso  <[email protected]>
+
         Web Inspector: Search: allow DOM searches to be case sensitive
         https://bugs.webkit.org/show_bug.cgi?id=194673
         <rdar://problem/48087577>

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js (243207 => 243208)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js	2019-03-20 16:21:37 UTC (rev 243207)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js	2019-03-20 16:28:16 UTC (rev 243208)
@@ -641,7 +641,7 @@
         {
             function styleSheetFound(styleSheet)
             {
-                resource.__pendingChangeTimeout = undefined;
+                resource.__pendingChangeTimeout.cancel();
 
                 console.assert(styleSheet);
                 if (!styleSheet)
@@ -657,9 +657,9 @@
             this._lookupStyleSheetForResource(resource, styleSheetFound.bind(this));
         }
 
-        if (resource.__pendingChangeTimeout)
-            clearTimeout(resource.__pendingChangeTimeout);
-        resource.__pendingChangeTimeout = setTimeout(applyStyleSheetChanges.bind(this), 500);
+        if (!resource.__pendingChangeTimeout)
+            resource.__pendingChangeTimeout = new Throttler(applyStyleSheetChanges.bind(this), 100);
+        resource.__pendingChangeTimeout.fire();
     }
 
     _updateResourceContent(styleSheet)
@@ -668,8 +668,9 @@
 
         function fetchedStyleSheetContent(parameters)
         {
+            styleSheet.__pendingChangeTimeout.cancel();
+
             let representedObject = parameters.sourceCode;
-            representedObject.__pendingChangeTimeout = undefined;
 
             console.assert(representedObject.url);
             if (!representedObject.url)
@@ -716,9 +717,9 @@
                 this._fetchInfoForAllStyleSheets(styleSheetReady.bind(this));
         }
 
-        if (styleSheet.__pendingChangeTimeout)
-            clearTimeout(styleSheet.__pendingChangeTimeout);
-        styleSheet.__pendingChangeTimeout = setTimeout(applyStyleSheetChanges.bind(this), 500);
+        if (!styleSheet.__pendingChangeTimeout)
+            styleSheet.__pendingChangeTimeout = new Throttler(applyStyleSheetChanges.bind(this), 100);
+        styleSheet.__pendingChangeTimeout.fire();
     }
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to