Fixes incorrect 'expression' strings getting from the parse causing overwriting of values when hovering.
If an 'expression' string is in the form of `"foo = value"`, when hovering over 'foo', that 'expression' string is sent to 'evaluateJSAsync()' in 'webConsoleActor' which overwrites any previously set values to 'foo'.
Differential Revision: https://phabricator.services.mozilla.com/D77266
Before this patch, we were not trying to cleanup anything when the process
was known to be in process of destruction. We assumed that everything would
be cleaned up anyway.
But mochitest is actually asserting that nothing is leaked on process shutdown,
and we are easily leaking many thing when not destroying the target actor!
Differential Revision: https://phabricator.services.mozilla.com/D76156
This should help better classify DAMP errors as this was picked up by TreeHerder log parser,
while not breaking DAMP.
Differential Revision: https://phabricator.services.mozilla.com/D77224
This was regressed by Bug 766661, and it highlighted
that we're missing test coverage for this, so this
test is adding a test case to prevent future breakage.
Differential Revision: https://phabricator.services.mozilla.com/D76676
This commit changes up the definitions of the presets a bit. I promoted the
allocations work to non-experimental, as it's fairly well supported now in the UI.
Others I demoted to experimental if they were not supported in our current UI,
or flat out don't work.
Differential Revision: https://phabricator.services.mozilla.com/D76511
This patch adjusts the profiler menu button to properly reflect the current state
of the profiler. It doesn't completely match the design spec, as there are a bunch
of CSS rules already in place in the toolbar, and I wanted to keep the changes
simple. It does however, update the UI based on the state of the profiler.
Differential Revision: https://phabricator.services.mozilla.com/D75851
This patch handles the issue where a user sends two commands two toggle the profiler and/or
capture. This gets the profiler UI in a weird state that usually is just because the UI
is hanging and lagging. This makes the profiler pause state into a "capturing" state.
I did not include a test with the behavior change, as I was worried about intermittent
failures on asserting this behavior.
Differential Revision: https://phabricator.services.mozilla.com/D75850
In order to retrieve the list of impacted element for a given CSS warning,
we are evaluating a document.querySelector expression,
using the cssSelector we get from the error itself.
But if the warning message comes from an iframe, we are not retrieving the
impacted elements, only items from the top-level document.
By storing the target actor id a message is emitted from directly in the message
itself, we can retrieve the target front, and use it to do the evaluation against
the right target.
This is not enough though, as non-remote frame don't have a dedicated target,
and we'll be back at square one, using the top-level document to do the evaluation.
In order to fix that, we're passing the innerWindowID to the evaluateJSAsync method,
so it can be used on the server to retrieve the window instance we need.
A test is added to ensure this feature works as expected for iframes, and it
passes with or without fission enabled.
Differential Revision: https://phabricator.services.mozilla.com/D75811
This will allow resource consumers to have a direct access to the target front
a resource was issued from.
At the moment we only use it in the console, where the targetFront is placed
on the console messages.
Differential Revision: https://phabricator.services.mozilla.com/D76790
If the displayString of the RegExp is very long (>10,000 chars),
it is returned as a longString grip, and it was making the regexp
reps to throw.
This patch fixes this issue and adds a test to ensure we deal with
these kind of objects now.
Depends on D76673
Differential Revision: https://phabricator.services.mozilla.com/D76674
This will prevent the Eager Evaluation component to crash the whole console
when there's an issue in its render function.
Differential Revision: https://phabricator.services.mozilla.com/D76673
This prevents showing e.g. ::cue pseudo-elements for elements that are
not videos, and such.
This is useful on its own, but it's going to be even more useful because
I'm making some rules in the UA sheets less specific in the blocking
bugs.
For example, after my patches, the number of expected rules in
test_styles-applied was 24 (instead of 9 with this patch). That's just
too much noise.
Differential Revision: https://phabricator.services.mozilla.com/D76308
Before this patch, we were not trying to cleanup anything when the process
was known to be in process of destruction. We assumed that everything would
be cleaned up anyway.
But mochitest is actually asserting that nothing is leaked on process shutdown,
and we are easily leaking many thing when not destroying the target actor!
Differential Revision: https://phabricator.services.mozilla.com/D76156
I don't think all this complexity is worth it for having a
marginally-more-realistic testing story. Using the pref just works and we should
do that, I think.
Differential Revision: https://phabricator.services.mozilla.com/D59980
In order to test its parsing and serialization, we expose it but protect
it behind a pref.
Besides, I would like to drop layout.css.aspect-ratio-number.enabled in
the next patch because the spec has been updated. It seems we don't have
to keep this pref and we should always use Number.
Differential Revision: https://phabricator.services.mozilla.com/D74955
The MDNCompatibility library will be shared between the upcoming
Compatibility Actor and the Compatibility Panel in the inspector.
This library is necessary for tests in Compatibility Panel and
hence is being moved to the devtools/shared looking at it's
requirements in client as well as the devtools/server/actors
Differential Revision: https://phabricator.services.mozilla.com/D75998
The context menu of the network blocking panel have options to
"Enable all" and "Disable all" for enabling and disbaling all the
patters in the request blocking panel at once.
This patch disables those options in case all the URLs are already
enabled or disabled. Having the buttons active all the time might
lead to confusing situtaions especially with long blocking pattern
list where it may lead the user to think there is a URL that has not
been enabled/disabled eve after clicking the menu option.
Differential Revision: https://phabricator.services.mozilla.com/D75247
Reinstate customUserAgent interface for nsIDocShell. This is so it can be used
as a choke-point to catch setting values on docshells which are in the process
of changing process. We don't want to send changes which will be rejected on the
parent side.
This code should be removed once callers setting customUserAgent are refactored
to only occur from parent process.
Differential Revision: https://phabricator.services.mozilla.com/D75006
Fix up the browser_tab_label_during_restore.js test to wait for the right number of tab title changes, since the timing of the tab title updating has now changed.
Differential Revision: https://phabricator.services.mozilla.com/D72562
This is needs a few things to complete, but is ready for gathering initial feedback
- Added a new Url Preview Component
- Refactored the UX for the summary sections
Todo
- Fix the tests
- Fix Console errors
- Cleanups
- Rebase over D71916 after that lands
Differential Revision: https://phabricator.services.mozilla.com/D73192
Drag and drop is a nice little feature to have to add URL to blocked
list. Current implementation allows for blocking the URL from the
context menu but drag and drop is a nifty little feature for
convenience.
Current implementation will only allowed an unblocked URL to be
dragged and dropped. The dragging is blocked is the network
blocking panel isn't opened.
Note: This is just an RFC. @Harald had raised a question of
discoverabilty of the feature given there are no other elements
that can be dragged and dropped within the network monitor. This
is just a proposal to see if it's addition is beneficial.
Differential Revision: https://phabricator.services.mozilla.com/D74535
In network analysis in Netmonitor, the headers are being cropped, even when there is space available. This is due to the `cropLimit` property. In this revision, the `cropLimit` property is removed so that the headers take up all available space.
Differential Revision: https://phabricator.services.mozilla.com/D75688
Added a new hasPrettyTab() selector function.
Renamed the function and prop in SourcesTreeItem to reflect the new hasPrettyTab() selector function.
Updated the snapshot test for the pretty print icon.
Differential Revision: https://phabricator.services.mozilla.com/D75733
Now that nsIScriptError have a `isPromiseRejection` flag, we can consume it
in the console to indicate to the user that we're dealing with a promise rejection.
The exception message is then: "Uncaught (in promise) XXX".
A few tests needed to be updated, and we take this as an opportunity to
ensure we have a stacktrace for uncaught promise rejection.
Differential Revision: https://phabricator.services.mozilla.com/D75780
When resizing the output, if the height was modified, the scrollbar position
was updated and could lose its pinned-to-bottom state.
This patch adds a resizeObserver to the console output node, where we
scroll the output to the bottom if it's needed.
In order to be able to do that, some changes were done in how we were
detecting that the output was pinned to the bottom.
We now have an intersection observer on the last message element,
which flips a flag when the element isn't intersecting the viewport
anymore.
Some test cases are added to ensure the console has the expected
behavior in different situations.
Depends on D74708
Differential Revision: https://phabricator.services.mozilla.com/D75297
See https://bugzilla.mozilla.org/show_bug.cgi?id=932410#c2 for the
context for which this pseudo-element was added.
In the previous patch, I had to special-case range appearance because of
this pseudo-class, but that patch makes this pseudo-class completely
redundant, as now all form controls, themed and unthemed, display
outlines, unless the native theme displays a focus indicator on its own.
Remove the special case, and make ranges use outlines like everything
else rather than this bespoke pseudo-element.
Differential Revision: https://phabricator.services.mozilla.com/D74734
See https://bugzilla.mozilla.org/show_bug.cgi?id=932410#c2 for the
context for which this pseudo-element was added.
In the previous patch, I had to special-case range appearance because of
this pseudo-class, but that patch makes this pseudo-class completely
redundant, as now all form controls, themed and unthemed, display
outlines, unless the native theme displays a focus indicator on its own.
Remove the special case, and make ranges use outlines like everything
else rather than this bespoke pseudo-element.
Differential Revision: https://phabricator.services.mozilla.com/D74734
There was no benefit of having cached messages being different from the "live" ones,
so in this patch we make the message packet consistent.
A few tests had to be modified, and we still handle old-style cached
messages for backward compatibility.
Differential Revision: https://phabricator.services.mozilla.com/D75089
Seems like a regression.
As there are actually no responses for blocked requests, this
hides the response headers section when there are no responses.
Also undoing the light gray color on the header titles To fix , Bug 1636917
Differential Revision: https://phabricator.services.mozilla.com/D74410
Since targetFronts now have isTopLevel and targetType properties, we can directly use
those, as the targetFront is included in the callback parameter.
This patch remove those properties and refactor consumer code.
Differential Revision: https://phabricator.services.mozilla.com/D74651
Since targetFronts now have isTopLevel and targetType properties, we can directly use
those, as the targetFront is included in the callback parameter.
This patch remove those properties and refactor consumer code.
Differential Revision: https://phabricator.services.mozilla.com/D74651
Inspecting pages with many CSS variables makes DevTools Inspector very slow.
For example, try to inspect an element on [youtube.com](https://www.youtube.com/).
One of the stylesheets loaded by youtube.com contains more than 7800 CSS rules (it's 55K lines long). Some of them specify a very large number of CSS variable delcarations on `:root` which will be inherited by all nodes on the page. This is a perf bottleneck for DevTools.
{F2150398}
Whenever an element is selected, its matching CSS declarations show in the Rules view. If the node inherits CSS variables, for **each declaration**, the Rules view checks if the [variables apply to the current declaration](https://searchfox.org/mozilla-central/rev/2bfe3415fb3a2fba9b1c694bc0b376365e086927/devtools/client/inspector/rules/models/element-style.js#403-408,417,424).
This among other expensive operations which are repeated for each declaration. But for CSS variables, it's particularly slow given the frequent [checks with a regular expression](https://searchfox.org/mozilla-central/rev/2bfe3415fb3a2fba9b1c694bc0b376365e086927/devtools/client/inspector/rules/utils/utils.js#292-295) to verify if a CSS declaration's value includes any references to a given CSS variable name.
This patch introduces new functionality. When a `TextProperty` (aka CSS declaration model) is created on the client, the names of CSS variables found in its value are extracted ahead of time into a `Set`. Whenever we want to check if the declaration uses a certain CSS variable name, we check against this pre-compiled list instead of verifying the string value every time. For high volume checks, like the ones done by the `ElementStyle`, this approach proves significantly faster.
Profile without this patch: https://bit.ly/2Yd7khD
Profile with this patch: https://bit.ly/3aMhJTZ
There are still many optimizations that can be done, but the `hasCSSVariable()` method is no longer a performance bottleneck.
Differential Revision: https://phabricator.services.mozilla.com/D73062
The PageError component wasn't passing the maybeScrollToBottom
prop to the GripMessageBody, which was making the console out-of-autoscroll
since the stacktrace is rendered asynchronously.
Some tests cases are added (throwing directly from an evaluation,
or in a setTimeout), so we cover different paths.
Differential Revision: https://phabricator.services.mozilla.com/D74708
Fix up the browser_tab_label_during_restore.js test to wait for the right number of tab title changes, since the timing of the tab title updating has now changed.
Differential Revision: https://phabricator.services.mozilla.com/D72562
The test was failing on ccov machines because it was
timing out. The interesting part is that in the logs
we could see that a huge error was logged, because
we were hitting the IGNORED REDUX ACTION middleware,
which was about a SET_TERMINAL_EAGER_RESULT action
being blocked.
I think that logging this object was taking so much
time that it made the test timeout on slow machines.
So here we're simply waiting for the eager evaluation
result to be displayed, so we know that the action won't
be ignored.
Differential Revision: https://phabricator.services.mozilla.com/D74879
To enable the Open In Sidebar action, we were retrieving the
actor id of the root node of an object inspector.
But in the case of error, we don't use the object inspector
to render them, only the reps.
We still have a reference to the actor id though, so when
there's no object inspector, but that we have an actor id
ref, we enable the action.
A test case is added in a mochitest to ensure this works as
expected for an error object, and that we can observe custom
properties that are not displayed in the error rep.
This also reveiled an issue with React keys in the Error rep,
which we fix in this patch.
Differential Revision: https://phabricator.services.mozilla.com/D73301
In the Browser toolbox destroy function, we now wait for
any pending connection initialization promise.
In the test we close the browser toolbox at the end.
We also need to guard a few method in the connection proxy
to ensure the instances we use are still alive before using
them.
Differential Revision: https://phabricator.services.mozilla.com/D71171
The original site issue (https://trello.com/) seems not obvious on nightly
now. (See Bug 1301305 for more details.) So perhaps we could give this a
trial to disable this pref, for the better performance in other cases.
Differential Revision: https://phabricator.services.mozilla.com/D74278
This moves some symbolication code out of browser.js and into a new module symbolication.jsm.js.
It also threads the pageContext parameter through to getSymbolsFromThisBrowser so that it can
respect the correct objdir pref. This part is probably more complicated than necessary.
Differential Revision: https://phabricator.services.mozilla.com/D63914
The `browser_aboutdebugging_navigate_to_url.js` test times out if we don't wait for the about:devtools-toolbox tab to be removed as a target from about:debugging.
Differential Revision: https://phabricator.services.mozilla.com/D74467
In the Browser toolbox destroy function, we now wait for
any pending connection initialization promise.
In the test we close the browser toolbox at the end.
We also need to guard a few method in the connection proxy
to ensure the instances we use are still alive before using
them.
Differential Revision: https://phabricator.services.mozilla.com/D71171