Error were thrown when trying to fetch headers and cookies, which was preventing inspecting them fully.
Fixing that, enable seeing about:neterror requests which were trigerring a file:// URI request (at least on local builds).
So that we now have to explicitly ignore these error requests.
Differential Revision: https://phabricator.services.mozilla.com/D210319
Instead, we use the new CSSStyleRule.querySelectorAll method to retrieve the
elements to highlight.
We still compute a "selector", which is basically a concatenation of the
ancestor rules, so we can still mark the rule as highlighted when we display a
different StyleRule front for a rule that was previously highlighted.
Differential Revision: https://phabricator.services.mozilla.com/D208364
This is done to avoid a performance issue with deeply nested rules,
where computing the desugared selector can be super expensive.
This should help overall since we're doing a bit less work, as well
as returning smaller data.
Differential Revision: https://phabricator.services.mozilla.com/D207727
In some cases, we were getting null sourceId, which was causing an exception
to be thrown in `getFormattedSourceId` since it expects a string.
We add a simple guard in this function so we don't throw anymore.
But we shouldn't get null sourceId in the first place. It looks like for
some Wasm sources, the SavedFrame sourceId can be 0, which wasn't playing
well with some loose check we were doing in the sources manager.
Finally, the "Copy metadata" button we display when a console message crash
wasn't working. The message now includes the targetFront, which can be serialized
in JSON, so we simply ignore it.
Differential Revision: https://phabricator.services.mozilla.com/D206105
In order to abort eager evaluation when executing a resolve hook with side-effect,
especially the Services' hook which imports ES module, which is not undo-able,
introduce a dedicate debugger flag to ask to avoid side-effectful operation in
the resolve hook.
Differential Revision: https://phabricator.services.mozilla.com/D208970
Recursively traverse css rules so we can collect
keyframes rules nested in other rules, which should
behave as regular rules.
We also don't collect ancestor rules for keyframe rules,
as they can only be direct child of @keyframes rules, and
we'd rather display the @keyframes ancestor data at some
point.
Differential Revision: https://phabricator.services.mozilla.com/D209354
In order to abort eager evaluation when executing a resolve hook with side-effect,
especially the Services' hook which imports ES module, which is not undo-able,
introduce a dedicate debugger flag to ask to avoid side-effectful operation in
the resolve hook.
Differential Revision: https://phabricator.services.mozilla.com/D208970
This feature is added as "recommended", and added to every presets. This will
allow us to disable it if we really want to.
If the "native allocations" feature is enabled, we still force the installation
of the memory hooks even if we don't have this feature to not break the native
allocations feature.
Differential Revision: https://phabricator.services.mozilla.com/D206789
This feature is added as "recommended", and added to every presets. This will
allow us to disable it if we really want to.
If the "native allocations" feature is enabled, we still force the installation
of the memory hooks even if we don't have this feature to not break the native
allocations feature.
Differential Revision: https://phabricator.services.mozilla.com/D206789
The previous patch explicitly prevents spawning JavaScriptTracer for same-process iframe,
as the JavaScriptTracer can only be spawn once per thread.
But then the JavaScriptTracer should ensure tracking DOM Events for these same-process iframe globals.
`DebuggerNotificationObserver` requires to connect to each individual WindowGlobal.
Connecting to the top WindowGlobal isn't enough to receive DOM Events for children WindowGlobals.
Differential Revision: https://phabricator.services.mozilla.com/D208468
The JavaScriptTracer class for now only supports being instantiated once per thread.
So that we shouldn't try to instantiate it for WindowGlobal/<iframe> that run in the same
process as their parent document. The `isProcessRoot` will be true for the top document
and false for children running in the same process as their parent document.
Also address a noisy exception happening when debugging Google Doc.
Differential Revision: https://phabricator.services.mozilla.com/D208321
We shouldn't try to request target actor's form late during the destroy sequence.
This would force to re-create the Lazy Target Scoped Actors via LazyPool,
which would ultimately force to re-instantiate a new _targetScopedActorsPool
which wouldn't be destroyed as it is created post-destruction.
Avoid re-instantiating the target scoped actors when we detect that the actor is being destroyed.
Differential Revision: https://phabricator.services.mozilla.com/D207487
When picking nodes while holding Shift, we're calling
nodesFromRect, which returns a list of nodes, in no
particular order.
Instead of randomly picking the first one in the list,
return the first one that is not a parent of any of the
other matching elements.
This should potentially give us the deepest element (even
if in some situation we might miss "deeper" nodes from other
branches than the first "only child").
Differential Revision: https://phabricator.services.mozilla.com/D207256
When picking nodes while holding Shift, we're calling
nodesFromRect, which returns a list of nodes, in no
particular order.
Instead of randomly picking the first one in the list,
return the first one that is not a parent of any of the
other matching elements.
This should potentially give us the deepest element (even
if in some situation we might miss "deeper" nodes from other
branches than the first "only child").
Differential Revision: https://phabricator.services.mozilla.com/D207256
- Guard Services.prefs as this isn't available in workers
- Pass worker's global to getAvailableEventBreakpoints when in worker toolbox
- Check that global exists before checking property on it
Differential Revision: https://phabricator.services.mozilla.com/D207257
We were getting a line byte index for the
actual char matching the line we want, but
we actually need the index _after_ that
new line char.
A test case is added to cover this fix.
Differential Revision: https://phabricator.services.mozilla.com/D207156
This revision updates newly-failing tests after implementing the ancestor
requirements for certain child roles. Generally, this revision adds ancestors
where appropriate, because tests largely are not testing this particular
behavior.
Differential Revision: https://phabricator.services.mozilla.com/D205880
`InspectorUtils.getRuleBodyTextOffset` was returning bytes position, and we
were using them directly in Javascript `substring`, which causes problem
with non-ascii chars.
Instead of returning offsets to compute the rule string, we directly return
the string from InspectorUtils which is easier to work with.
Differential Revision: https://phabricator.services.mozilla.com/D204523
The next patch modifies `getRuleText` so it only returns the text, and no
longer the offset at which the rule starts.
The only consumer of the returned offset was in `StyleRuleActor#setRuleText`,
so we migrate this directly to a InspectorUtils method to avoid mixing JS string
indexes with Rust bytes position.
Differential Revision: https://phabricator.services.mozilla.com/D204522
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.
Differential Revision: https://phabricator.services.mozilla.com/D195687
The test weren't spawning the DevToolsServer the same way as in production.
--start-debugger-server spawns the server in the distinct devtools global in order to be able to debug privileged compartment.
Differential Revision: https://phabricator.services.mozilla.com/D206497
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.
Differential Revision: https://phabricator.services.mozilla.com/D195687
When we modify a rule from the inspector, the number of rules and the at-rules
data can't be impacted, so avoid computing this costly information.
Differential Revision: https://phabricator.services.mozilla.com/D205798
In particular:
* Always handle meta viewport in RDM. This fixes bug 1625999 too by
making touch simulation enabled and disabled consistent.
* Restore the resolution to 1 when toggling RDM. This is just simpler,
and we're not keeping around the visual viewport offsets anyways
so...
* Deal with the change more easily, at the same point we switch
scrollbars etc.
Differential Revision: https://phabricator.services.mozilla.com/D206266
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.
Differential Revision: https://phabricator.services.mozilla.com/D195687