25735 Commits

Author SHA1 Message Date
Sean Feng
bd249c4f8e Bug 1797947 - Make devtools generated fetch requests excluded from resource timing r=jdescottes,valentin,necko-reviewers
Devtools can generate fetch request on behalf of the content document,
reporting these requests in PerformanceObserver would cause confusion,
so we should ignore them.

Differential Revision: https://phabricator.services.mozilla.com/D162582
2022-11-22 14:24:19 +00:00
Emilio Cobos Álvarez
0b6c9c0421 Bug 1798396 - Update property database to account for previous change.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2022-11-22 15:57:29 +01:00
Emilio Cobos Álvarez
905441daab Bug 1801123 - Enable container queries on nightly. r=dshin
There's only one worrying timeout
(css/css-contain/container-queries/inline-size-bfc-floats.html), but it
isn't a "hard" hang, but an invalidation loop.

Let's enable this by default on nightly to get some feedback while we
work on it and the remaining issues that block enabling them by default.

Differential Revision: https://phabricator.services.mozilla.com/D162292
2022-11-21 10:04:31 +00:00
Julian Descottes
dff8d66458 Bug 1797785 - [devtools] Add tests for Network Observer r=bomsy
Depends on D162193

This adds only very basic tests for the observer, but I would like to discuss about switching the API to a fully event-based solution.
I initially decided against it because I didn't want to create unnecessary changes for DevTools, but in the end, the owner pattern is quite verbose if
we want to use it for testing. Having events instead would make it more flexible, we could test only what we are interested in, with minimal overhead.

If we agree on this, we can land those very simple tests and I can move on to change the API to use events and update the tests, before we add more
tests.

Differential Revision: https://phabricator.services.mozilla.com/D162195
2022-11-18 15:52:05 +00:00
Julian Descottes
846a5b9fb2 Bug 1797785 - [devtools] Switch NetworkObserver constructor to named arguments r=bomsy
While writing a test, I forgot that the filter function was an "ignore" function. Using named arguments should avoid this. Maybe we should
consider using a regular filter approach (ie return true if we want to keep the request)?

Differential Revision: https://phabricator.services.mozilla.com/D162193
2022-11-18 15:52:04 +00:00
Sebastian Zartner
8bc914b5d9 Bug 1801045 - Replaced ObjectInspector handling for custom formatter output by separate one. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D159166
2022-11-18 08:27:39 +00:00
Sebastian Zartner
c6907a035c Bug 1801040 - Added option to makeSideeffectFreeDebugger() to skip checking effectful offsets. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D162151
2022-11-17 13:51:42 +00:00
Mark Banner
e37f1bd043 Bug 1799314 - Convert consumers of testing modules to import ES modules direct (devtools/). r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D161916
2022-11-17 12:00:31 +00:00
Mark Banner
24f6e8a8ca Bug 1799314 - Convert most of the JSM modules in testing/ to ES modules. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D161431
2022-11-17 12:00:25 +00:00
Csoregi Natalia
1e7d2e7ed6 Backed out 2 changesets (bug 1801040, bug 1801045) for causing failures on browser_webconsole_object_inspector_custom_formatters.js. CLOSED TREE
Backed out changeset ff58ef6ef9ae (bug 1801045)
Backed out changeset 668624c2b096 (bug 1801040)
2022-11-17 12:27:32 +02:00
Sebastian Zartner
fd27354335 Bug 1801045 - Replaced ObjectInspector handling for custom formatter output by separate one. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D159166
2022-11-17 09:12:09 +00:00
Sebastian Zartner
9d924f25f7 Bug 1801040 - Added option to makeSideeffectFreeDebugger() to skip checking effectful offsets. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D162151
2022-11-17 09:12:08 +00:00
Mike Conley
b535f2de6c Bug 1799947 - Update existing tests to put browser_action's into the navbar by default. r=willdurand,extension-reviewers
We had a number of tests that assumed that when adding a browser_action without
specifying the default_area, that the button would enter the navbar. The previous
patch in this series changes that assumption when the Unified Extensions UI is
enabled.

