Closed Bug 1825208 Opened 2 years ago Closed 2 years ago

pretty printing HTML file with script on first line does not work

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(firefox113 fixed)

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

(Whiteboard: [devtools:relnote])

Attachments

(1 file)

Steps to reproduce

  1. Navigate to data:text/html,<meta charset=utf8><script>{"use strict"; globalThis.foo = function() {}}</script>
  2. Open debugger
  3. Select the data url source
  4. Click the pretty print button

Expected results

The inline script gets pretty printed

Actual results

There's an error


If a <script> is on the first line of the HTML file, we were miscalculating
its position in the HTML file because there is not previous line breaks.
A test case is added to fix this.

Depends on D173660

Severity: -- → S3
Priority: -- → P2
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/56a150341644 [devtools] Fix pretty printing inline script on first line. r=devtools-reviewers,ochameau.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Whiteboard: [devtools:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: