Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.
As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).
For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.
For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.
Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.
Differential Revision: https://phabricator.services.mozilla.com/D157875
Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.
As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).
For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.
For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.
Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.
Differential Revision: https://phabricator.services.mozilla.com/D157875
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
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
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
This gecko integration code is better managed with the other devtools platform
hook code. To simplify resolving the JSM and avoiding issues around restricted
use of eval in chrome, I also reset the DIST_SUBDIR config and run the xpcshell
tests without a firefox-appdir. The test works on Android these days, so
re-enable it on that platform.
Differential Revision: https://phabricator.services.mozilla.com/D157522
Use 'globalThis' instead of 'this' when trying to attach a debugger to the
current global to avoid subtle footguns with the varied definitions of 'this'.
The debugger interface needs a true GlobalObject so this is much clearer. In
particular, this is a problem in test_nativewrappers.js when the test runs in
strict mode since the 'this' in the test function is no long implicitly the
global.
Differential Revision: https://phabricator.services.mozilla.com/D157544
This help factorise all code trying to instantiate a server and a client everywhere.
This will also help migrate from descriptor to commands in Toolbox constructor.
A good way to track all leftover manual instantiation of descriptors is to look for mainRoot.get*.
There should only be tests now, and descriptor-from-url, which I would to convert once
we migrate toolbox constructor from descriptor to commands.
Differential Revision: https://phabricator.services.mozilla.com/D157737
.browserContainer is relatively positioned, so we can position the
tab-modal dialogs absolutely inside it instead of making them part of
the browser stack.
While at it, make the rdm toolbar part of the regular browserContainer,
just like the regular devtools toolbox is. That way there's no need to
do ResizeObserver shenanigans to be able to let it grow. Keep it also
absolutely positioned tho, because we need to overlay the whole
container when the device modal is opened. That's somewhat gross.
This should in general be simpler to understand than the current set-up,
and more performant to since it avoids the dialog stack from forming
part of the browser element's flow.
Differential Revision: https://phabricator.services.mozilla.com/D157912
This symbol is specific to documents and isn't available in JSM/ESM.
So it will be best to keep it manually crafter from the modules.
It appears that only async-storage depends on the overloaded indexedDB
object created by devtools/shared/indexed-db.
Differential Revision: https://phabricator.services.mozilla.com/D157424
This will help transition to ES Modules as we won't be able to expose a magic "chrome" ESM.
Also, most of these symbols are exposed as global already.
All but:
* `components` which is `Components`,
* `CC` which is `Components.Constructor`,
* `Cm` which is `Components.manager`.
$ sed -ie "/require(.chrome.)/d" $(git grep -l 'require("chrome")' devtools/)
+ manual edits for all three exceptions
Differential Revision: https://phabricator.services.mozilla.com/D156936
This will actually make commonjs module behave like JSM/ESM.
Where you have access to Components, Cc, Ci, Cu and Cr as globals.
This patch is based on the usage of Sandbox's wantComponents,
which will expose all these globals for us.
Then, I'm handling the special cases of Services and ChromeWorker,
which have nothing to do with Components.* APIs.
Differential Revision: https://phabricator.services.mozilla.com/D156935
The font-size math keyword is implemented. It behaves as a font-size: 1em
with the extra fixup due to math-level change (and other legacy MathML
attributes). After that change, the CSS for math-level / font-size: math
is behaving as per the specification, so the math-depth is turned in
nightly.
The adjusting function for font-size: math is modified so that it's
executed only if both font-size: math (otherwise the spec says no scale
should apply) and math-depth (otherwise the scale is 1 and function exists
early anyway) are set on the element. Also checking if the current node
has a scriptsizemultiplier rule applied to use MathML3's scaling is
incorrect. Instead this is changed to check if a non-default
scriptsizemultiplier is set.
Differential Revision: https://phabricator.services.mozilla.com/D91744
This allows to keep the DevTools visible while interacting with the Firefox
window where the extension is running.
This behavior is enabled by default, but can be disable on-demand via a button
in the top toolbar.
Note that it requires to close and reopen the window/toolbox as platform APIs
disallow changing this behavior "live" on a given window.
Differential Revision: https://phabricator.services.mozilla.com/D155843
This was added in the original landing of the TreeWidget.
Nowadays this is only used by the storage inspector and I haven't seen any bad side effect.
Differential Revision: https://phabricator.services.mozilla.com/D157368
The DevToolsSocketStatus could be misleading for any usage other than the current one from browser.js since it misses browser toolbox sockets
This patch allows the singleton to track all sockets but changes the API to allow consumers to exclude browser toolbox sockets.
Differential Revision: https://phabricator.services.mozilla.com/D157300
Adding a test explicitly resizing the toolbox by manipulating the splitter in both horizontal and vertical configurations
Differential Revision: https://phabricator.services.mozilla.com/D157339
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 <rachel@betterbird.eu>, as a part of Betterbird.
Differential Revision: https://phabricator.services.mozilla.com/D149644
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
Now that the script is run on automation, there's no need to have
a (different) version in tree.
The documentation is also updated to explain the current setup.
Differential Revision: https://phabricator.services.mozilla.com/D156930
This will help transition to ES Modules as this symbol is exposed to them.
$ sed -ie "/require(.ChromeUtils.)/d" $(git grep -l 'require("ChromeUtils")' devtools/)
$ sed -ie "/loader.lazyRequireGetter(this, .ChromeUtils./d" $(git grep -l 'loader.lazyRequireGetter(this, "ChromeUtils"' devtools/)
+ the edition of builtin-modules.js + eslintrc.js + manual eslint fixes
Differential Revision: https://phabricator.services.mozilla.com/D156402
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
It's always true, so remove it.
Add another pref to allow -webkit-line-clamp to work on all blocks
rather than just legacy -webkit-boxes, which seems something we should
try to look into, eventually.
Depends on D155181
Differential Revision: https://phabricator.services.mozilla.com/D155182
This allows to keep the DevTools visible while interacting with the Firefox
window where the extension is running.
This behavior is enabled by default, but can be disable on-demand via a button
in the top toolbar.
Note that it requires to close and reopen the window/toolbox as platform APIs
disallow changing this behavior "live" on a given window.
Differential Revision: https://phabricator.services.mozilla.com/D155843
Depends on D156655
system stylesheets cannot be disabled, apply a dedicated classname on the summary and disable the visibility toggle
Differential Revision: https://phabricator.services.mozilla.com/D156082
Right now, the vertical position of the status panel is the "auto"
position, which ends up working out, but mostly by chance, and relies on
behavior that's different from the standard flexbox, see bug 1789165.
Instead of using `position: fixed` and relying on not having any
sidebars or other content to the inline-end (otherwise the [mirror] rule
would be incorrect), explicitly position it against the
.browserContainer.
Differential Revision: https://phabricator.services.mozilla.com/D156384
In StyleSheetsManager _getMediaRules, we were only looping
over document.cssRules, and as a result were missing potential
nested media queries.
For each rule, we now go other its potential cssRules, recursively,
to gather all media query rules.
Test cases are added for the client to make sure that those nested
rules do show up in the StyleEditor media queries sidebar.
Differential Revision: https://phabricator.services.mozilla.com/D156277
Two issues fixed:
- when sorting on one column, other column content should be re-arranged
- natural order sort was not symmetrical for dates and led to inconsistent sorting
Differential Revision: https://phabricator.services.mozilla.com/D156420
In md files and code comments and mostly from common js files.
I'm moving away from require to load sys.mjs files so that we are closer
to what we do in mozilla-central.
Differential Revision: https://phabricator.services.mozilla.com/D154073
This patch adds reverts back to having distint context menu items for 'Resend' and 'Edit and Resend'
but this is using the new http custom request functionality.
Differential Revision: https://phabricator.services.mozilla.com/D155159
Since we already had a test case for nested at-rules in
browser_rules_container-queries.js, I'm moving it to a
new test where we can test all the different at-rules that
can be nested (including `@supports`).
Differential Revision: https://phabricator.services.mozilla.com/D156313
`ChromeUtils.dateNow()` has a higher precision than `Date.now()`, which is useful for ordering
of messages in the console output.
Differential Revision: https://phabricator.services.mozilla.com/D155548
We can get a higher precision timestamp from microSecondTimeStamp, which will be consumed
in the console client to re-order messages.
This fixes an issue where different type of resources (console-messages and error-messages)
emitted during the same timestamp would not appear in the order they should be in.
A test is added to make sure the fix is effective.
Differential Revision: https://phabricator.services.mozilla.com/D155546
Note that it will also stop showing locale and popup settings for remote browser toolboxes.
Toolbox.isBrowserToolbox being false for this usecase.
Differential Revision: https://phabricator.services.mozilla.com/D155956
_buildTabs/_setInitialMeatballState wasn't awaited for.
So that preference front request might be pending when closing the toolbox too quickly in tests.
We should wait for all RDP requests to be completed before resolving Toolbox.open.
Differential Revision: https://phabricator.services.mozilla.com/D155872
It looks like there was some (hardware?) changes on TRY
which caused the test to run in Coordinated Universal Time
timezone, when one test expect it to be CEST.
We force the timezone in the test command so it will
always be CEST.
Differential Revision: https://phabricator.services.mozilla.com/D155818
A couple test were failing because we're now using :is() in CSS,
which wasn't supported by the older version of jsdom we had.
Updating jsdom seems to fix the issue. It required to mock
TextEncoder and TextDecoder for jest tests.
Differential Revision: https://phabricator.services.mozilla.com/D155813
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
This is a first basic implementation that we might extend in the future
(for example by adding a way to select the container node when clicking
on the container name).
A test is added to ensure we display container queries as expected, even
when dealing with unknown containers, or with nested layer/media/container rules.
Depends on D155602
Differential Revision: https://phabricator.services.mozilla.com/D155469
The data were presented in a table-like fashion, but weren't using accessible
elements for this, making it impossible to understand when using a screenreader.
We switch to use `<table>` and proper internal elements.
The pie-chart wasn't accessible at all, so we create groups and adds proper role
to items, and wrap slices in an interactive element so they can be interacted with
through the keyboard. This allow us to remove the fail-if annotation on the browser_net_statistics-02.js test.
Some items were missing, both in the table and the pie-chart, to make the panel
cleaner. The downside is that it was hard for a keyboard-only user to understand
the whole thing. So now, we do put all the data in the DOM, and label them with
'aria-label' attribute when needed..
Finally, we take this opportuniy to cleanup the implementation a bit, removing
unnecessary CSS and properties.
Differential Revision: https://phabricator.services.mozilla.com/D155364
After the preceding change, the editMenuOverlay strings are only used by the styleeditor.
Therefore it makes sense to migrate them here specifically to its localization file.
Differential Revision: https://phabricator.services.mozilla.com/D155449
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
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
The ColorSchemeMode::Preferred change doesn't make a difference (that
is, always use the preferred one), since when we only propagate from
top's embedder the embedder is chrome, which always has the preferred
color-scheme.
Differential Revision: https://phabricator.services.mozilla.com/D154931
It seems that making animation shorthand supports animation-composition may be
very tricky, so it's unlikely to include animation-composition into the
shorthand for now, per spec issue:
https://github.com/w3c/csswg-drafts/issues/6946.
WebKit also supports the longhand only on STP (Safari Technology Preview), so
it should be fine to enable the longhand property only on Firefox Nightly,
for experiemental testing.
Differential Revision: https://phabricator.services.mozilla.com/D154934
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
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
This makes it easier to get parity between legacy and regular flex
without having to either have tons of arbitrary attribute selectors in
the xul sheet, nor adding attribute lookup hacks to the html flexbox
layout.
Also, reimplement the remaining supported flex attribute-values (0 and 1)
purely in terms of CSS rules in xul.css (regardless of whether
emulate-moz-box-with-flex is enabled).
In practice these are pretty uncommon and the style attribute does the
trick in every case I've tried.
Add a debug-only assertion to ensure we preserve behavior for now.
Add a new test with another behavior difference between flexbox
emulation and old xul layout because the old reftest now passes. Use
replaced elements, which in modern flex are treated differently.
Differential Revision: https://phabricator.services.mozilla.com/D154394
This makes it easier to get parity between legacy and regular flex
without having to either have tons of arbitrary attribute selectors in
the xul sheet, nor adding attribute lookup hacks to the html flexbox
layout.
Also, reimplement the remaining supported flex attribute-values (0 and 1)
purely in terms of CSS rules in xul.css (regardless of whether
emulate-moz-box-with-flex is enabled).
In practice these are pretty uncommon and the style attribute does the
trick in every case I've tried.
Add a debug-only assertion to ensure we preserve behavior for now.
Add a new test with another behavior difference between flexbox
emulation and old xul layout because the old reftest now passes. Use
replaced elements, which in modern flex are treated differently.
Differential Revision: https://phabricator.services.mozilla.com/D154394
Since the select node in inspector simply re-use the inspector icon,
we're doing here, using a sized-down version of the a11y panel icon.
Differential Revision: https://phabricator.services.mozilla.com/D154509
This will add proper titles to the icons we display in the accessibility
panel to select a node in the Accessibility Tree or in the inspector (if it's
a dom node).
Assertions are added in tests to ensure we don't regress.
Differential Revision: https://phabricator.services.mozilla.com/D154406
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
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
This is still one blind spot with privileged request done by content processes.
They aren't related to any BrowsingContext/WindowGlobal and there isn't any
attribute on channel/loadInfo which helps knowing they originates from a content process.
Differential Revision: https://phabricator.services.mozilla.com/D150014
The Front.watchFronts API is sparsly used whereas we always instantiate
two EventEmitter and emit two events for all the Fronts.
We can avoid doing that unless we start using this API only on a couple of fronts.
Differential Revision: https://phabricator.services.mozilla.com/D153957