Commit Graph
6 Commits
Author SHA1 Message Date
Razvan Caliman dae53fa356 Bug 1525326 - Remove backwards compatibility for custom unique ids for rules and stylesheets. r=gl
Since Firefox 67 tracked changes have unique identifiers as follows:
- ruleId => StyleRuleActor.actorID
- sourceId => StylesheetActor.actorID

Given that we're at Firefox 70 and beyond the window where we support connecting to servers older than 3 versions, this patch removes the backwards compatibility provided by methods to generate unique ids  based on attributes of the rule and stylesheet for the tracked change.

Differential Revision: https://phabricator.services.mozilla.com/D37591
2019-07-10 19:51:57 +00:00
Victor Porof b7732ae890 Bug 1561435 - Format devtools/client/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35884
2019-07-05 11:24:38 +02:00
Razvan Caliman c2fd09d549 Bug 1527924 - (Part 1) Use array of selectors for the rule in Redux structure for Changes. r=pbro
Refactors the Redux state for the Changes panel so that rules have
a `selectors` array instead of just a single `selector` string.

The `selectors` array represents the **history** of selector text the
rule has over time, not the actual list of multiple selectors it has
(multiple selectors are collapsed into a single comma-separated string
regardless of how many they are).

When the server logs changes, the rule's selector text is checked
against the history of previously logged selectors.

If the incoming selector is different than the _first_ item in
the tracked rule's `selectors` array, it means the selector was renamed
so it is pushed onto the array (added to the history).

If it's the same, the whole array can be reduced to the original value
because it means that either:
- the selector didn't change between operations (ex: after declaration changes)
- the selector reverted back to its original name.

This `selectors` array is used in the React component in Part 2 of this
series to render any necessary diff view of the selector.

The old approach (whole rule removal + whole rule addition) is replaced
by this refactor. The introduction of the StyleRyleActor actor id from
the server as the rule id on the client in Bug 1525238 means that the
selector change can no longer behave like two distinct rules.
The actorID/rule id are preserved after selector renames. This necessary
for the some export options to work consistently (like Copy Rule with changes applied).

Differential Revision: https://phabricator.services.mozilla.com/D19828
2019-02-15 16:58:58 +00:00
Razvan Caliman 5d8e8e0263 Bug 1503924 - Mark style sources from iframes in the Changes panel. r=gl
Depends on D12590

Differential Revision: https://phabricator.services.mozilla.com/D12697
2018-11-26 05:02:06 +00:00
Razvan Caliman 15791ed77b Bug 1503924 - Trim source URLs to filename in Changes panel. r=gl
Differential Revision: https://phabricator.services.mozilla.com/D12588
2018-11-23 16:25:18 +00:00
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