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