Changeset 243208 in webkit
- Timestamp:
- Mar 20, 2019, 9:28:16 AM (7 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Controllers/CSSManager.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r243207 r243208 1 2019-03-20 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: changes to CSS resources only take affect once editing stops 4 https://bugs.webkit.org/show_bug.cgi?id=195774 5 <rdar://problem/48905413> 6 7 Reviewed by Timothy Hatcher. 8 9 * UserInterface/Controllers/CSSManager.js: 10 (WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound): 11 (WI.CSSManager.prototype._resourceContentDidChange): 12 (WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent): 13 (WI.CSSManager.prototype._updateResourceContent): 14 Use a `Throttler` instead of a 500ms debounce. 15 1 16 2019-03-20 Devin Rousso <drousso@apple.com> 2 17 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js
r243038 r243208 642 642 function styleSheetFound(styleSheet) 643 643 { 644 resource.__pendingChangeTimeout = undefined;644 resource.__pendingChangeTimeout.cancel(); 645 645 646 646 console.assert(styleSheet); … … 658 658 } 659 659 660 if ( resource.__pendingChangeTimeout)661 clearTimeout(resource.__pendingChangeTimeout);662 resource.__pendingChangeTimeout = setTimeout(applyStyleSheetChanges.bind(this), 500);660 if (!resource.__pendingChangeTimeout) 661 resource.__pendingChangeTimeout = new Throttler(applyStyleSheetChanges.bind(this), 100); 662 resource.__pendingChangeTimeout.fire(); 663 663 } 664 664 … … 669 669 function fetchedStyleSheetContent(parameters) 670 670 { 671 styleSheet.__pendingChangeTimeout.cancel(); 672 671 673 let representedObject = parameters.sourceCode; 672 representedObject.__pendingChangeTimeout = undefined;673 674 674 675 console.assert(representedObject.url); … … 717 718 } 718 719 719 if ( styleSheet.__pendingChangeTimeout)720 clearTimeout(styleSheet.__pendingChangeTimeout);721 styleSheet.__pendingChangeTimeout = setTimeout(applyStyleSheetChanges.bind(this), 500);720 if (!styleSheet.__pendingChangeTimeout) 721 styleSheet.__pendingChangeTimeout = new Throttler(applyStyleSheetChanges.bind(this), 100); 722 styleSheet.__pendingChangeTimeout.fire(); 722 723 } 723 724 };
Note:
See TracChangeset
for help on using the changeset viewer.