Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1216)

Unified Diff: Source/devtools/front_end/MetricsSidebarPane.js

Issue 84643002: Update the metrics side bar pane and computed style pane after main frame resize. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Throttling the pane updates! Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/MetricsSidebarPane.js
diff --git a/Source/devtools/front_end/MetricsSidebarPane.js b/Source/devtools/front_end/MetricsSidebarPane.js
index 7d97539e8a259df6f76d0b69c9a6e97a7f8cf1b6..2ee72494f74353f169ee7fefcc1ff740c87b5411 100644
--- a/Source/devtools/front_end/MetricsSidebarPane.js
+++ b/Source/devtools/front_end/MetricsSidebarPane.js
@@ -38,6 +38,7 @@ WebInspector.MetricsSidebarPane = function()
WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged, this._styleSheetOrMediaQueryResultChanged, this);
WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModified, this._attributesUpdated, this);
WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemoved, this._attributesUpdated, this);
+ WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameResized, this._frameResized, this);
}
WebInspector.MetricsSidebarPane.prototype = {
@@ -88,6 +89,20 @@ WebInspector.MetricsSidebarPane.prototype = {
this._innerUpdate();
},
+ _frameResized: function()
+ {
+ function refreshContents()
+ {
+ this._innerUpdate();
+ delete this._activeTimer;
+ }
+
+ if (this._activeTimer)
+ clearTimeout(this._activeTimer);
+
+ this._activeTimer = setTimeout(refreshContents.bind(this), 100);
+ },
+
_attributesUpdated: function(event)
{
if (this.node !== event.data.node)

Powered by Google App Engine
This is Rietveld 408576698