Instead of updating all of these tests to add additional steps to move the
browser_action's out to the navbar after adding them, I've gone ahead and
updated them to default their browser_action's to the navbar instead.

Differential Revision: https://phabricator.services.mozilla.com/D161721
2022-11-16 22:12:52 +00:00
Emilio Cobos Álvarez
31c279d479 Bug 1799460 - Implement label[value] and start/end cropping with CSS rather than XUL layout. r=Gijs,jfkthame
This reduces the weird interactions that can appear on menus.

This also progresses BiDi support, including for accesskeys.

Differential Revision: https://phabricator.services.mozilla.com/D161498
2022-11-16 16:27:59 +00:00
Emilio Cobos Álvarez
a07e8ff8eb Bug 1800473 - Remove custom devtools highlighters for XUL windows. r=nchevobbe
For a while we've supported nsCanvasFrame in XUL windows too, so this
shouldn't be needed.

Differential Revision: https://phabricator.services.mozilla.com/D162000
2022-11-15 19:14:59 +00:00
Julian Descottes
f0f16aa8ec Bug 1799831 - [devtools] Add test for netmonitor/src/components/request-details/CachePanel.js r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D161732
2022-11-15 17:08:53 +00:00
htmlHxcker
e7bda5167a Bug 1653077 - Update top-padding of welcomebox so it looks more vertically centered in dock-to-bottom r=bomsy
Depends on D128204

Differential Revision: https://phabricator.services.mozilla.com/D128269
2022-11-15 13:42:52 +00:00
Karntino Areros
eb7b0b60a9 Bug 1598974 - slightly changes the color of the watchpoint markers when highlighted. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D87871
2022-11-15 11:21:25 +00:00
Zachary Svoboda
df8c460a6b Bug 1617474 - Match json viewer toolbar height to devtools r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D160286
2022-11-15 07:33:04 +00:00
Nicolas Chevobbe
fcbbb2a2d1 Bug 1800466 - [devtools] Update compatibility data. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D161998
2022-11-15 06:12:37 +00:00
Nicolas Chevobbe
3163364560 Bug 1800463 - [devtools] Remove backward compatibility code added in 106. r=jdescottes.
There was also an erroneous backward compat added in 108 but referencing
106, this patch fixes it.

Differential Revision: https://phabricator.services.mozilla.com/D161995
2022-11-15 06:12:37 +00:00
Hubert Boma Manilla
953c32a9b4 Bug 1687951 - [devtools] Clear the caches for the sourcemap url service r=jdescottes
This patch
- Clears the `_mapsById` map when clearing all state.
- Fix bug introduced during fission work which stops from clearing any of the states at all. `isTopLevel` no longer
   exists on the `resource`, rather we can get that from the `targetFront`.

Differential Revision: https://phabricator.services.mozilla.com/D161677
2022-11-14 14:18:44 +00:00
Julian Descottes
547bde34a3 Bug 1798848 - [devtools] Fix add new rule for pages with style-src CSP when using stylesheet resource r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D161932
2022-11-14 09:40:08 +00:00
Emilio Cobos Álvarez
32bf0f5057 Bug 1799984 - Don't make transition rules apply to native-anonymous content like scrollbars. r=nchevobbe
This rule is still a massive hack. Also doesn't work on Shadow DOM, and
I'd rather remove it... But this should fix the assertion.

Differential Revision: https://phabricator.services.mozilla.com/D161778
2022-11-10 14:12:52 +00:00
Nicolas Chevobbe
25ec438f2b Bug 1799775 - [devtools] Fix browser_rules_container-queries.js intermittent failures. r=jdescottes.
So it looks like triggering the query container tooltip also shows the highlighter,
and then, later, in another function, we do assert the highlighter behavior.
Since we didn't planned for the first highlighter, we might end up in an unexpected
state.
The fix is to wait for the highlighter to be displayed (and then hidden) in the
function checking the tooltip.

Differential Revision: https://phabricator.services.mozilla.com/D161758
2022-11-10 08:50:52 +00:00
Julian Descottes
2ed39ba992 Bug 1788773 - [devtools] network observer: set default values for properties in class definition r=ochameau
Depends on D161691

Differential Revision: https://phabricator.services.mozilla.com/D161692
2022-11-10 08:07:58 +00:00
Julian Descottes
c527683d45 Bug 1788773 - [devtools] Define QueryInterface in class definition instead of constructor for network observer modules r=ochameau
Depends on D161690

Differential Revision: https://phabricator.services.mozilla.com/D161691
2022-11-10 08:07:57 +00:00
Julian Descottes
488833475a Bug 1788773 - [devtools] Use explicit getter and setter methods in NetworkObserver r=ochameau
Depends on D161689

Differential Revision: https://phabricator.services.mozilla.com/D161690
2022-11-10 08:07:57 +00:00
Julian Descottes
bcdf42f8ed Bug 1788773 - [devtools] Merge NetworkObserver init() in constructor r=ochameau
Depends on D161688

Differential Revision: https://phabricator.services.mozilla.com/D161689
2022-11-10 08:07:57 +00:00
Julian Descottes
99b9961ed8 Bug 1788773 - [devtools] Reuse property names from nsICacheEntry in devtools ResponseCache object r=ochameau
Depends on D161687

Differential Revision: https://phabricator.services.mozilla.com/D161688
2022-11-10 08:07:56 +00:00
Julian Descottes
f11c34902f Bug 1788773 - [devtools] Return a promise from CacheEntry.getCacheEntry r=ochameau
Depends on D161320

Differential Revision: https://phabricator.services.mozilla.com/D161687
2022-11-10 08:07:56 +00:00
Julian Descottes
98f7cce514 Bug 1788773 - [devtools] Remove filters argument from NetworkObserver r=ochameau
Depends on D161319

The filters & shouldIgnoreChannel arguments feel redundant and make the class harder to reuse outside of devtools, because the filters we currently accept are very much tied to devtools logic. If we switch the filtering logic to only use the shouldIgnoreChannel callback, any consumer can decide of the logic to filter out events.

We could then try to share filters between devtools and bidi, but for now simplifying the signature seems reasonable.

Differential Revision: https://phabricator.services.mozilla.com/D161320
2022-11-10 08:07:56 +00:00
Julian Descottes
25a005731b Bug 1788773 - [devtools] Remove owner property from NetworkObserver r=ochameau
Depends on D161318

The owner property of the NetworkObserver has 2 roles:
- it provides 2 callbacks: onNetworkEvent and shouldIgnoreChannel
- it is used for null checks to know if the NetworkObserver was already destroyed

For the first item we switch to 2 explicit arguments. For the second item, we add a private `#isDestroyed` flag.
With this, the only `owner` left in this codebase, is the network event owner, which would also be nice to remove.

Note that for now I am still keeping a "callback" approach for "onNetworkEvent" rather than emitting an event from NetworkObserver. The reason behind this is that we expect `onNetworkEvent` to return the network event's owner, and this cannot be cleanly emulated with an event-based approach. Maybe further down the road we can fully switch to events, but as an intermediary step this would make things harder to understand.

Differential Revision: https://phabricator.services.mozilla.com/D161319
2022-11-10 08:07:55 +00:00
Julian Descottes
755b5d5067 Bug 1788773 - [devtools] Rename owner to networkObserver in NetworkResponseListener r=ochameau
Depends on D161317

There are 3 different "owner" in the network observer codebase:
- the network observer's owner
- the network events' owners
- the network response listener's owner

The last one is really just always the parent NetworkObserver instance, so let's make it clear and rename this `owner` accordingly

