From 6c847e7936cae317cffeca8b8d6db3b061a083d4 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Wed, 22 Nov 2023 09:37:37 +0000 Subject: [PATCH] Bug 1865264 - [devtools] Remove CssRule/CssSheet unused `source` getters. r=devtools-reviewers,ochameau. test_css-logic-media-queries.html was only checking this property, and we have a mochitest equivalent checking the UI (browser_rules_media-queries.js), so we remove it. Depends on D193872 Differential Revision: https://phabricator.services.mozilla.com/D193873 --- devtools/server/actors/inspector/css-logic.js | 23 -------- devtools/server/tests/chrome/chrome.toml | 2 - .../chrome/test_css-logic-media-queries.html | 57 ------------------- 3 files changed, 82 deletions(-) delete mode 100644 devtools/server/tests/chrome/test_css-logic-media-queries.html diff --git a/devtools/server/actors/inspector/css-logic.js b/devtools/server/actors/inspector/css-logic.js index d3483de98c0f..caba27835539 100644 --- a/devtools/server/actors/inspector/css-logic.js +++ b/devtools/server/actors/inspector/css-logic.js @@ -31,7 +31,6 @@ const nodeConstants = require("resource://devtools/shared/dom-node-constants.js" const { getBindingElementAndPseudo, getCSSStyleRules, - l10n, hasVisitedState, isAgentStylesheet, isAuthorStylesheet, @@ -964,7 +963,6 @@ class CssRule { this._selectors = null; this.line = InspectorUtils.getRelativeRuleLine(this.domRule); this.column = InspectorUtils.getRuleColumn(this.domRule); - this.source = this._cssSheet.shortSource + ":" + this.line; this.href = this._cssSheet.href; this.authorRule = this._cssSheet.authorSheet; this.userRule = this._cssSheet.userSheet; @@ -972,7 +970,6 @@ class CssRule { } else if (element) { this._selectors = [new CssSelector(this, "@element.style", 0)]; this.line = -1; - this.source = l10n("rule.sourceElement"); this.href = "#"; this.authorRule = true; this.userRule = false; @@ -1077,16 +1074,6 @@ class CssSelector { _matchId = null; - /** - * Retrieve the CssSelector source, which is the source of the CssSheet owning - * the selector. - * - * @return {string} the selector source. - */ - get source() { - return this.cssRule.source; - } - /** * Retrieve the CssSelector source element, which is the source of the CssRule * owning the selector. This is only available when the CssSelector comes from @@ -1404,16 +1391,6 @@ class CssSelectorInfo { } } - /** - * Retrieve the CssSelector source, which is the source of the CssSheet owning - * the selector. - * - * @return {string} the selector source. - */ - get source() { - return this.selector.source; - } - /** * Retrieve the CssSelector source element, which is the source of the CssRule * owning the selector. This is only available when the CssSelector comes from diff --git a/devtools/server/tests/chrome/chrome.toml b/devtools/server/tests/chrome/chrome.toml index 3209474b5f63..b67b1ee9714a 100644 --- a/devtools/server/tests/chrome/chrome.toml +++ b/devtools/server/tests/chrome/chrome.toml @@ -43,8 +43,6 @@ support-files = [ ["test_animation-type-longhand.html"] -["test_css-logic-media-queries.html"] - ["test_css-logic-specificity.html"] ["test_css-logic.html"] diff --git a/devtools/server/tests/chrome/test_css-logic-media-queries.html b/devtools/server/tests/chrome/test_css-logic-media-queries.html deleted file mode 100644 index 067cbbc4c350..000000000000 --- a/devtools/server/tests/chrome/test_css-logic-media-queries.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - Test css-logic media-queries - - - - - -
- - -