Граф коммитов

106 Коммитов

Автор SHA1 Сообщение Дата
Razvan Caliman 8ff3343c9b Bug 1566891 - Remove expired telemetry probes for export options. r=pbro
Differential Revision: https://phabricator.services.mozilla.com/D55073

--HG--
extra : moz-landing-system : lando
2019-12-03 11:08:55 +00:00
Razvan Caliman ebcd20cc7b Bug 1598317 - Add tests for Changes panel export options. r=pbro
Differential Revision: https://phabricator.services.mozilla.com/D55072

--HG--
extra : moz-landing-system : lando
2019-12-02 16:30:00 +00:00
Razvan Caliman e6420217d8 Bug 1598317 - Refactor Changes panel context menu. r=pbro
Make `ChangesContextMenu` directly extend `Menu` instead of wrapping it so external objects and tests can listen to its events.

Reduce `ChangesContextMenu`'s knowledge about the outside world (like `ChangesView`) by providing it in the constructor with the callbacks necessary for each context menu item.

Differential Revision: https://phabricator.services.mozilla.com/D55448

--HG--
extra : moz-landing-system : lando
2019-12-02 14:41:26 +00:00
Daisuke Akatsuka a37b33320c Bug 1592763: Use TargetList api for ChangesView. r=ochameau,rcaliman
Differential Revision: https://phabricator.services.mozilla.com/D54256

--HG--
extra : moz-landing-system : lando
2019-11-28 01:57:39 +00:00
Alexandre Poirot 384dbcaf86 Bug 1598007 - Fix exception when copying rules from the Changes panel. r=pbro
Differential Revision: https://phabricator.services.mozilla.com/D53987

--HG--
extra : moz-landing-system : lando
2019-11-21 08:41:54 +00:00
Julian Descottes 222bc5ccde Bug 1593921 - Use eslint-disable-next-line to disable complexity checks in DevTools r=pbro
Using next-line is less error prone for refactorings than wrapping methods with enable/disable blocks.

Differential Revision: https://phabricator.services.mozilla.com/D51782

--HG--
extra : moz-landing-system : lando
2019-11-05 14:29:04 +00:00
Gabriel Luong 48b7b4b362 Bug 1568876 - Make copyRule in the ChangesView fission compatible. r=rcaliman
Differential Revision: https://phabricator.services.mozilla.com/D50973

--HG--
extra : moz-landing-system : lando
2019-10-30 19:51:48 +00:00
Mark Banner 88eab57b84 Bug 1579452 - Enable ESLint rule no-async-promise-executor on disabled locations for devtools. r=jlast
Depends on D45010

Differential Revision: https://phabricator.services.mozilla.com/D45999

--HG--
extra : moz-landing-system : lando
2019-09-17 17:50:23 +00:00
Alexandre Poirot 2987ab1345 Bug 1578426 - Rename Inspector.target to Inspector.currentTarget. r=pbro
Rename this attribute to better significate that the target is
changing over time when the debugged target navigates to another process.

Differential Revision: https://phabricator.services.mozilla.com/D44632

--HG--
extra : moz-landing-system : lando
2019-09-05 14:17:20 +00:00
Nicolas Chevobbe 925311bc77 Bug 1568779 - Remove editors settings comments in devtools files. r=pbro.
Differential Revision: https://phabricator.services.mozilla.com/D42300

--HG--
extra : moz-landing-system : lando
2019-08-19 12:48:16 +00:00
Alexandre Poirot 91c0c3d8b5 Bug 1567860 - Make changes view destroy codepath synchronous. r=rcaliman
The fronts are destroyed when the toolbox closes and when a front is destroyed,
all its listeners are removed. So there is no real value in trying to unregister
them. On top of that, this destroy method is called by Inspector.destroy
and doesn't wait for its completion.

Differential Revision: https://phabricator.services.mozilla.com/D39302

--HG--
extra : moz-landing-system : lando
2019-07-25 11:54:20 +00:00
Razvan Caliman 1258790cbb Bug 1566398 - Remove expired scalar telemetry probes for Changes panel. r=gl
Differential Revision: https://phabricator.services.mozilla.com/D38363

--HG--
extra : moz-landing-system : lando
2019-07-17 18:29:36 +00:00
Razvan Caliman e97022e21e 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

--HG--
extra : moz-landing-system : lando
2019-07-10 19:51:57 +00:00
Victor Porof f6db0ee557 Bug 1561435 - Format devtools/client/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35884

--HG--
extra : source : 60e4496cf9699dc59f2f4738cb60f87cbdb01e67
2019-07-05 11:24:38 +02:00
Patrick Brosset a365f19d19 Bug 1553451 - Lower the eslint complexity level to 20 for devtools and exlude more complex functions; r=jdescottes
We want to go back to ESLint's default complexity level so that newly introduced code is checked for complexity.
At the same time, to make that work, we're excluding all of the more complex functions for now.
We should fix them: make them less complex, and remove the eslint-disable comment.
See bug 1553449 for more information about this.

Differential Revision: https://phabricator.services.mozilla.com/D32139

--HG--
extra : moz-landing-system : lando
2019-05-23 09:06:16 +00:00
Mihai Alexandru Michis 2ae5a4bb01 Backed out changeset 0f9626b48a66 (bug 1553451) for linting failures. CLOSED TREE 2019-05-23 10:58:22 +03:00
Patrick Brosset 28f446d619 Bug 1553451 - Lower the eslint complexity level to 20 for devtools and exlude more complex functions; r=jdescottes
We want to go back to ESLint's default complexity level so that newly introduced code is checked for complexity.
At the same time, to make that work, we're excluding all of the more complex functions for now.
We should fix them: make them less complex, and remove the eslint-disable comment.
See bug 1553449 for more information about this.

Differential Revision: https://phabricator.services.mozilla.com/D32139

--HG--
extra : moz-landing-system : lando
2019-05-23 07:07:49 +00:00
Julian Descottes 039d3e7c13 Bug 1543940 - menu.popup() should take a document argument instead of toolbox r=ochameau
Depends on D27693

Menu::popup and popupAtZoom are expecting a toolbox argument as last argument.
However, half of the callsites do not have access to the toolbox and just pass
a { doc } object. This is misleading when trying to work on menu.js because you
cannot rely on toolbox APIs.

Differential Revision: https://phabricator.services.mozilla.com/D28036

--HG--
extra : moz-landing-system : lando
2019-05-08 21:35:36 +00:00
Andreea Pavel 95a481edab Backed out 5 changesets (bug 1543940) for failing browser_menu_api.js on a CLOSED TREE
Backed out changeset aaa0f827616a (bug 1543940)
Backed out changeset 590b72185b69 (bug 1543940)
Backed out changeset 42e2136f684f (bug 1543940)
Backed out changeset a66967f17042 (bug 1543940)
Backed out changeset b1e6e932873c (bug 1543940)
2019-05-08 20:49:43 +03:00
Julian Descottes 6c24dca78c Bug 1543940 - menu.popup() should take a document argument instead of toolbox r=ochameau
Depends on D27693

Menu::popup and popupAtZoom are expecting a toolbox argument as last argument.
However, half of the callsites do not have access to the toolbox and just pass
a { doc } object. This is misleading when trying to work on menu.js because you
cannot rely on toolbox APIs.

Differential Revision: https://phabricator.services.mozilla.com/D28036

--HG--
extra : moz-landing-system : lando
2019-05-08 15:13:40 +00:00
Razvan Caliman a850d96a7d Bug 1541824 - Make Copy All Changes button sticky in Changes panel. r=gl
Ensure the button to copy all changes remains in view even when the Changes panel is overflowing vertically.

