Commit Graph
3159 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 bde1f19196 Bug 1792847 - [devtools] Allow node/jest to load modules from absolute resource:// URLs. r=jdescottes
Note that TreeView is blocked by jsonview, and only devtools/client is being moved to resource:// URIs

Differential Revision: https://phabricator.services.mozilla.com/D158325
2022-09-30 15:17:40 +00:00
Alexandre Poirot dd41349dba Bug 1786467 - [devtools] Sort debugger SourceTree in a meaningful way. r=bomsy
The main thread is always displayed first,
then we display all content process targets (sorted by PID number),
and we end up with worker targets (sorted alphabetically).

This should follow the same order as the js context selector.

Differential Revision: https://phabricator.services.mozilla.com/D155336
2022-09-26 16:42:30 +00:00
Alexandre Poirot 58b38d7c16 Bug 1791969 - [devtools] Import all JSM in DevTools via ChromeUtils.import. r=jdescottes
Convert all imports but the one related to SessionDataHelper
as that's an hybrid module which is loaded as a JSM from the main thread,
but loaded as a common js module from the worker thread.

We will be able to drop this once we can migrate this JSM to ESM
once we support loading ESM from the worker thread.

Differential Revision: https://phabricator.services.mozilla.com/D158007
2022-09-26 13:01:33 +00:00
Alexandre Poirot 3f479154b1 Bug 1276347 - [devtools] Remove "reportError" from devtools module globals. r=jdescottes
This might have only be useful from the source actor.
In workers, you don't have access to Cu, so nor have access to Cu.reportError.
Otherwise from the main thread, you can safely use Cu.reportError.

In couple of places I'm removing the usage of reportError.
Hopefully throwing an exception is enough to get the error displayed!

Differential Revision: https://phabricator.services.mozilla.com/D157909
2022-09-26 10:48:04 +00:00
Marian-Vasile Laza 07babd97e2 Backed out changeset a50d707b3bbc (bug 1769534) for causing debugger frame failures. CLOSED TREE 2022-09-14 17:05:11 +03:00
Pierre de La Morinerie 70d1bba952 Bug 1769534 - preserve NBSP when copying HTML content. r=hsivonen
To workaround the historical lack of 'white-space: pre', when an user
wants to compose HTML text with several consecutive spaces, WYSIWYG
HTML editors insert an alternating pattern of SPACE and NBSP to avoid
spaces being collapsed.

This is why browsers, when copying HTML content, usually strip all NBSP
from the copied text.

This commit changes the copying behavior, to strip only NBSP that were
potentially generated by an editor (and preserve the others).

The heuristic used is "An NBSP adjacent to a regular space doesn't make
sense, and can be replaced by a regular space". This detects the
alternating pattern of SPACE/NBSP, but also a space followed by a long
sequence of NBSP (because a line break would occur anyway in that case).

NB: included is a change that makes devtools use regular spaces
(rather than NBSPs) to indent stacktrace frames. This prevent NBSPs from
appearing in the clipboard when copying a stacktrace.

Attribution: the actual nsPlainTextSerializer changes were written by
Rachel Martin <[email protected]>, as a part of Betterbird.

Differential Revision: https://phabricator.services.mozilla.com/D149644
2022-09-14 13:13:51 +00:00
Nicolas Chevobbe 212d2b7cfd Bug 1788594 - [devtools] Fix ESLint consistent-return failures in devtools/client/debugger/. r=bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D156156
2022-09-12 17:41:33 +00:00
Alexandre Poirot 60fcf8c2b3 Bug 1789256 - [devtools] Fix displaying sources when reloading a web extension. r=bomsy
I think we have a special edge case here, where we do have a navigation,
but no new top level target is notified.
In regular devtools/webpages, we should have a new top level target notified to the debugger.

Differential Revision: https://phabricator.services.mozilla.com/D156467
2022-09-12 11:44:46 +00:00
Hubert Boma Manilla 17982fe4d7 Bug 1789363 - [devtools] Support specifying the source actor to the load the source text r=ochameau
This patch enables specifying a source actor to load the source text content

