Bug 1448096 - Throttle the inspector window resize handler with requestIdleCallback. r=bgrins
MozReview-Commit-ID: 7UwTDAR0JDs
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -521,18 +521,21 @@ Inspector.prototype = {
this.sidebar.off("destroy", this.onSidebarHidden);
},
/**
* If Toolbox width is less than 600 px, the splitter changes its mode
* to `horizontal` to support portrait view.
*/
onPanelWindowResize: function() {
- this.splitBox.setState({
- vert: this.useLandscapeMode(),
+ this.panelWin.cancelIdleCallback(this._resizeTimerId);
+ this._resizeTimerId = this.panelWin.requestIdleCallback(() => {
+ this.splitBox.setState({
+ vert: this.useLandscapeMode(),
+ });
});
},
getSidebarSize: function() {
let width;
let height;
let splitSidebarWidth;