Open Bug 1552359 Opened 5 years ago Updated 2 years ago

nsXMLContentSink should provide inline <script> text start line/column

Categories

(Core :: XML, defect, P3)

defect

Tracking

()

Tracking Status
firefox68 --- affected

People

(Reporter: loganfsmyth, Unassigned)

References

(Blocks 2 open bugs)

Details

The nsXMLContentSink currently runs SetScriptLineNumber and SetScriptColumnNumber with the start of the < in the script opening tag, rather than the text content itself. The nsIScriptElement start line (and column soon) are passed to SpiderMonkey and eventually used to calculate breakpoint locations, among other things, in the debugger. This mismatch if locations leads the debugger to show breakpoint markers in the wrong location in XML files with inline scripts where the inline code is on the same line as the opening tag of the script element.

Ideally nsIScriptElement should have fields provided by the XML parser that represent specifically the start position of the inline script text.

I should add, the current values passed to SetScriptLineNumber/SetScriptColumnNumber are actually used in two different contexts, one where the script start makes sense and one where it doesn't, so in https://bugzilla.mozilla.org/show_bug.cgi?id=1538056 I'm going to propose splitting those usecases into separate fields.

The priority flag is not set for this bug.
:peterv, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(peterv)
Flags: needinfo?(peterv)
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.