Differential Revision: https://phabricator.services.mozilla.com/D154778
2022-09-12 10:32:03 +00:00
Alexandre Poirot 0f32f335e3 Bug 1789201 - [devtools] Expose Services as a global to all DevTools modules. r=perftest-reviewers,nchevobbe,julienw,AlexandruIonescu
This will help transition to ES Modules as this symbol is exposed to them.

$ sed -ie "/require(.Services.)/d" $(git grep -l 'require("Services")' devtools/)
$ sed -ie "/loader.lazyRequireGetter(this, .Services./d" $(git grep -l 'loader.lazyRequireGetter(this, "Services"' devtools/)
+ the edition of builtin-modules.js + eslintrc.js
+ manual eslint fixes
+ removal of devtools-services in the debugger, except for jest tests

Differential Revision: https://phabricator.services.mozilla.com/D156401
2022-09-09 07:22:51 +00:00
Alexandre Poirot 444e6f2298 Bug 1783821 - [devtools] Load Launcher.sys.mjs via ChromeUtils.importESModule. r=perftest-reviewers,bomsy,arai,sparky
This is the result of:
$ ./mach esmify --imports . --prefix=devtools/client/framework/browser-toolbox

Differential Revision: https://phabricator.services.mozilla.com/D154072
2022-09-05 12:29:57 +00:00
Nicolas Chevobbe 8c4baace38 Bug 1788095 - [devtools] Fix devtools-bundle failure. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D156041
2022-09-01 12:24:40 +00:00
Nicolas Chevobbe c4c8c77025 Bug 1787389 - [devtools] Fix ESLint consistent-return failures in devtools/client/debugger/src/actions. r=bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D155824
2022-08-31 11:40:15 +00:00
Nicolas Chevobbe 2893df5d12 Bug 1787513 - [devtools] Fix failing debugger jest tests. r=bomsy.
This consist mostly of switching from undefined to
null for some expected values, because of the work
on eslint-consistent-return rule for the debugger.

Differential Revision: https://phabricator.services.mozilla.com/D155717
2022-08-30 16:08:56 +00:00
Mark Banner 3387a89bc7 Bug 1786197 - Turn on ESLint rule for prefer-boolean-length-check for devtools. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D155167
2022-08-26 13:39:34 +00:00
Hubert Boma Manilla 81736bc87d Bug 1785269 - Stop removing source based on the source thread instead use the source actor thread r=ochameau
This patch stops removing sources based on the `source.thread` property,
instead this should based of the source actors thread. This enables us to remove
the `source.thread` property which would be wrong when the breakpoints per url
work D150628 is done.

Differential Revision: https://phabricator.services.mozilla.com/D154904
2022-08-25 14:30:12 +00:00
Nicolas Chevobbe 72537ca78b Bug 1786699 - [devtools] Fix ESLint consistent-return failures in devtools/client/debugger/src/selectors. r=bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D155452
2022-08-25 11:00:10 +00:00
Nicolas Chevobbe 995d1a582d Bug 1786241 - [devtools] Fix ESLint consistent-return failures in devtools/client/debugger/src/workers. r=bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D155196
2022-08-23 12:18:13 +00:00
Nicolas Chevobbe 1497b96f14 Bug 1784222 - [devtools] Use Maps and Sets in getMode. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D154364
2022-08-23 06:42:38 +00:00
Nicolas Chevobbe 3605097f71 Bug 1783858 - [devtools] Directly pass text and mode when creating a new CodeMirror document in the debugger. r=ochameau.
We used to create the document, then set the text and the mode, which seemed to
trigger unecessary updates in CodeMirror.
Since CodeMirror document can take an initial value and mode, we make this a possibility
in the source editor, and use it from the debugger codebase.

We take this as an opportunity to move the `getMode` function to `source-document.js` as
it's only used from there, and put the logic to not highlight big files there.
The unit test for the function are moved to the same folder the function now lives in,
and are adapted to the new signature.

