Closed Bug 1478665 Opened 2 years ago Closed 10 months ago

Custom element links to Debugger should favor pretty-printed file if it exists


(DevTools :: Inspector, enhancement, P3)



(firefox72 fixed)

Firefox 72
Tracking Status
firefox72 --- fixed


(Reporter: Harald, Assigned: wartmanm)


(Blocks 2 open bugs)



(1 file)

- Open
- Open Inspector
- Click one of the many [custom…] badges
- Pretty-print the file (right-click tab header)
- Back to Inspector, click [custom…] again

AR: Jumps to minified version
ER: Jumps to pretty version

Console does this correctly for log sources.
Severity: normal → enhancement
Priority: -- → P3
How hard is this to wire up, Julian? Existing source links in Console and Inspector (events) do this correctly and we tend to underestimate how many devs depend on pretty print.
Flags: needinfo?(jdescottes)
Not sure, it seems related to using the sourcemap service in order to get the URLs. 

I think pretty printing started notifying console and others in
We would need similar logic on our side.

Can't dig much further at the moment, maybe Nicolas can tell us if this is a big task or not.
Flags: needinfo?(jdescottes) → needinfo?(nchevobbe)
Blocks: source-maps
The button's callback is here:

The location here just comes directly from the actor:

So I think what you want to do is change the button callback to
pass the location through the "source map URL service", in particular
the `originalPositionFor` method, docs here:

The source map URL service is available on the toolbox.

Right now, hovering in the markup view doesn't show the location of the custom element.
However, if you wanted it to, then instead of `originalPositionFor`, you would want to use
the source map URL service to subscribe to changes to the location.
But, if you plan to leave the tooltip as-is, then you needn't bother.

The hardest part of this task is (as usual...) writing the test case.
No longer blocks: devtools-webcomponents
I think we have the same issue in the console with the "jump to definition" button: we don't jump to the generated location.
Flags: needinfo?(nchevobbe)
Hi Harald, after doing the triage version we are not confident that this could be fixed in 64. We think that the bugs listed here  should be addressed first . Are you OK with moving this bug back to the global webcomponents backlog?
Flags: needinfo?(hkirschner)
That is fine, this is affects other places. Debugger is also working on pretty print in 65, so this work might be affected by adding auto-prettyprint and should probably wait.
Flags: needinfo?(hkirschner)

Assigning to :mattheww, thanks for submitting a patch!

Assignee: nobody → wartmanm
Attachment #9103148 - Attachment description: Follow source maps when viewing custom element definition → Bug 1478665 - Follow source maps when viewing custom element definition
Pushed by
Follow source maps when viewing custom element definition r=jdescottes
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
You need to log in before you can comment on or make changes to this bug.