Differential Revision: https://phabricator.services.mozilla.com/D28487

--HG--
extra : moz-landing-system : lando
2019-04-24 07:58:50 +00:00
Razvan Caliman 19ecfe66b0 Bug 1542213 - Track newly added CSS rules in the Changes panel. r=pbro
Introduces tracking for newly created CSS rules in the PageStyleActor.

Adds a boolean flag, `isNew`, to the tracked rule in the Changes Redux store. Using this flag, render the new rule's selector in the React component as added (plus sign, green background). Ensure selector changes for thew new rule always overwrite the original selector (fix for Bug 1542288) instead of erroneously showing the original selector as removed.

Removes obsolete documentation for "changeType" from the tracked rule in the Changes Redux store. This was never used.

Differential Revision: https://phabricator.services.mozilla.com/D28215

--HG--
extra : moz-landing-system : lando
2019-04-23 07:59:12 +00:00
Razvan Caliman 55d5ea2bb8 Bug 1532583 - Add scalars for copy options in Changes panel. r=pbro
Track the number of times people use any of the export options from the Changes panel:

- Copy All Changes button
- Copy Rule button
- Copy Rule context menu option
- Copy Declaration context menu option

Differential Revision: https://phabricator.services.mozilla.com/D22090

--HG--
extra : moz-landing-system : lando
2019-03-05 14:38:36 +00:00
Razvan Caliman 0e24372fd4 Bug 1529599 - (Part 1) Add Copy Declaration to Changes panel context menu; r=gl
Adds a new option to the context menu which is visible only when it's invoked on a CSS declaration.
Builds a string with the property name and value and copies to the clipboard.
If the declaration is marked as removed, the string is wrapped in a comment block.

Differential Revision: https://phabricator.services.mozilla.com/D21526

--HG--
extra : moz-landing-system : lando
2019-02-28 17:30:02 +00:00
Razvan Caliman 3febb41272 Bug 1530294 - Add option to skip cache when requesting authored text for CSS rule r=gl
This patch adds a boolean option to skip the cached value of `StyeRuleActor.authoredText` and re-parse the stylesheet for its value.
When changing content of a descendant rule inside an ancestor like @media or @select, the cached `authoredText` value is outdated.
This yields incorrect data when requesting the complete rule authored text, hence the need for a cache-busting option.

In addition to this change, there is a slight refactor to include the generated unique selector for the mock-rule for element inline styles.

Differential Revision: https://phabricator.services.mozilla.com/D21033

--HG--
extra : moz-landing-system : lando
2019-02-26 09:09:01 +00:00
Razvan Caliman def6b3e0fc Bug 1530341 - (Part 2) Add Copy All Changes button to Changes panel. r=gl
Depends on D21007

Adds a Copy All Changes button to the toolbar of the Changes panel.
When pressed, this builds a stylesheet out of the changes for all sources tracked (stylesheets, element styles, etc)
The output format is the same as the now defunct Bug 1524548 with the added code comment as separator between the sources.

Differential Revision: https://phabricator.services.mozilla.com/D21008

--HG--
extra : moz-landing-system : lando
2019-02-25 22:37:02 +00:00
Razvan Caliman 6babe11480 Bug 1530341 - (Part 1) Remove Copy Changes and Copy All Changes context menu options. r=gl
Remove the Copy All and Copy All Changes context menu options form the Changes panel context menu. As decided by PM & UX, they will be replaced with a single Copy All Changes button in the toolbar (part 2 of this series).

Differential Revision: https://phabricator.services.mozilla.com/D21007

--HG--
extra : moz-landing-system : lando
2019-02-25 22:34:31 +00:00
Razvan Caliman 0a37fab475 Bug 1529606 - Add Copy Rule button to Changes panel. r=pbro
Adds a button that shows up when hovering selectors in the Changes panel.
When clicked, it invokes the same Copy Rule behavior implemented for the context menu: copies the full content of the rule with changes applied.

The added/changed CSS class names use BEM notation. I intend to refactor the Changes panel stylesheet to BEM in a follow-up patch.

Differential Revision: https://phabricator.services.mozilla.com/D20808

--HG--
extra : moz-landing-system : lando
2019-02-25 22:20:53 +00:00
arthur.iakab 01800513e9 Backed out 3 changesets (bug 1530341, bug 1529606) for causing devtools failures on browser_parsable_css.js CLOSED TREE
Backed out changeset 8a760030e793 (bug 1530341)
Backed out changeset 2c74db63f9aa (bug 1530341)
Backed out changeset 96e76fdfd8b2 (bug 1529606)
2019-02-25 21:35:09 +02:00
Razvan Caliman 4597f8fe09 Bug 1530341 - (Part 2) Add Copy All Changes button to Changes panel. r=gl
Depends on D20808

Adds a Copy All Changes button to the toolbar of the Changes panel.
When pressed, this builds a stylesheet out of the changes for all sources tracked (stylesheets, element styles, etc)
The output format is the same as the now defunct Bug 1524548 with the added code comment as separator between the sources.

Differential Revision: https://phabricator.services.mozilla.com/D21008

--HG--
extra : moz-landing-system : lando
2019-02-25 17:45:47 +00:00
Razvan Caliman ded1fb2379 Bug 1530341 - (Part 1) Remove Copy Changes and Copy All Changes context menu options. r=gl
Remove the Copy All and Copy All Changes context menu options form the Changes panel context menu. As decided by PM & UX, they will be replaced with a single Copy All Changes button in the toolbar (part 2 of this series).

Differential Revision: https://phabricator.services.mozilla.com/D21007

--HG--
extra : moz-landing-system : lando
2019-02-25 14:47:56 +00:00
Razvan Caliman 8b9ef36b98 Bug 1529606 - Add Copy Rule button to Changes panel. r=pbro
Adds a button that shows up when hovering selectors in the Changes panel.
When clicked, it invokes the same Copy Rule behavior implemented for the context menu: copies the full content of the rule with changes applied.

The added/changed CSS class names use BEM notation. I intend to refactor the Changes panel stylesheet to BEM in a follow-up patch.

Differential Revision: https://phabricator.services.mozilla.com/D20808

--HG--
extra : moz-landing-system : lando
2019-02-25 17:45:40 +00:00
Rainier G a1ce4f4232 Bug 1529379 - Remove devtools.inspector.changes.enabled pref. r=gl 2019-02-22 00:05:34 -05:00
Razvan Caliman a2b510c934 Bug 1524547 - (Part 2) Add context menu option to copy the contents of a changed CSS rule. r=gl
Depends on D20195