Differential Revision: https://phabricator.services.mozilla.com/D154096
2022-08-23 06:42:37 +00:00
Hubert Boma Manilla 3195b19570 Bug 1782672 - [devtools] Make sure codemirror document still exists during component update/unmount r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D153456
2022-08-22 12:12:12 +00:00
Alexandre Poirot 3fcf53a561 Bug 1783813 - [devtools] Unify debugger initialization and thread selection. r=bomsy
We are updating more things when selecting a thread than when opening the debugger.
Let's use a unique codepath when it comes to handle a new top level target.

Differential Revision: https://phabricator.services.mozilla.com/D151552
2022-08-17 16:13:35 +00:00
Luke Swiderski 12b3ca1d7f Bug 1764248 - Add composition event-listener breakpoints r=bomsy
Add compositionstart, compositionupdate and compositionend
to keyboard event-listener-breakpoints.
Add mochitests for each.
Add comment to mochitest.

Differential Revision: https://phabricator.services.mozilla.com/D153627
2022-08-15 06:42:00 +00:00
Nicolas Chevobbe 1349f2bf78 Bug 1784073 - [devtools] Fix ESLint consistent-return failures in devtools/client/debugger/src/utils/. r=bomsy.
Depends on D154244

Differential Revision: https://phabricator.services.mozilla.com/D154245
2022-08-12 07:00:36 +00:00
Nicolas Chevobbe f4554595e9 Bug 1784071 - [devtools] Remove debugger specific eslint override for consistent-return rule. r=bomsy.
Instead, we put all the failing file into devtools eslintrc.js.

Differential Revision: https://phabricator.services.mozilla.com/D154244
2022-08-12 07:00:36 +00:00
Alexandre Poirot 4160cce3ea Bug 1779284 - [devtools] Stop maintaining a duplicate of the target list in the debugger frontend. r=bomsy
Instead we can fully rely on TargetCommand.

This fixes duplicated calls made to top level thread actor.
This was only happening with toolbox not using the Watcher Actor.
i.e. the non-multiprocess Browser Toolbox, Browser Content Toolbox and may be worker toolboxes from about:debugging.

Differential Revision: https://phabricator.services.mozilla.com/D151643
2022-08-11 15:05:41 +00:00
Alexandre Poirot 311eebd1ea Bug 1782364 - [devtools] Test files with encoded characters in the debugger. r=bomsy
This at least ensure that the sources display with the right display in the Source Tree.

Differential Revision: https://phabricator.services.mozilla.com/D154082
2022-08-11 15:01:49 +00:00
Cristian Tuns 0f236800ac Backed out changeset 1b9afbfab196 (bug 1783858) for causing devtools failures on browser_dbg-features-wasm.js CLOSED TREE 2022-08-11 10:18:26 -04:00
Nicolas Chevobbe 42a72514ca Bug 1783858 - [devtools] Directly pass text and mode when creating a new CodeMirror document in the debugger. r=ochameau.
We used to create the document, then set the text and the mode, which seemed to
trigger unecessary updates in CodeMirror.
Since CodeMirror document can take an initial value and mode, we make this a possibility
in the source editor, and use it from the debugger codebase.

We take this as an opportunity to move the `getMode` function to `source-document.js` as
it's only used from there, and put the logic to not highlight big files there.
The unit test for the function are moved to the same folder the function now lives in,
and are adapted to the new signature.

Differential Revision: https://phabricator.services.mozilla.com/D154096
2022-08-11 12:48:49 +00:00
Nicolas Chevobbe 377da8ae56 Bug 1783160 - [devtools] Use private fields and methods in BrowserToolboxLauncher. r=jdescottes.
Tests were using the internal `_dbgProcess` and `_dbgProfilePath` properties, which
we migrate to private properties.
We now pass those properties as part of the `run` event that those tests are
setting up, so we can run assertions on those object.
Finally, we take this as an opportunity to clean `browser_dbg-chrome-create.js`.
Since it was the only callsite using `onClose`, and given that we directly call
the `close` method, we can remove the `onClose` from the signature of `BrowserToolboxLauncher`.

