diff --git a/devtools/client/inspector/inspector.js b/devtools/client/inspector/inspector.js index f6c583b7b538..a03fa3a5fbff 100644 --- a/devtools/client/inspector/inspector.js +++ b/devtools/client/inspector/inspector.js @@ -1454,7 +1454,6 @@ Inspector.prototype = { this._search = null; } - const cssPropertiesDestroyer = this._cssProperties.front.destroy(); const sidebarDestroyer = this.sidebar.destroy(); const ruleViewSideBarDestroyer = this.ruleViewSideBar ? this.ruleViewSideBar.destroy() : null; @@ -1487,7 +1486,6 @@ Inspector.prototype = { this.telemetry = null; this._panelDestroyer = promise.all([ - cssPropertiesDestroyer, markupDestroyer, sidebarDestroyer, ruleViewSideBarDestroyer diff --git a/devtools/server/tests/mochitest/test_css-properties.html b/devtools/server/tests/mochitest/test_css-properties.html index c642dbc94045..ade59439b883 100644 --- a/devtools/server/tests/mochitest/test_css-properties.html +++ b/devtools/server/tests/mochitest/test_css-properties.html @@ -15,6 +15,8 @@ Bug 1265798 - Replace inIDOMUtils.cssPropertyIsShorthand window.onload = function() { const { initCssProperties, getCssProperties } = require("devtools/shared/fronts/css-properties"); + const { getFront } = + require("devtools/shared/protocol"); function promiseAttachUrl(url) { return new Promise((resolve, reject) => { @@ -41,7 +43,8 @@ window.onload = function() { target: { hasActor: () => useActor, client: attachmentA.client, - form: attachmentA.tab + form: attachmentA.tab, + getFront: typeName => getFront(attachmentA.client, typeName, attachmentA.tab) }, // Fake the window for css-properties.js's getClientBrowserVersion to work win: window @@ -50,7 +53,8 @@ window.onload = function() { target: { hasActor: () => useActor, client: attachmentB.client, - form: attachmentB.tab + form: attachmentB.tab, + getFront: typeName => getFront(attachmentB.client, typeName, attachmentB.tab) }, win: window }; diff --git a/devtools/shared/fronts/css-properties.js b/devtools/shared/fronts/css-properties.js index c20be6496d9d..58ca33051b60 100644 --- a/devtools/shared/fronts/css-properties.js +++ b/devtools/shared/fronts/css-properties.js @@ -237,7 +237,7 @@ const initCssProperties = async function(toolbox) { // Get the list dynamically if the cssProperties actor exists. if (toolbox.target.hasActor("cssProperties")) { - front = CssPropertiesFront(client, toolbox.target.form); + front = toolbox.target.getFront("cssProperties"); db = await front.getCSSDatabase(); } else { // The target does not support this actor, so require a static list of supported