Closed
Bug 10593
Opened 26 years ago
Closed 25 years ago
incorrect javascript line numbers in HTML/XML files
Categories
(Core :: XML, defect, P4)
Tracking
()
VERIFIED
FIXED
M11
People
(Reporter: dbaron, Assigned: nisheeth_mozilla)
References
Details
Attachments
(2 files)
I will attach to this bug some examples of JavaScript errors giving the wrong line numbers in HTML/XML files. Bug 8045 already covers line number problems for linked JavaScript. In the HTML example, the problems are only caused by comments. The error is being reported as line 9 when it should be line 24. In the XML example, the problems are caused by comments, processing instructions, and whitespace outside of the root element (I think). The error is being reported as line 5 when it should be line 30. (In both cases, the error should be "this_is_an_error is not defined".)
Reporter | ||
Comment 1•26 years ago
|
||
Reporter | ||
Comment 2•26 years ago
|
||
Comment 3•26 years ago
|
||
cc'ing nisheeth, rickg, rogerl. Who parses xml and html? JavaScript has long had support for gleaning correct line numbers when given source that's interspersed with another file. My guess is that the xml and html parsers aren't providing the correct line number information to the JavaScript parser when passing code snippets.
Assignee | ||
Comment 4•26 years ago
|
||
CCing harishd, the owner of the parser. I know that the XML tokenizer is not passing up line number information to the XML DTD. Harish and me should work together to fix that. Harish can shed more light on whether the HTML tokenizer and DTD are calculating the line numbers properly for HTML files.
Updated•26 years ago
|
Assignee: mccabe → harishd
reassigining to the (i think) correct component. sorry if this is wrong.
Problem: New lines in comments were not taken into account. Checked in a fix for HTML files. Will look into XML example after bug# 10703 gets resolved.
Comment 11•25 years ago
|
||
Counting new lines in comments in XML documents too. This bug will be completely fixed once bug# 11992 is resolved.
Comment 14•25 years ago
|
||
Giving away the bug to nisheeth..because all that's left is related to XML. Nisheeth, have fun :)
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Target Milestone: M14 → M11
Assignee | ||
Comment 16•25 years ago
|
||
Changing milestone to M11. I've checked in a fix for this bug. I added the default handler to the XML tokenizer which looks for newlines and creates newline tokens. Earlier, the no default handler was registered with expat, so newlines in the document prolog were not getting reported. Also, the XML DTD was wrongly initializing the line number count to 0 instead of 1. The was causing an off by one error in the line number reported by JS. Fixed the error in the XML DTD also.
Reporter | ||
Updated•25 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•