Differential Revision: https://phabricator.services.mozilla.com/D153733
2022-08-08 06:15:42 +00:00
Nicolas Chevobbe bb7261e859 Bug 1782527 - [devtools] Change devtools.chrome-debug-mode default value to parent-process. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D153432
2022-08-04 07:42:33 +00:00
Sandor Molnar be6957d0d9 Backed out changeset 823d61b8ec47 (bug 1782527) for causing dt failures. 2022-08-03 20:55:03 +03:00
Mark Banner 6d03c63e2d Bug 1330099 - Enable object-shorthand eslint rule. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D153567
2022-08-03 14:57:05 +00:00
Mark Banner 1e3410cbdd Bug 1782008 - Remove now unnecessary .eslintrc.js files. r=webcompat-reviewers,extension-reviewers,media-playback-reviewers,pip-reviewers,denschub,rpl,alwu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D152736
2022-08-03 11:16:20 +00:00
Nicolas Chevobbe 8435f69c2e Bug 1782527 - [devtools] Change devtools.chrome-debug-mode default value to parent-process. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D153432
2022-08-03 05:41:08 +00:00
Andreea Pavel 25cac4a79c Bug 1767705 - disable browser_dbg-breakpoints-popup.js on OSX10.15 r=intermittent-reviewers,MasterWayZ DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D152828
2022-08-01 22:16:23 +00:00
Luke Swiderski fcf8685f27 Bug 1696157 - Fix unexpected opening of breakpoints panel r=jdescottes
Previously when closing the breakpoints panel in secondary panes,
if an unselected call stack frame was selected, the breakpoints
panel would unexpectedly open.  This patch makes sure it remains
closed when a user has closed it and then clicks other elements
in the secondary panes.  The same issue was happening when
clicking the event listener breakpoint log checkbox, and or step
in, step out, and step over.  This patch should also fix
Bug 1755337.

Add mochitest.
Fix mochitest issues and move isFrameSelected to shared-head.js
Fix linting issues.
Merge new mochitests into browser_dbg-state-based-panels.js
Add condition to SecondaryPanes/index.js
Add PropTypes to index.js
Add logic to reducers/pause.js
Add selector to selectors/pause.js
Add breakpointsPane action to pause/actions
Update mochitests to test for edge case
Remove dbg_browser-breakpoints-secondary-pane.js
Fix linting
Make changes suggest by reviewer
Add additional mochitest for event breakoints log
Remove unnecessary parameters from action
Fix mozbuild order
Remove previewPausedLocation.js from mozbuild to fix conflict

Differential Revision: https://phabricator.services.mozilla.com/D149994
2022-07-29 19:00:06 +00:00
Nicolas Chevobbe 647cb2ce7f Bug 1779173 - [devtools] Fix call to isMinified in Debugger to prevent performance issue when opening big single-line file. r=jdescottes.
Changes in Bug 1754407 caused a performance regression as it now triggered
syntax highlighting of big files, which we avoided before.
This is because we don't call `isMinified` with the expected type of data, causing
the file to not be seen as minified, and thus highlighting it.

Differential Revision: https://phabricator.services.mozilla.com/D153140
2022-07-29 13:52:50 +00:00
Alexandre Poirot 0ecd2ffbaf Bug 1777203 - [devtools] Migrate SourceTree to be based on source actors. r=bomsy
This doesn't change anything. It actually complexify things a bit.
But this will be an helpful change we can do right away in order to help
create a unique Source object per URL (instead of per URL and target).

Differential Revision: https://phabricator.services.mozilla.com/D151553
2022-07-26 08:53:07 +00:00
Alexandre Poirot 71391f8516 Bug 1777203 - [devtools] Generate SourceTree data directly from the selectors. r=bomsy
This introduces a new reducer in order to maintain a Source Tree data structure.

A Source Tree is composed of:

* Thread Items
  To designate targets/threads. These are the roots of the Tree if no project directory is selected.

* Group Items
  To designates the different domains used in the website.
  These are direct children of threads and may contain directory or source items.

* Directory Items
  To designate all the folders. Note that each every folder has an items.
  The Source Tree React component is doing the magic to coallesce folders made
  of only one sub folder.

* Source Items
  To designate sources. They are the leaves of the Tree.
  (we should not have empty directories.)

See the creation methods in the reducer to see the various attributes available on each Item type.

Project root implementation has been simplified, but there is still subtantial complexity around it.
Also, there is a behavior change. Now the project root is thread specific,
whereas before it could be per domain/URL across threads.
The complexity of it is around preserving the `uniquePath` across reloads.
Because uniquePath starts with the thread actor ID, it can't be preserved across reload.
Instead, we replace the thread actor ID with "top-level" string.
This means that project root isn't preserved across reload for non-top-level targets.

About `uniquePath` attribute available on all items,
this will be the Path in ManagedTree and Key in Tree components.
i.e. a unique identifier for any item in the Tree.

The isWebExtension check is simplified to fetch it from the thread object,
instead of having to involve the "CONNECT" action.

Depends on D151467

Differential Revision: https://phabricator.services.mozilla.com/D150548
2022-07-26 08:53:07 +00:00
Julian Descottes de85956fad Bug 1770361 - [devtools] Fix intermittent failures for browser_dbg-iframes.js r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D152491
2022-07-22 07:56:49 +00:00
Alexandre Poirot 1e8fa48c4d Bug 1770361 - [devtools] Resume when the currently paused thread is destroyed. r=bomsy
Depends on D149361

Differential Revision: https://phabricator.services.mozilla.com/D146890
2022-07-21 21:46:03 +00:00
Hubert Boma Manilla 975bf013db Bug 1779243 - [devtools] Revert clearing all pending breakpoints in the async store on removeall r=jdescottes
This reverts clearing the async store when all breakpoints are removed.
So only the breakpoints the user expects to get removed actually gets removed.

Differential Revision: https://phabricator.services.mozilla.com/D151884
2022-07-21 21:10:46 +00:00
Alexandre Poirot dca4eb245a Bug 1778947 - [devtools] Compute source file extension once in its displayURL. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D151467
2022-07-20 14:25:02 +00:00
Alexandre Poirot 022e6168d2 Bug 1779966 - [devtools] Fix showing sources in quick open modal when we reach the max results limit. r=bomsy
Unfortunately, we filter out sources *after* having formated them.
So we can avoid formatting all the sources here.

I haven't investigated, but it would be nice to be able to filter out the sources
before formating them.

Differential Revision: https://phabricator.services.mozilla.com/D152014
2022-07-19 20:35:24 +00:00
Emilio Cobos Álvarez 42e744da41 Bug 1779559 - Disable Windows' window occlusion in some more mochitests. r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D152105
2022-07-19 09:25:53 +00:00
Alexandre Poirot 31a410d786 Bug 1778647 - [devtools] Store source's framework only once, in symbols. r=bomsy
We are currently duplicated source's framework in symbols and tabs reducers.
This is uncessary and confusing. And this possibly lead to more state/component updates.

This is mostly used to computed the source icon.
I extented test coverage to better cover the behavior of SourceIcon,
while simplifying a few things around this component by unifying the various places
where we compute the final icon, so that now it is only done by getSourceClassnames
and modifier.

Differential Revision: https://phabricator.services.mozilla.com/D151358
2022-07-12 11:55:43 +00:00
Alexandre Poirot e60b6faf26 Bug 1778514 - [devtools] Avoid mutating source objects because of relative url computation. r=bomsy
While I'm around QuickOpen modal, I also cleanup a few things around formatSources
and avoid computing more formatting than what the modal will display.

Differential Revision: https://phabricator.services.mozilla.com/D151285
2022-07-12 11:55:43 +00:00
Alexandre Poirot 08355cc774 Bug 1778078 - [devtools] Move blackbox state to a dedicated reducer and selectors. r=bomsy
This allows to make the reducer Source object fully immutable.
`isBlackBoxed` was the last mutable attribute of it.

Doing this help pass along source object without having to care if it will ever update.
This should also help reduce the number of unecessary update to components
which manipulate sources but ignore their blackbox state.

Differential Revision: https://phabricator.services.mozilla.com/D151005
2022-07-12 11:55:42 +00:00