mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-28 04:39:07 -10:00
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
28 lines
472 B
JavaScript
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,
|
|
};
|
|
},
|
|
|
|
};
|