This series of patches depends on the patch from [Bug 1525238](https://bugzilla.mozilla.org/show_bug.cgi?id=1525238)

- adds method to identify a CSS Rule actor by id
- adds context menu option to the Changes panel to allow copying the rule's authored text to the clipboard

Differential Revision: https://phabricator.services.mozilla.com/D20196

--HG--
extra : moz-landing-system : lando
2019-02-20 21:45:03 +00:00
Razvan Caliman 584bbd922b Bug 1527924 - (Part 3) Account for new selectors structure when generating stylesheets with changes r=pbro.
Updates the Redux selector that generates styleesheets with changes to account for the new array structure for the history of the CSS Rule selector. Also fixes the xpcshell mock to account for the same thing.

With this change, selector renames also get captured in the output stylesheet (they weren't in the previous implementation)

Differential Revision: https://phabricator.services.mozilla.com/D20148

--HG--
extra : moz-landing-system : lando
2019-02-19 09:05:53 +00:00
Razvan Caliman 146fa6af12 Bug 1527924 - (Part 2) Show selector diffs in the Changes panel. r=pbro
Depends on D19828

Updates the React component of the Changes panel to show the diff of
a rule's selector if it has changed.

The previous implementation assumed that a selector rename meant a whole
rule removal (with the old selector) followed by a whole rule addition
(with the new selector).

This new implementation tracks the changes to the selector atomically.
The main benefit is that if the selector is renamed, the diff in the
Changes panel shows only this action and not the unchanged declarations.

The test was re-enabled and adjusted to account for this difference in behaviour.

This refactor was required in order to be compatible with Bug 1525238
which lays the ground work for matching rules from the client with rules
from the server. This is necessary in order to have consistent behaviour
for export options, like Copy Rule, which need to match the rule on the
server even if its selector was changed.

Differential Revision: https://phabricator.services.mozilla.com/D19830

--HG--
extra : moz-landing-system : lando
2019-02-18 13:14:29 +00:00
Razvan Caliman 0fb39bdffe 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

--HG--
extra : moz-landing-system : lando
2019-02-15 16:58:58 +00:00
Razvan Caliman c21e773cbd Bug 1525238 - Use actorID for tracked rules and stylesheets. r=pbro
Replaces custom generated hashes with the actorIDs which are stable
during the editing session enough to use as unique identifiers.

For future restore / persistence, we still have the metadata about each
rule and stylesheet to attempt to identify them again.

Differential Revision: https://phabricator.services.mozilla.com/D18660

--HG--
extra : moz-landing-system : lando
2019-02-14 16:29:21 +00:00
Razvan Caliman 87a8e6f838 Bug 1527004 - Add context menu option to Changes panel to copy all changes for a source. r=gl
Like Bug 1524548, but builds a stylesheet for all changed rules within a source.

Differential Revision: https://phabricator.services.mozilla.com/D19385

--HG--
extra : moz-landing-system : lando
2019-02-11 20:02:44 +00:00
Razvan Caliman 041edc992d Bug 1524548 - (Part 4) Add unit test to check stylesheets generated from tracked changes. r=pbro
Depends on D18706

Follow up for D18704. Adds xpcshell unit test to check that stylesheets are genereated in the expected formats for single or deeply nested CSS rules.

Differential Revision: https://phabricator.services.mozilla.com/D18860

--HG--
extra : moz-landing-system : lando
2019-02-07 08:41:09 +00:00
Razvan Caliman 2730476d0f Bug 1524548 - (Part 3) Add option to Changes panel context menu to copy changes. r-gl r=gl
Depends on D18704

Adds a new option to the context menu to copy the changes for a rule as valid CSS text.
Removed properties are commented out. Added properties are used as-is. Style source information is listed as a code comment above the CSS rule.

Makes use of the new Redux selector introduced in Part 2 (see D18704) to build a stylesheet text with the changes per-rule. That will be reused for copying all changes per-stylesheet.

Moves the copy text selection handler out to the ChangesView to co-locate it with other (upcoming) copy actions.

Adds data-ruleid and data-sourceid to DOM elements to help match the target element to the rule/source in the Redux store.

Differential Revision: https://phabricator.services.mozilla.com/D18706

--HG--
extra : moz-landing-system : lando
2019-02-06 19:07:42 +00:00
Razvan Caliman a10d3a5218 Bug 1524548 - (Part 2) Add Redux selector method to build a stylesheet from a tree of changes. r=pbro
Depends on D18703

Adds a new selector method to build the CSS text for a stylesheet with the aggregated changes for one or more rules.
Makes use of the filtering capabilities introduced in Part 1.

Differential Revision: https://phabricator.services.mozilla.com/D18704

--HG--
extra : moz-landing-system : lando
2019-02-07 08:36:15 +00:00
Razvan Caliman 462cd515d5 Bug 1524548 - (Part 1) Add support to filter by ruleId and sourceId when building the changes tree. r=pbro
The diff for this change looks needlessly scary. The only material change is the introduction of the `filter` parameter to the `getChangesTree()` selector to restrict the output to a subtree that includes only the martching rules and sources provided in as arrays of ids in the `filters` argument.

The sources and rules are filtered, if any corresponding ids are provided, then the same logic to build the tree is used.

The meaningful blocks of code introduced are:

```
.filter(([sourceId, source]) => {
  // Use only matching sources if an array to filter by was provided.
  if (sourceIdsFilter.length) {
    return sourceIdsFilter.includes(sourceId);
  }

  return true;
})
```

introduced right after `Object.entries(state)`

and

```
.filter(([ruleId, rule]) => {
  // Use only matching rules if an array to filter by was provided.
  if (rulesIdsFilter.length) {
    return rulesIdsFilter.includes(ruleId);
  }

  return true;
})
```

introduced right after `Object.entries(rules)`.

Adding a newline confused the diff algorithm to consider that much bigger changes have occurred.

Introducing these filtering options lays the ground work for building subtrees of changes per-rule and per-stylesheet to be copied to the clipboard or saved as a file.

Differential Revision: https://phabricator.services.mozilla.com/D18703

--HG--
extra : moz-landing-system : lando
2019-02-06 08:12:23 +00:00
Brindusan Cristian b2ca1f33d7 Backed out changeset 89ba5f983e61 (bug 1525238) for dt failures at browser_changes_rule_selector.js and browser_inspector_highlighter-eyedropper-xul.js. 2019-02-06 13:08:39 +02:00
Razvan Caliman ef7e6219b7 Bug 1525238 - Use actorID for tracked rules and stylesheets. r=pbro
Replaces custom generated hashes with the actorIDs which are stable
during the editing session enough to use as unique identifiers.

For future restore / persistence, we still have the metadata about each
rule and stylesheet to attempt to identify them again.

Differential Revision: https://phabricator.services.mozilla.com/D18660

--HG--
extra : moz-landing-system : lando
2019-02-06 08:08:57 +00:00
Sebastian Hengst 59f46565b6 Bug 1524369 - Update moz..build files to use the new Inspector Bugzilla components r=gl
The components got renamed or added in bug 1523779.

Differential Revision: https://phabricator.services.mozilla.com/D18259

--HG--
extra : moz-landing-system : lando
2019-01-31 19:31:40 +00:00
Razvan Caliman f27ade590e Bug 1522843 - Add telemetry configuration and instrumentation to Changes panel to measure usage of context menu and copy action. r=gl
Adds three new scalars for counting the numer of times:
- the default copy action is triggered, regardless of method
- the context menu is shown
- the copy option from the context menu is used

Differential Revision: https://phabricator.services.mozilla.com/D17667

--HG--
extra : moz-landing-system : lando
2019-01-29 11:53:38 +00:00
Razvan Caliman 7b68c89bf0 Bug 1518512 - (Part 2) Ensure all text in Changes panel can be copied. r=gl
Depends on D17255
Replaces CSS pseudo-elements for added/removed line markers with text
elements that can be copied with the rest of the content.

Differential Revision: https://phabricator.services.mozilla.com/D17256

--HG--
extra : moz-landing-system : lando
2019-01-25 15:50:35 +00:00
Razvan Caliman 8daa82597e Bug 1518512 - (Part 1) Add basic context menu to Changes panel. r=gl
Adds context menu with options to select all and copy text content from
the Changes panel.

Differential Revision: https://phabricator.services.mozilla.com/D17255

--HG--
extra : moz-landing-system : lando
2019-01-25 15:45:38 +00:00
Csoregi Natalia 5c853a316a Backed out 2 changesets (bug 1518512) for devtools failures on devtools/client/inspector/changes/test/browser_changes_rule_selector.js. CLOSED TREE
Backed out changeset c8f0d19844f6 (bug 1518512)
Backed out changeset 3c03e2282b4f (bug 1518512)
2019-01-25 15:41:07 +02:00