diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /devtools/client/inspector/changes | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/inspector/changes')
-rw-r--r-- | devtools/client/inspector/changes/reducers/changes.js | 2 | ||||
-rw-r--r-- | devtools/client/inspector/changes/selectors/changes.js | 31 |
2 files changed, 15 insertions, 18 deletions
diff --git a/devtools/client/inspector/changes/reducers/changes.js b/devtools/client/inspector/changes/reducers/changes.js index 23e82a3ba7..82a5a92ed7 100644 --- a/devtools/client/inspector/changes/reducers/changes.js +++ b/devtools/client/inspector/changes/reducers/changes.js @@ -371,7 +371,7 @@ const reducers = { return state; }, - [RESET_CHANGES](state) { + [RESET_CHANGES]() { return INITIAL_STATE; }, }; diff --git a/devtools/client/inspector/changes/selectors/changes.js b/devtools/client/inspector/changes/selectors/changes.js index a6b99e4579..a176e11082 100644 --- a/devtools/client/inspector/changes/selectors/changes.js +++ b/devtools/client/inspector/changes/selectors/changes.js @@ -65,7 +65,7 @@ function getChangesTree(state, filter = {}) { } return Object.entries(state) - .filter(([sourceId, source]) => { + .filter(([sourceId]) => { // Use only matching sources if an array to filter by was provided. if (sourceIdsFilter.length) { return sourceIdsFilter.includes(sourceId); @@ -87,7 +87,7 @@ function getChangesTree(state, filter = {}) { ...source, // Build a new collection of rules keyed by rule id. rules: Object.entries(rules) - .filter(([ruleId, rule]) => { + .filter(([ruleId]) => { // Use only matching rules if an array to filter by was provided. if (rulesIdsFilter.length) { return rulesIdsFilter.includes(ruleId); @@ -237,22 +237,19 @@ function getChangesStylesheet(state, filter) { } // Iterate through all sources in the change tree and build a CSS stylesheet string. - return Object.entries(changeTree).reduce( - (stylesheetText, [sourceId, source]) => { - const { href, rules } = source; - // Write code comment with source origin - stylesheetText += `\n/* ${getSourceForDisplay(source)} | ${href} */\n`; - // Write CSS rules - stylesheetText += Object.entries(rules).reduce((str, [ruleId, rule]) => { - // Add a new like only after top-level rules (level == 0) - str += writeRule(ruleId, rule, 0) + "\n"; - return str; - }, ""); + return Object.values(changeTree).reduce((stylesheetText, source) => { + const { href, rules } = source; + // Write code comment with source origin + stylesheetText += `\n/* ${getSourceForDisplay(source)} | ${href} */\n`; + // Write CSS rules + stylesheetText += Object.entries(rules).reduce((str, [ruleId, rule]) => { + // Add a new like only after top-level rules (level == 0) + str += writeRule(ruleId, rule, 0) + "\n"; + return str; + }, ""); - return stylesheetText; - }, - "" - ); + return stylesheetText; + }, ""); } module.exports = { |