Files
firefox/devtools/client/inspector/changes/actions/changes.js
T
Razvan Caliman 65cf5dbfda Bug 1499049 - (Part 3) Add new reducer logic for tracking CSS changes to nested rules; r=pbro
Depends on D8719

- Add methods to generate unique identifiers for stylesheets and CSS rules changed within those stylesheets. These are used as IDs in the Redux store;
- Add logic to generate entries in the store for each one of the rule's ancestors and assign parent/child dependencies. This single-level structure for all rules in a source helps with quickly identifying a rule on subsequent changes independent of its rule tree (it avoids needless tree traversal). The parent/child references help with rendering of the nested rule structure in the Changes panel;
- Deep clone Redux store state before aggregating tracked changes (no more mutations of previous state).

Differential Revision: https://phabricator.services.mozilla.com/D8720
2018-10-25 16:20:00 +00:00

28 lines
472 B
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const {
RESET_CHANGES,
TRACK_CHANGE,
} = require("./index");
module.exports = {
resetChanges() {
return {
type: RESET_CHANGES,
};
},
trackChange(change) {
return {
type: TRACK_CHANGE,
change,
};
},
};