Fix custom formatters within watch expressions
Categories
(DevTools :: Debugger, defect, P2)
Tracking
(firefox114 fixed)
Tracking | Status | |
---|---|---|
firefox114 | --- | fixed |
People
(Reporter: sebo, Assigned: nchevobbe)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
Variables within the watch expressions panel may already be displayed via a custom formatter, though their body currently can't be expanded.
The related error message:
TypeError: can't access property "customFormatterBody", this.props.front is null custom-formatter.js:57:26
STR:
- Toggle the prefs
devtools.custom-formatters
anddevtools.custom-formatters
totrue
- Open the attached test case
- Switch to the Debugger panel
- Add
variable
as watch expression - Reload the page
- Click the custom formatted "foo"
Sebastian
Comment 1•8 months ago
|
||
:sebo, if you think that's a regression, could you try to find a regression range using for example mozregression?
Reporter | ||
Comment 2•7 months ago
|
||
Not a regression.
Assignee | ||
Comment 3•7 months ago
|
||
With the current implementation, we were always passing a null front
property
for the ObjectInspector root for a given expression.
The front is needed in CustomFormatter so the the body can be retrieved.
Doing this revealed an issue in ObjectInspector rootsChanged
action, where we
were releasing actors while they might still be needed.
We now only release actors that are not in the new roots.
This was not visible before because we were only dealing with a grip before,
and we'd create a new ObjectActor whenever we needed to fetch the properties
from it.
This also showed that the key for the Expression li
was a bit incorrect.
We were only using the expression input
and so if you refreshed the expressions
the ObjectInspector might not get refreshed.
Updated•7 months ago
|
Assignee | ||
Comment 4•7 months ago
|
||
Most of the work needed for this was done in the previous patch of the stack,
but there were a few things we needed to do:
- actually have styling for the expand arrow in reps.css (in the console we're
(getting the "global" rule for styling arrows) - not display the expand arrow before the expression label for custom formatter
with body. The custom formatter handles fetching and displaying body by itself,
and we shouldn't leak that to the parent ObjectInspector
A test is added to ensure that this works as expected.
We might need a follow up for updating the expression panel style as "wide"
custom formatter might get hidden at certain sizes which isn't great
Depends on D175846
Updated•7 months ago
|
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/33178787a4ff [devtools] Pass expression result front to ObjectInspector in Expressions panel. r=devtools-reviewers,ochameau. https://hg.mozilla.org/integration/autoland/rev/5539f0e5eec7 [devtools] Use custom formatter in watch expressions. r=devtools-reviewers,ochameau.
Comment 6•7 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/33178787a4ff
https://hg.mozilla.org/mozilla-central/rev/5539f0e5eec7
Description
•