Title: [199790] trunk/Source/WebInspectorUI
- Revision
- 199790
- Author
- [email protected]
- Date
- 2016-04-20 14:58:46 -0700 (Wed, 20 Apr 2016)
Log Message
Web Inspector: Use debounce proxies in a couple more places
https://bugs.webkit.org/show_bug.cgi?id=156759
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ContentBrowser.js:
(WebInspector.ContentBrowser.prototype._dispatchCurrentRepresentedObjectsDidChangeEvent):
(WebInspector.ContentBrowser.prototype._contentViewSelectionPathComponentDidChange):
(WebInspector.ContentBrowser.prototype._contentViewSupplementalRepresentedObjectsDidChange):
(WebInspector.ContentBrowser.prototype._dispatchCurrentRepresentedObjectsDidChangeEventSoon): Deleted.
* UserInterface/Views/DOMTreeUpdater.js:
(WebInspector.DOMTreeUpdater.prototype._attributesUpdated):
(WebInspector.DOMTreeUpdater.prototype._characterDataModified):
(WebInspector.DOMTreeUpdater.prototype._nodeInserted):
(WebInspector.DOMTreeUpdater.prototype._nodeRemoved):
(WebInspector.DOMTreeUpdater.prototype._updateModifiedNodes):
(WebInspector.DOMTreeUpdater.prototype._updateModifiedNodesSoon): Deleted.
* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel):
(WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):
(WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
(WebInspector.NavigationSidebarPanel.prototype._treeElementDisclosureDidChange):
(WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibilitySoon): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (199789 => 199790)
--- trunk/Source/WebInspectorUI/ChangeLog 2016-04-20 21:58:44 UTC (rev 199789)
+++ trunk/Source/WebInspectorUI/ChangeLog 2016-04-20 21:58:46 UTC (rev 199790)
@@ -1,5 +1,32 @@
2016-04-19 Timothy Hatcher <[email protected]>
+ Web Inspector: Use debounce proxies in a couple more places
+
+ https://bugs.webkit.org/show_bug.cgi?id=156759
+
+ Reviewed by Joseph Pecoraro.
+
+ * UserInterface/Views/ContentBrowser.js:
+ (WebInspector.ContentBrowser.prototype._dispatchCurrentRepresentedObjectsDidChangeEvent):
+ (WebInspector.ContentBrowser.prototype._contentViewSelectionPathComponentDidChange):
+ (WebInspector.ContentBrowser.prototype._contentViewSupplementalRepresentedObjectsDidChange):
+ (WebInspector.ContentBrowser.prototype._dispatchCurrentRepresentedObjectsDidChangeEventSoon): Deleted.
+ * UserInterface/Views/DOMTreeUpdater.js:
+ (WebInspector.DOMTreeUpdater.prototype._attributesUpdated):
+ (WebInspector.DOMTreeUpdater.prototype._characterDataModified):
+ (WebInspector.DOMTreeUpdater.prototype._nodeInserted):
+ (WebInspector.DOMTreeUpdater.prototype._nodeRemoved):
+ (WebInspector.DOMTreeUpdater.prototype._updateModifiedNodes):
+ (WebInspector.DOMTreeUpdater.prototype._updateModifiedNodesSoon): Deleted.
+ * UserInterface/Views/NavigationSidebarPanel.js:
+ (WebInspector.NavigationSidebarPanel):
+ (WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):
+ (WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
+ (WebInspector.NavigationSidebarPanel.prototype._treeElementDisclosureDidChange):
+ (WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibilitySoon): Deleted.
+
+2016-04-19 Timothy Hatcher <[email protected]>
+
Web Inspector: Make debounce use an ES6 Proxy
https://bugs.webkit.org/show_bug.cgi?id=156756
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js (199789 => 199790)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js 2016-04-20 21:58:44 UTC (rev 199789)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js 2016-04-20 21:58:46 UTC (rev 199790)
@@ -421,19 +421,9 @@
}
}
- _dispatchCurrentRepresentedObjectsDidChangeEventSoon()
- {
- if (this._currentRepresentedObjectsDidChangeTimeout)
- return;
- this._currentRepresentedObjectsDidChangeTimeout = setTimeout(this._dispatchCurrentRepresentedObjectsDidChangeEvent.bind(this), 0);
- }
-
_dispatchCurrentRepresentedObjectsDidChangeEvent()
{
- if (this._currentRepresentedObjectsDidChangeTimeout) {
- clearTimeout(this._currentRepresentedObjectsDidChangeTimeout);
- delete this._currentRepresentedObjectsDidChangeTimeout;
- }
+ this._dispatchCurrentRepresentedObjectsDidChangeEvent.cancelDebounce();
this.dispatchEventToListeners(WebInspector.ContentBrowser.Event.CurrentRepresentedObjectsDidChange);
}
@@ -450,7 +440,7 @@
this._navigationBar.needsLayout();
- this._dispatchCurrentRepresentedObjectsDidChangeEventSoon();
+ this.soon._dispatchCurrentRepresentedObjectsDidChangeEvent();
}
_contentViewSupplementalRepresentedObjectsDidChange(event)
@@ -458,7 +448,7 @@
if (event.target !== this.currentContentView)
return;
- this._dispatchCurrentRepresentedObjectsDidChangeEventSoon();
+ this.soon._dispatchCurrentRepresentedObjectsDidChangeEvent();
}
_currentContentViewDidChange(event)
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js (199789 => 199790)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js 2016-04-20 21:58:44 UTC (rev 199789)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js 2016-04-20 21:58:46 UTC (rev 199790)
@@ -57,28 +57,28 @@
{
this._recentlyModifiedNodes.push({node: event.data.node, updated: true, attribute: event.data.name});
if (this._treeOutline._visible)
- this._updateModifiedNodesSoon();
+ this.soon._updateModifiedNodes();
},
_characterDataModified: function(event)
{
this._recentlyModifiedNodes.push({node: event.data.node, updated: true});
if (this._treeOutline._visible)
- this._updateModifiedNodesSoon();
+ this.soon._updateModifiedNodes();
},
_nodeInserted: function(event)
{
this._recentlyModifiedNodes.push({node: event.data.node, parent: event.data.parent, inserted: true});
if (this._treeOutline._visible)
- this._updateModifiedNodesSoon();
+ this.soon._updateModifiedNodes();
},
_nodeRemoved: function(event)
{
this._recentlyModifiedNodes.push({node: event.data.node, parent: event.data.parent, removed: true});
if (this._treeOutline._visible)
- this._updateModifiedNodesSoon();
+ this.soon._updateModifiedNodes();
},
_childNodeCountUpdated: function(event)
@@ -88,19 +88,9 @@
treeElement.hasChildren = event.data.hasChildNodes();
},
- _updateModifiedNodesSoon: function()
- {
- if (this._updateModifiedNodesTimeout)
- return;
- this._updateModifiedNodesTimeout = setTimeout(this._updateModifiedNodes.bind(this), 0);
- },
-
_updateModifiedNodes: function()
{
- if (this._updateModifiedNodesTimeout) {
- clearTimeout(this._updateModifiedNodesTimeout);
- this._updateModifiedNodesTimeout = null;
- }
+ this._updateModifiedNodes.cancelDebounce();
let updatedParentTreeElements = [];
for (let recentlyModifiedNode of this._recentlyModifiedNodes) {
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js (199789 => 199790)
--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js 2016-04-20 21:58:44 UTC (rev 199789)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js 2016-04-20 21:58:46 UTC (rev 199790)
@@ -33,7 +33,7 @@
this._visibleContentTreeOutlines = new Set;
- this.contentView.element.addEventListener("scroll", this._updateContentOverflowShadowVisibilitySoon.bind(this));
+ this.contentView.element.addEventListener("scroll", this.soon._updateContentOverflowShadowVisibility);
this._contentTreeOutline = this.createContentTreeOutline(true);
this._selectedContentTreeOutline = null;
@@ -53,7 +53,7 @@
this.element.appendChild(this._topOverflowShadowElement);
}
- this._boundUpdateContentOverflowShadowVisibility = this._updateContentOverflowShadowVisibilitySoon.bind(this);
+ this._boundUpdateContentOverflowShadowVisibility = this.soon._updateContentOverflowShadowVisibility;
window.addEventListener("resize", this._boundUpdateContentOverflowShadowVisibility);
this._filtersSetting = new WebInspector.Setting(identifier + "-navigation-sidebar-filters", {});
@@ -486,18 +486,10 @@
}
// Private
-
- _updateContentOverflowShadowVisibilitySoon()
- {
- if (this._updateContentOverflowShadowVisibilityIdentifier)
- return;
- this._updateContentOverflowShadowVisibilityIdentifier = setTimeout(this._updateContentOverflowShadowVisibility.bind(this), 0);
- }
-
_updateContentOverflowShadowVisibility()
{
- this._updateContentOverflowShadowVisibilityIdentifier = undefined;
+ this._updateContentOverflowShadowVisibility.cancelDebounce();
let scrollHeight = this.contentView.element.scrollHeight;
let offsetHeight = this.contentView.element.offsetHeight;
@@ -636,7 +628,7 @@
}
this._checkForEmptyFilterResults();
- this._updateContentOverflowShadowVisibilitySoon();
+ this.soon._updateContentOverflowShadowVisibility();
if (this.selected)
this._checkElementsForPendingViewStateCookie([treeElement]);
@@ -646,7 +638,7 @@
_treeElementDisclosureDidChange(event)
{
- this._updateContentOverflowShadowVisibilitySoon();
+ this.soon._updateContentOverflowShadowVisibility();
}
_treeSelectionDidChange(event)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes