This patch modifies and renameGeneratePureDOMFunctions.py so it generates a new file
indicating all the deprecated properties and methods so we can retrieve those information
in DevTools, in order, for example, to not call those deprecated properties and avoid generating
warning messages.
Differential Revision: https://phabricator.services.mozilla.com/D80864
Since capture.js was only loaded by server files and
save.js by client files, there wasn't any reason to
have them in devtools/shared.
The files are moved and the references are updated.
Differential Revision: https://phabricator.services.mozilla.com/D101142
This allows supporting image-set(), etc, and simplifies the bullet frame
code significantly, too thanks to two changes:
* Instead of manually managing the image request, use the CSS image
loader, with the `REQUEST_REQUIRES_REFLOW` flag, to handle image
loads correctly. This didn't exist when this code was initially
implemented, but we can nicely use it now.
* Instead of re-implementing another WebRender command-builder thing,
we can just reuse the nsImageRenderer code.
Differential Revision: https://phabricator.services.mozilla.com/D100774
This is no longer necessary as attach is no longer entering in a nested event loop.
And so we can have attach to complete and return its value as any other request.
Differential Revision: https://phabricator.services.mozilla.com/D100045
At the moment, the `getParent` method was using the connection `poolFor` method
to retrieve the pool that was managing it. This is quite costly as `poolFor`
loops through all the pools of the connection.
This patch adds a `parentPool` property to the Pool that is set in `manage` and
reset in `unmanage`, and used in the `getParent` method.
This speeds up getParent as well as the methods that call it (`manage` when the
actor was already managed, and `destroy`).
Differential Revision: https://phabricator.services.mozilla.com/D100981
When the user edits a stylesheet in the StyleEditor, an `_isUpdating` flag is toggled,
and a request is sent to the server to actually apply those changes to the stylesheet.
It then causes a style-applied event to be emitted (or the stylesheet resource
to be updated, if watcher support is enabled for stylesheet).
In the end, this triggers the onStyleApplied function in the StyleEditor, where
we check if the `_isUpdating` flag is true (to know if the event was caused
through editing in style editor), and if not, replace the stylesheet content.
Unfortunately there's a race condition when the user is typing (and sending
multiple requests to the server), as the state of the _isUpdating flag could
be wrong if a new request is sent before the first one is handled.
This is probably highlighted with the throttling we're doing in the Resource API.
To fix this issue, we add a new `cause` parameter to the StyleSheets.update method,
which we set to `styleeditor` when calling update within the StyleEditor.
This `cause` parameter is then sent back by the server to the client (via the
style-applied event, or the resource update if we have Watcher support for stylesheets).
This `cause` can be checked by the StyleEditor client, and replace the check
on `_isUpdating`.
However, we need to keep the `_isUpdating` property to handle backward compatibility.
Differential Revision: https://phabricator.services.mozilla.com/D99862
This fix pretty-printing of async functions in console. A test case is added
to make sure we don't regress.
We used to copy the library tests and run them in xpcshell. The tests changed
a lot, and I don't think we get much value running tests that are already ran on
the project CI (we do have a few tests that checks that we get the output we want)
, so this patch remove the xpcshell test and the associated files.
The upgrade documentation is updated to remove some unecessary steps:
- no need to rename the exported module for each file
- no need to replace the acorn module, since what's in the file is just a subset
of the library (~100 lines)
- no need to update the test file, which doesn't seem to exist anymore
Differential Revision: https://phabricator.services.mozilla.com/D99320
The watcher trait might not be set on other descriptors, so
we want to keep them until we can get rid of the generic client
code that is handling them. This can probably be done as part of Bug 1680280.
Differential Revision: https://phabricator.services.mozilla.com/D98737
Older message had a _type property and a different shape,
so we needed to transform them.
We shouldn't get those anymore since 78, so we can remove that code.
Differential Revision: https://phabricator.services.mozilla.com/D98729
Since we now always have a contentDomReference in grips, we
don't need to fallback on gripToNodeFront.
And since gripToNodeFront was only used from getNodeFrontFromNodeGrip,
we can remove it, as well as the walker actor method getNodeActorFromObjectActor.
We also had to get a content reference from a rendered Reps in the console, for
the "Reveal in inspector" context menu entry, so we stringigy it in a data attribute.
Differential Revision: https://phabricator.services.mozilla.com/D98720
Those methods were only kept for backward compatibility in the spec file, so we
can remove them from here.
`getText` is still used from the `StyleSheetFront#guessIndentation`, so we remove
the backward compat comment, and add more information on it.
The methods on the actor can't be removed as they're still called from the StyleSheetsActor
to support servers that don't use the resource watcher for stylesheets.
A test that was using those methods was updated.
Differential Revision: https://phabricator.services.mozilla.com/D98494
Those methods were only kept for backward compatibility in the spec file, so we
can remove them from here.
The methods on the actor can't be removed as they're still called from the StyleSheetsActor
to support servers that don't use the resource watcher for stylesheets.
A test that was using those methods was updated.
Differential Revision: https://phabricator.services.mozilla.com/D98494
The analyzeInputString function tried to handle escape characters in strings,
by having a dedicated ESCAPE state.
Unfortunately, when in ESCAPE state, the code will always re-assign the NORMAL state.
So if at some point the string was terminated, the code would assume we were entering
a string state again.
In the end, this would cause the autocomplete to fail, because the JSPropertyProvider
would think that it was passed an unterminated string literal.
This is fixed by introducing quote-specific escape state, so we know which state to get
back in once the escape character is consumed.
A few test cases are added to ensure this works as expected.
Differential Revision: https://phabricator.services.mozilla.com/D98754
Not doing that, makes the browser_resources_sources.js test to fail because
of pending SW's target which comes with unexpected sources.
Differential Revision: https://phabricator.services.mozilla.com/D98460
This helps cover the workaround put in ResourceWatcher in order to trigger
the SOURCE legacy listener for targets that we don't yet support in the Watcher actor.
Differential Revision: https://phabricator.services.mozilla.com/D98438
This patch adds a script which is similar to the one that was written in the README.md file.
This goes along with a simple package.json that let's us have a simple command
to execute the update script.
The README file is updated as well to reflect this new script.
Differential Revision: https://phabricator.services.mozilla.com/D98912
The changes should be trivial.
The third_party changes are up for review in
https://github.com/servo/rust-cssparser/pull/277 (and of course I'll
land with a bump to 0.28 rather than the override after that gets r+'d).
The basic idea is that with this we have the actual start offset of the
rule, so we wouldn't include html comments or other invalid stuff we
discard during sanitization in bug 1680084. But that's a separate
change.
Differential Revision: https://phabricator.services.mozilla.com/D98677
This is useful for SOURCE resource, as that's one resource that we expect to
fetch from all targets, but Service Worker and Shared worker targets aren't supported
yet by the watcher. So we should be using legacy listener for these.
Differential Revision: https://phabricator.services.mozilla.com/D97631
This turns all existing backward compatibility comments (or
comments mentioning a specific Firefox version), into the new
syntax we agreed upon in Bug 1673535.
Differential Revision: https://phabricator.services.mozilla.com/D97395
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.
This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.
Differential Revision: https://phabricator.services.mozilla.com/D94641
This change removes docshell's `mTouchEventsOverride` and replaces it
with a new `BrowsingContext` field `TouchEventsOverrideInternal`.
All uses of the old field have been replaced and an override should
now work under fission when there are cross-origin descendent frames.
Differential Revision: https://phabricator.services.mozilla.com/D96414
Previous `purgeRequestForDestroy` method was only rejecting all pending requests.
The new `syncFrontDestroy` allows to fully destroy the front, including
unregistering it/unmanage it. So that if we receive a packet from a brand new
actor, with the same prefix and actor ID, DevToolsClient.getFront doesn't return
the old destroyed front.
This issue was making pending requests that were never resolved.
Differential Revision: https://phabricator.services.mozilla.com/D94718
The function wasn't used, except in a test that this patch removes.
Since it was also the only use of the getSourcesManager hook, we're able to
remove it as well.
Differential Revision: https://phabricator.services.mozilla.com/D95989
actorhasMethod had several technical limitations making it hard to use consistently. We now removed all the call sites for this method. This changeset removes the method and all its dependencies.
Differential Revision: https://phabricator.services.mozilla.com/D95861
The `dom.worker.console.dispatch_events_to_main_thread` pref is used by platform
code to check if console API messages in the worker thread should be dispatched
to the main thread. If so, the message parameters are cloned, or stringified if
they can't be. This is currently the default behavior.
The pref is checked on the server side and added as a trait to the root actor.
On the client, if the pref isn't true, then we accept messages coming from
worker targets in the console. We can't accept them without condition, otherwise
we would get duplicated message (from the main thread AND the worker thread).
The browser_webconsole_console_logging_workers_api.js test is repurposed for
worker logging since it was disabled on e10s anyway. We add a few test case
to check we can get cached and live message, and that non-clonable object, like
worker scope, are displayed like regular objects when the pref is false.
Differential Revision: https://phabricator.services.mozilla.com/D85397
Depends on D95685
Keep the isFissionContentToolboxEnabled method but always return true to effectively enable all fission related behavior for all content toolboxes.
Differential Revision: https://phabricator.services.mozilla.com/D95686
This changeset only starts the FrameWatcher for any content toolbox.
The stack will progressively phase out the devtools.contenttoolbox.fission preference.
Differential Revision: https://phabricator.services.mozilla.com/D95685
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.
This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.
Differential Revision: https://phabricator.services.mozilla.com/D94641
Depends on D95297
After moving actors to individual files, we should also do the same with specs.
Both actors are using shared types, which are moved to a shared types file.
Differential Revision: https://phabricator.services.mozilla.com/D95298
This was hacking the internals of RDP/protocol.js in order to provide
different names to the actor prototype.
I had to rename existing `skipBreakpoints` getter in order to avoid
name collision with the RDP method of the same name.
I also had to tweak a few method arguments as they weren't following protocol.js spec.
They were called without protocol.js automatic marshalling of values.
Finally, hack something in protocol.js in order to avoid duplicated response for ThreadActor.attach.
Differential Revision: https://phabricator.services.mozilla.com/D94958
In most of our node tests (jest and mocha), we need to rely on fixtures for the
l10n modules because in its current shape, the module couldn't load the properties
files properly.
This patch fixes that by detecting if we're in a Node environment, and in such
case load the file using `readFileSync`.
We are also able to remove the specific code we had for webpack as it doesn't
seem to be used anymore.
The Spectrum.js file needed to be updated to fix the paths it was using.
Differential Revision: https://phabricator.services.mozilla.com/D94568
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Check that when removing iframes, we're notified about the worker unregistration,
and check that the target list works as expected when we have multiple iframes
on same origin (both remote and same-origin as main document).
The test documents are modified so we can avoid spawning shared and/or service
workers (in the case of this test, this seems to prevent some memory leaks/crashes).
Differential Revision: https://phabricator.services.mozilla.com/D88769
This patch adds support for dedicated worker targets in the Watcher actor.
Shared and Service workers are not handled yet.
In a similar manner to what we already have for frame targets, we add a worker-helper
file that will communicate with a JsWindowActor pair spawned on each document,
that will manage workers (DevToolsWorkerParent/DevToolsWorkerChild).
For a given document, the DevToolsWorkerChild will enumerate the existing workers
related to it, as well as add an event listener to be notified when workers are
being registered and unregistered, and communicate that back to the DevToolsWorkerParent
on the main thread, so worker targets creation and destruction are notified by
the Watcher actor (via target-available-form and target-destroyed-form events).
When a worker is created, the DevToolsWorkerChild for the document the worker
was spawned from will create a WorkerTargetActor, that will live in the worker
thread (using worker-connector.js), passing it resources the Watcher is currently
listening for. It will also handle communication between the main thread and the
worker thread, when the watcher listen to new resources (or stop watching resources).
A WorkerTargetFront is created so the client can be notified about available
resources (via the resource-available-form event, emitted from the worker target).
Tests are added in the next patches of this queue.
Differential Revision: https://phabricator.services.mozilla.com/D85399
Update the SetLine / ColSpan source-notes to be relative to the script's
initial line and column number. This allows for more bytecode sharing.
Differential Revision: https://phabricator.services.mozilla.com/D94116
Update the SetLine / ColSpan source-notes to be relative to the script's
initial line and column number. This allows for more bytecode sharing.
Differential Revision: https://phabricator.services.mozilla.com/D94116
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
This patch completely removes the `HighlighterActor` and its accessors.
The rest of the patches in this commit series update the consumers and tests to use the new highlighter manager added to `HighlightersOverlay` in D81526. [Bug 1646028](https://bugzilla.mozilla.org/show_bug.cgi?id=1646028) updated all consumers within the **Inspector** panel to use this approach. Now, we're updating the rest of the consumers outside the Inspector.
### Why remove HighlighterActor?
The changes introduced in D81526 for [Bug 1646028](https://bugzilla.mozilla.org/show_bug.cgi?id=1646028) make it possible to highlight nodes using the `CustomHighligtherActor` with the **Box Model Highlighter** implementation.
The `HighlighterActor` was itself a wrapper around **Box Model Highlighter** and Simple Outline Highlighter, and exposed node picking functionality. Simple Outline Highlighter was removed with [Bug 1650094](https://bugzilla.mozilla.org/show_bug.cgi?id=1650094). The node picking functionality was decoupled from `HighlighterActor`in [Bug 1607756](https://bugzilla.mozilla.org/show_bug.cgi?id=1607756).
After those changes, `HighlighterActor` is no longer special. It can be removed in favor of a single generic actor, `CustomHighligtherActor`, with the Box Model Highlighter implementation.
Differential Revision: https://phabricator.services.mozilla.com/D92220
For now, resource watcher tests were only testing resources from a single tab.
This test targets the main process, like the browser toolbox and so will listen to all targets,
including content process targets.
Differential Revision: https://phabricator.services.mozilla.com/D93734
Before, targets were created on-demand, from the frontend, by calling ProcessDescriptor.getTarget
when the root actor informed the frontend of a creation of a content process via processListChanged event
and the notification of a new ProcessDescriptor.
This previous behavior was making so that the target actor was created very late and did not allow
recording for resources (console messages for ex), nor setting breakpoints very early during the process startup.
With this new implementation, the watcher actor allows knowing if the frontend cares about content process target or not.
We should only create these targets if the browser toolbox is opened, and typically not if we are only debugging a tab via a regular web toolbox.
We do that via WatcherActor.watchTarget and sharedData object.
content-process-script.js is loaded in all processes. Process script are loaded quite early during process startup.
Soonish after `sharedData` is passed to the content process.
So that it is hopefully executed before most privileged javascript runs.
Javascript code where we possibly want to debug/observe/set a breakpoint on.
This setup allows us to create the Content Process Target actor much earlier than the previous setup.
When created, the target actor immediately start listening for resources (console message and others) via its `addWatcherDataEntry` method.
In a near future, breakpoints will also be set via this method.
We should also followup to use something else than Process Script and sharedData
in order to create the target earlier, before any JS runs.
Differential Revision: https://phabricator.services.mozilla.com/D65529
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
It's not 100% clear how long this command will live, but it doesn't look
immediately removable, and it was easy to add python3 support.
Differential Revision: https://phabricator.services.mozilla.com/D94179
This patch completely removes the `HighlighterActor` and its accessors.
The rest of the patches in this commit series update the consumers and tests to use the new highlighter manager added to `HighlightersOverlay` in D81526. [Bug 1646028](https://bugzilla.mozilla.org/show_bug.cgi?id=1646028) updated all consumers within the **Inspector** panel to use this approach. Now, we're updating the rest of the consumers outside the Inspector.
### Why remove HighlighterActor?
The changes introduced in D81526 for [Bug 1646028](https://bugzilla.mozilla.org/show_bug.cgi?id=1646028) make it possible to highlight nodes using the `CustomHighligtherActor` with the **Box Model Highlighter** implementation.
The `HighlighterActor` was itself a wrapper around **Box Model Highlighter** and Simple Outline Highlighter, and exposed node picking functionality. Simple Outline Highlighter was removed with [Bug 1650094](https://bugzilla.mozilla.org/show_bug.cgi?id=1650094). The node picking functionality was decoupled from `HighlighterActor`in [Bug 1607756](https://bugzilla.mozilla.org/show_bug.cgi?id=1607756).
After those changes, `HighlighterActor` is no longer special. It can be removed in favor of a single generic actor, `CustomHighligtherActor`, with the Box Model Highlighter implementation.
Differential Revision: https://phabricator.services.mozilla.com/D92220
Check that when removing iframes, we're notified about the worker unregistration,
and check that the target list works as expected when we have multiple iframes
on same origin (both remote and same-origin as main document).
Differential Revision: https://phabricator.services.mozilla.com/D88769
This patch adds support for dedicated worker targets in the Watcher actor.
Shared and Service workers are not handled yet.
In a similar manner to what we already have for frame targets, we add a worker-helper
file that will communicate with a JsWindowActor pair spawned on each document,
that will manage workers (DevToolsWorkerParent/DevToolsWorkerChild).
For a given document, the DevToolsWorkerChild will enumerate the existing workers
related to it, as well as add an event listener to be notified when workers are
being registered and unregistered, and communicate that back to the DevToolsWorkerParent
on the main thread, so worker targets creation and destruction are notified by
the Watcher actor (via target-available-form and target-destroyed-form events).
When a worker is created, the DevToolsWorkerChild for the document the worker
was spawned from will create a WorkerTargetActor, that will live in the worker
thread (using worker-connector.js), passing it resources the Watcher is currently
listening for. It will also handle communication between the main thread and the
worker thread, when the watcher listen to new resources (or stop watching resources).
A WorkerTargetFront is created so the client can be notified about available
resources (via the resource-available-form event, emitted from the worker target).
Tests are added in the next patches of this queue.
Differential Revision: https://phabricator.services.mozilla.com/D85399
We should only assert `updates` attribute on resource-updated,
as we aren't guaranteed how many updates we will have in resource-available.
That's because of resource throttling. Updates may be coalesced into available,
but we can't predict how many.
Differential Revision: https://phabricator.services.mozilla.com/D93337
Depends on D93029
Emitting "forwardingCancelled" will result in purging requests on the target front, which almost equates to destroying the front.
We should emit the "tabDetached" event before that to avoid emitting events on already destroyed fronts.
Differential Revision: https://phabricator.services.mozilla.com/D93030
Emitting "forwardingCancelled" will result in purging requests on the target front, which almost equates to destroying the front.
We should emit the "tabDetached" event before that to avoid emitting events on already destroyed fronts.
Differential Revision: https://phabricator.services.mozilla.com/D93029
The previous code was all wrong and we weren't correctly listening to resource
for already existing additional targets. Top level target was still working fine
thanks to WatcherActor.watchResources calling watchTargetResource directly.
Differential Revision: https://phabricator.services.mozilla.com/D91969
The problem with `getOverflowCausingElement`s seems to be that it returned an array
of nodes that weren't properly attached to their parents.
To mitigate this, we call `attachElements` on the entire list of nodes and
return a `disconnectedNodeArray` which ensures that the returned nodes
are properly attached and therefore has all their parent node information
when calling `showNode`.
Differential Revision: https://phabricator.services.mozilla.com/D92360
browser_ext_devtools_inspectedWindow_targetSwitch.js has top level targets that are destroyed while
the test runs. This makes the `sources` request to fail with an exception because when a target
is destroyed, we "purge" any pending request and make them throw/reject them.
This isn't super elegant, but the idea is that the server side implementation won't have this issue.
Differential Revision: https://phabricator.services.mozilla.com/D92371
This is D86050, rebased on top of current central. I kept it a separate commit, so the new stuff can be reviewed separately in a different revision.
Differential Revision: https://phabricator.services.mozilla.com/D91122
This patch adds a simple WorkerTargetActor, which is similar to the mock target
actor we had in startup/worker.js.
Its spec file is empty at the moment, and it does not have an associated front,
but that might change with Bug 1633712 where we will at least have events for
resources available/destroyed.
Differential Revision: https://phabricator.services.mozilla.com/D91128
This renames the current WorkerTargetActor which is actually a descriptor.
We also rename the existing `workerTargetFront` occurences to `workerDescriptorFront`
to avoid confusion when we do introduce the real worker fronts and actors.
Differential Revision: https://phabricator.services.mozilla.com/D91100
This patch adds a simple WorkerTargetActor, which is similar to the mock target
actor we had in startup/worker.js.
Its spec file is empty at the moment, and it does not have an associated front,
but that might change with Bug 1633712 where we will at least have events for
resources available/destroyed.
Differential Revision: https://phabricator.services.mozilla.com/D91128
This renames the current WorkerTargetActor which is actually a descriptor.
We also rename the existing `workerTargetFront` occurences to `workerDescriptorFront`
to avoid confusion when we do introduce the real worker fronts and actors.
Differential Revision: https://phabricator.services.mozilla.com/D91100
This renames the internal -moz-math-script-level property in order to
prepare for full math-depth support. Currently, the property is guarded
under a disabled-by-default flag, so there should be no observable
behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D91285
This renames the internal -moz-math-script-level property in order to
prepare for full math-depth support. Currently, the property is guarded
under a disabled-by-default flag, so there should be no observable
behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D91285
Because of this, in netmonitor stubs tests, the resource objects ends up loosing
"intermediate" state and now contains all information that we gathered by the time
we emit throttled resources.
The only way to address that would be to do an archived copy of each resource state,
but I don't think we want to do that...
Differential Revision: https://phabricator.services.mozilla.com/D89628