Differential Revision: https://phabricator.services.mozilla.com/D161318
2022-11-10 08:07:55 +00:00
Julian Descottes
e366687b9c Bug 1788773 - [devtools] Use private properties in NetworkResponseListener.sys.mjs r=ochameau
Depends on D161316

Same as for NetworkObserver, we also start using private properties in NetworkResponseListener

Differential Revision: https://phabricator.services.mozilla.com/D161317
2022-11-10 08:07:54 +00:00
Julian Descottes
3315c4fa6b Bug 1788773 - [devtools] Use private properties in NetworkObserver.sys.mjs r=ochameau
Depends on D161315

NetworkObserver was already a class, but it was not yet using private properties. This makes it more difficult to refactor, as you don't really know what is used outside of the file.

Differential Revision: https://phabricator.services.mozilla.com/D161316
2022-11-10 08:07:54 +00:00
Julian Descottes
c7249fe2d1 Bug 1788773 - [devtools] Migrate Throttle helper classes to a JavaScript class r=ochameau
Depends on D161314

Differential Revision: https://phabricator.services.mozilla.com/D161315
2022-11-10 08:07:53 +00:00
Julian Descottes
b37bf1b2b8 Bug 1788773 - [devtools] Migrate CacheEntry to a JavaScript class r=ochameau
CacheEntry was still created as a function, migrate it to a regular class.

Differential Revision: https://phabricator.services.mozilla.com/D161314
2022-11-10 08:07:53 +00:00
Nicolas Chevobbe
a49c3bce45 Bug 1788033 - [devtools] Update StyleEditor documentation for at-rules sidebar. r=jdescottes.
We take this as an opportunity to update the existing
screenshots of the page as the previous one were quite
outdated.

Differential Revision: https://phabricator.services.mozilla.com/D161684
2022-11-09 16:29:51 +00:00
Nicolas Chevobbe
6153f85643 Bug 1788033 - [devtools] Display container, layer and supports in StyleEditor at-rules sidebar. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D157084
2022-11-09 16:29:51 +00:00
Nicolas Chevobbe
38d79b9eaf Bug 1788033 - [devtools] Rename StyleEditor media sidebar to at-rules sidebar. r=jdescottes,fluent-reviewers,devtools-backward-compat-reviewers.
Since we plan to add other rules than `@media` into the sidebar, it makes sense
to rename it.

Differential Revision: https://phabricator.services.mozilla.com/D157083
2022-11-09 16:29:50 +00:00
Julian Descottes
10bc25610c Bug 1414361 - [devtools] Truncate extremely long text nodes in the ruleview r=nchevobbe
Depends on D161494

In this bug, if we fix the original issue, the markupview will start rendering a property value with the base64 for the image, but the text is so long that the markup view becomes unusable both from a UX perspective (node is way too tall) and from a performance perspective (resizing the markupview triggers reflow which freeze the browser for a very long time).

Differential Revision: https://phabricator.services.mozilla.com/D161559
2022-11-09 14:37:23 +00:00
Julian Descottes
03f9bfbebf Bug 1414361 - [devtools] Fix ruleview with large base64 background image r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D161494
2022-11-09 14:37:22 +00:00
Julian Descottes
b6a02f0024 Bug 1788777 - [devtools] Group all network-observer related modules in a single folder r=ochameau,Sasha
This patch is only moving all network observer files in the same folder.
For webdriver reviewers, we could update our phabricator herald rule to be added as reviewers for changes in this folder?

Differential Revision: https://phabricator.services.mozilla.com/D160241
2022-11-08 20:27:50 +00:00
Alexandre Poirot
db142838b3 Bug 1794693 - [devtools] Convert source-map jest test into mochitests. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D159116
2022-11-08 16:01:01 +00:00
Alexandre Poirot
ae7b6ea7e4 Bug 1794693 - [devtools] Move devtools-source-map to regular mozilla-central code. r=bomsy,perftest-reviewers,jdescottes,sparky
This used to be a node package. Let's make it become regular commonjs devtools modules.
This will make it trivial to migrate this to ES Modules.
Also possibly make this code become the unique layer in m-c on top of the source-map package.

We no longer use webpack to build the two bundles (index.js and worker.js),
instead, we are using the toolkit worker loader (require.js) in order to load
all this code without any build step.

As this is no longer a node package, I removed node-specific modules (assertRoot/wasmAsset)
and simplify the definition of wasm file URIs as they are now fixed.

Also moving the debugger to load internal "devtools/client/shared/source-map/source-map.js"
module in jest as running the Web Worker instantiated by source-map/index.js is too complex.

Differential Revision: https://phabricator.services.mozilla.com/D159115
2022-11-08 16:01:01 +00:00
Alexandre Poirot
828625049b Bug 1794692 - [devtools] Vendor source-map package in devtools more explicitly. r=bomsy
For now, it was vendored by a manual run to webpack from the debugger folder (node bin/bundle.js).
Ship a more explicit bundle of it, next to all other already existing vendored files.

$ git clone git@github.com:mozilla/source-map.git
$ cd source-map/
$ git checkout 0.8.0-beta.0
$ rm -rf .git/
/!\ lib/read-wasm.js has been edited and need to be preserved/rebased /!\
$ hg/git add source-map.js LICENCE lib/

Also, hopefully temporarily vendor whatwg-url:
$ git clone git@github.com:jsdom/whatwg-url.git
$ cd whatwg-url/
$ npm install
$ npm run build
$ npm run build-live-viewer
$ cp live-viewer/whatwg-url.js ..
$ hg/git add whatwg-url.js

and also temporarily replace source-map/lib/url.js with source-map/lib/url-browser.js
And edit this file to do:
  module.exports = require("devtools/client/shared/vendor/whatwg-url").URL;

Hopefully, we can remove whatwg-url dependency and remove all this.

Differential Revision: https://phabricator.services.mozilla.com/D159113
2022-11-08 16:00:59 +00:00
Alexandre Poirot
eb43068a10 Bug 1794692 - [devtools] Add MD5 vendored library for workers. r=bomsy
The MD5 file is being updated via:
$ wget https://github.com/pvorb/node-md5/archive/refs/tags/v2.3.0.tar.gz
$ tar zxvf v2.3.0.tar.gz
$ cd node-md5-2.3.0/
=> here edit webpack.config.js to set `libraryTarget: "umd"`
$ yarn webpack
$ cp dist/md5.min.js ../md5.js
$ cd ..
$ rm -rf v2.3.0.tar.gz node-md5-2.3.0

Vendor it in m-c, so that it can be used as a regular module
and not bundled via WebPack.

Differential Revision: https://phabricator.services.mozilla.com/D159112
2022-11-08 16:00:59 +00:00
Nicolas Chevobbe
00840021c6 Bug 1796095 - [devtools] Display query container data in a tooltip in the rule view. r=jdescottes,devtools-backward-compat-reviewers.
This patch adds a tooltip that is displayed when the user hovers a `@container`
declaration in the rule view.
The tooltip displays the query container that is used for this rule and the selected
node and the computed values of its `containerType`, `inlineSize` and `blockSize`
(if the `containerType` is `size`) properties.

The title attribute is removed on the `ruleview-rule-ancestor-data` items as it
was not playing well with the new tooltip. The styling for those element is
modified so they are never cropped so we can see the whole text (and don't need
the title anymore).

A test case is added to make sure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D161129
2022-11-08 12:46:27 +00:00
Mark Banner
18753bfe42 Bug 1798212 - Convert consumers of downloads code to ES modules. r=mak,geckoview-reviewers,extension-reviewers,settings-reviewers,credential-management-reviewers,sgalich,mconley,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D161013
2022-11-07 17:56:10 +00:00