Commit Graph

61 Commits

Author SHA1 Message Date
Alexandre Poirot
59fe57c052 Bug 1793396 - [devtools] Use absolute URLs in all usages of loader.lazyRequireGetter. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D158489
2022-10-03 18:57:13 +00:00
Alexandre Poirot
caaf5fa378 Bug 1792847 - [devtools] Use absolute URLs to import modules in devtools/client/inspector. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D158375
2022-09-30 15:17:37 +00:00
Alexandre Poirot
f3b6620342 Bug 1701790 - Migrate ResourceWatcher to become ResourceCommand. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D113930
2021-05-04 09:29:47 +00:00
Brindusan Cristian
d5be5fbb54 Backed out 5 changesets (bug 1701790) for bc failures in browser_ext_devtools_network_targetSwitch.js. CLOSED TREE
Backed out changeset 3fc4edd663d9 (bug 1701790)
Backed out changeset 2d3ea7c0d695 (bug 1701790)
Backed out changeset 6cb7502fc1a2 (bug 1701790)
Backed out changeset 8f4205a1a369 (bug 1701790)
Backed out changeset bd3c9b1482c7 (bug 1701790)
2021-05-03 22:21:59 +03:00
Alexandre Poirot
8479ca9cbb Bug 1701790 - Mass replace resourceWatcher with resourceCommand. r=nchevobbe
$ sed -i 's/resourceWatcher/resourceCommand/g' $(egrep -rl 'resourceWatcher' devtools/)

Differential Revision: https://phabricator.services.mozilla.com/D113933
2021-05-03 18:07:31 +00:00
Alexandre Poirot
be66ca08ca Bug 1660268 - Pass list of resources instead of unique resource from ResourceWatcher. r=nchevobbe
Here, I've tried to be especially careful about replacing `return` by `continue` in the added for..loops.

Differential Revision: https://phabricator.services.mozilla.com/D87768
2020-09-07 21:13:02 +00:00
Csoregi Natalia
6ed1de381f Backed out 3 changesets (bug 1660268) for failures on browser_ext_devtools_network_targetSwitch.js. CLOSED TREE
Backed out changeset 749fda4e5eb1 (bug 1660268)
Backed out changeset 9d4c305f6b88 (bug 1660268)
Backed out changeset 7ec118209790 (bug 1660268)
2020-09-07 21:24:26 +03:00
Alexandre Poirot
48f2e14889 Bug 1660268 - Pass list of resources instead of unique resource from ResourceWatcher. r=nchevobbe
Here, I've tried to be especially careful about replacing `return` by `continue` in the added for..loops.

Differential Revision: https://phabricator.services.mozilla.com/D87768
2020-09-07 13:35:31 +00:00
Razvan Caliman
794475d689 Bug 1656477 - Do not react to cached DOCUMENT_EVENT resources in Changes panel. r=daisuke
This patch is borrowing a change that's coming with D85239 to fix the issue that the Changes panel shows as empty when it should show changes tracked in the background (before the Changes panel is opened).

The reason, as identified in D85239, is that the Changes panel reacts to `DOCUMENT_EVENT` resources which are cached in the resource watcher. The Changes panel thinks that the document is reloading so it clears all the changes that were collected. The result in an empty Changes panel.

The screenshot below shows the resource types and the order in which they arrive:
{F2382929}

Differential Revision: https://phabricator.services.mozilla.com/D85603
2020-07-31 17:06:33 +00:00
Daisuke Akatsuka
4cab3761b7 Bug 1625957: Use ResourceWatcher in Changes view. r=ochameau,rcaliman
Differential Revision: https://phabricator.services.mozilla.com/D74600
2020-06-12 02:09:40 +00:00
Razvan Maries
3d6c4c24cd Backed out 4 changesets (bug 1625957) for devtools failures on browser_inspector_sidebarstate.js. CLOSED TREE
Backed out changeset 6d6323e559cb (bug 1625957)
Backed out changeset 7d796f50c69f (bug 1625957)
Backed out changeset 8520caa244e1 (bug 1625957)
Backed out changeset e540c9937a31 (bug 1625957)
2020-06-12 05:04:55 +03:00
Daisuke Akatsuka
811b62f9f1 Bug 1625957: Use ResourceWatcher in Changes view. r=ochameau,rcaliman
Differential Revision: https://phabricator.services.mozilla.com/D74600
2020-06-11 04:19:31 +00:00
Nicolas Chevobbe
52769cfc76 Bug 1636924 - Remove unnecessary isTopLevel and type properties from onTargetAvailable/onTargetDestroyed callback parameter. r=ochameau.
Since targetFronts now have isTopLevel and targetType properties, we can directly use
those, as the targetFront is included in the callback parameter.
This patch remove those properties and refactor consumer code.

Differential Revision: https://phabricator.services.mozilla.com/D74651
2020-05-15 16:03:32 +00:00
Razvan Maries
c6b6ea9e0a Backed out changeset 3c239920e8fb (bug 1636924) for perma failures on browser_ext_devtools_inspectedWindow.js CLOSED TREE 2020-05-15 15:33:15 +03:00
Nicolas Chevobbe
13622df2d9 Bug 1636924 - Remove unnecessary isTopLevel and type properties from onTargetAvailable/onTargetDestroyed callback parameter. r=ochameau.
Since targetFronts now have isTopLevel and targetType properties, we can directly use
those, as the targetFront is included in the callback parameter.
This patch remove those properties and refactor consumer code.

Differential Revision: https://phabricator.services.mozilla.com/D74651
2020-05-15 09:09:28 +00:00
Razvan Caliman
d5614d0b6e Bug 1464876 - Load reducers on-demand in Inspector sidebar panels r=gl
The Inspector [loads all its panels' Redux reducers](https://searchfox.org/mozilla-central/source/devtools/client/inspector/reducers.js) up front, regardless if they're used or not.
Some of the reducers are quite hefty. It seems needless to load and parse code that's not needed.

In addition, the reducers are loaded in a different place than their corresponding actions. Actions are loaded and used in the panels, but the reducers are all loaded in the [Inpector when creating the store](https://searchfox.org/mozilla-central/rev/d69ec052bed8700af7a283e37b60b4af22734930/devtools/client/inspector/store.js#8,11). It helps reduce the cognitive load if actions and reducers are loaded together where they are used, in the sidebar panels.

This patch uses the approach described in the Redux docs to inject reducers on-demand: https://redux.js.org/recipes/code-splitting/#reducer-injection-approaches

There still are reducers which need to load immediately when the Inspector is initialized (mostly related to the Rules panel). But others, like the reducer for the Animations or Fonts panel, are loaded on-demand when the corresponding panels are visible.

For the most part, reducers are used in response to actions from their corresponding panels. However, the grid, flexbox and grid highlighter reducers are also [used  in HighlightersOverlay.js](https://searchfox.org/mozilla-central/rev/d69ec052bed8700af7a283e37b60b4af22734930/devtools/client/inspector/shared/highlighters-overlay.js#502) to provide highlighters with configuration or node context. In these cases, we load the reducers on-demand even if their corresponding panels haven't been opened yet. When the panels do get opened, the reducers are not re-loaded since they're already available.

Differential Revision: https://phabricator.services.mozilla.com/D67008
2020-04-07 18:19:13 +00:00
Julian Descottes
150349d1c5 Bug 1596686 - Use absolute paths for require calls r=gl
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D58243
2019-12-27 12:23:47 +00:00
Razvan Maries
0f5ce38e4c Backed out changeset 14698fa06ab8 (bug 1596686) for causing perma fails on browser_json_refresh.js. 2019-12-27 14:01:24 +02:00
Julian Descottes
3fa1b45876 Bug 1596686 - Use absolute paths for require calls r=gl
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D58243
2019-12-27 09:09:51 +00:00
Alexandre Poirot
41736b9bd8 Bug 1602734 - Pass one option object instead of arguments to watchTargets callbacks. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D56713
2019-12-12 10:41:27 +00:00
Razvan Caliman
386e3c12eb Bug 1566891 - Remove expired telemetry probes for export options. r=pbro
Differential Revision: https://phabricator.services.mozilla.com/D55073
2019-12-03 11:08:55 +00:00
Razvan Caliman
55bc471479 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
2019-12-02 14:41:26 +00:00
Daisuke Akatsuka
0274884f6a Bug 1592763: Use TargetList api for ChangesView. r=ochameau,rcaliman
Differential Revision: https://phabricator.services.mozilla.com/D54256
2019-11-28 01:57:39 +00:00
Alexandre Poirot
4a9c1286df Bug 1598007 - Fix exception when copying rules from the Changes panel. r=pbro
Differential Revision: https://phabricator.services.mozilla.com/D53987
2019-11-21 08:41:54 +00:00
Gabriel Luong
48b43ccc8b Bug 1568876 - Make copyRule in the ChangesView fission compatible. r=rcaliman
Differential Revision: https://phabricator.services.mozilla.com/D50973
2019-10-30 19:51:48 +00:00
Mark Banner
b082cd5a99 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
2019-09-17 17:50:23 +00:00
Alexandre Poirot
eda0503941 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
2019-09-05 14:17:20 +00:00
Nicolas Chevobbe
290ba5cb21 Bug 1568779 - Remove editors settings comments in devtools files. r=pbro.
Differential Revision: https://phabricator.services.mozilla.com/D42300
2019-08-19 12:48:16 +00:00
Alexandre Poirot
bd4b6ecdff 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
2019-07-25 11:54:20 +00:00
Razvan Caliman
226a52b206 Bug 1566398 - Remove expired scalar telemetry probes for Changes panel. r=gl
Differential Revision: https://phabricator.services.mozilla.com/D38363
2019-07-17 18:29:36 +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
2f548d2fee 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
2019-03-05 14:38:36 +00:00
Razvan Caliman
a41772a890 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
2019-02-28 17:30:02 +00:00
Razvan Caliman
273e5be80d 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
2019-02-26 09:09:01 +00:00
Razvan Caliman
7f88bd55ca 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
2019-02-25 22:37:02 +00:00
Razvan Caliman
07349e4d6b 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
2019-02-25 22:20:53 +00:00
arthur.iakab
8fcef9e3c2 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
f5a78d7792 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
2019-02-25 17:45:47 +00:00
Razvan Caliman
b7ddd05b27 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
2019-02-25 17:45:40 +00:00
Razvan Caliman
160cea7ccd 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
2019-02-20 21:45:03 +00:00
Razvan Caliman
b54610cf9e 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
2019-02-11 20:02:44 +00:00
Razvan Caliman
9b46124531 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
2019-02-06 19:07:42 +00:00
Razvan Caliman
a933ba0da4 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
2019-01-29 11:53:38 +00:00
Razvan Caliman
0ca03a9464 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
2019-01-25 15:45:38 +00:00
Csoregi Natalia
c4c77175fd 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
Razvan Caliman
84c7100017 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
2019-01-23 14:00:10 +00:00
yulia
beed920cfb Bug 1508660 - make storage front and changes front async; r=ochameau
Depends on D13110

Differential Revision: https://phabricator.services.mozilla.com/D13336
2018-12-18 08:33:11 +00:00
Ciure Andrei
3e1f01f806 Backed out 14 changesets (bug 1508660, bug 1508656, bug 1504185) for browser_target_cached-front.js perma failures CLOSED TREE
Backed out changeset 08e5ae4312b3 (bug 1508660)
Backed out changeset 01b687bb0b75 (bug 1504185)
Backed out changeset 140374b098aa (bug 1504185)
Backed out changeset caafdc0ea4c7 (bug 1508656)
Backed out changeset 8b98b777aec2 (bug 1508656)
Backed out changeset f1905a2f9b6c (bug 1508656)
Backed out changeset 8b01632f9e3d (bug 1508656)
Backed out changeset eb4c893d451e (bug 1508656)
Backed out changeset 70db61618160 (bug 1508656)
Backed out changeset dff79b73c7fe (bug 1508660)
Backed out changeset b3518d5285be (bug 1508660)
Backed out changeset 94a957b9ba90 (bug 1508660)
Backed out changeset 773938f18269 (bug 1508660)
Backed out changeset 4eca8fce0a47 (bug 1508660)
2018-12-17 17:15:23 +02:00
yulia
6c3024e401 Bug 1508660 - make storage front and changes front async; r=ochameau
Depends on D13110

Differential Revision: https://phabricator.services.mozilla.com/D13336
2018-12-17 12:29:52 +00:00
yulia
7e63058cf6 bug 1507146 - make changesView have an async init method; r=ochameau
ChangesView was challenging because the async call was in the constructor. I moved it out of the
constructor to the init method, and do a check to see if its been initialized in the destroy method.

Depends on D11886

Differential Revision: https://phabricator.services.mozilla.com/D11887
2018-11-21 14:39:17 +00:00