Open
Bug 504565
Opened 15 years ago
Updated 3 years ago
jsdIScript baseLineNumber incorrect
Categories
(Core :: DOM: HTML Parser, defect, P5)
Tracking
()
NEW
People
(Reporter: johnjbarton, Unassigned)
References
Details
(Whiteboard: [firebug-p2])
Here is a new case where the base line numbers in jsdIScript are incorrect: http://code.google.com/p/fbug/source/browse/tests/issues/2046/issue2046.htm I think you can get a copy this way: svn checkout http://fbug.googlecode.com/svn/tests/issues/2046/issue2046.htm The original report was on 3.0.10, but I confirmed it on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5
Reporter | ||
Comment 1•15 years ago
|
||
Bug 488730 fixed seemingly similar issues, so it may be a good one to read.
Whiteboard: [firebug-p1]
Updated•15 years ago
|
Assignee: general → nobody
Component: JavaScript Engine → HTML: Parser
QA Contact: general → parser
Comment 2•15 years ago
|
||
This took me a while to reproduce, but I can (using JSD/Venkman) confirm I get baseLineNumber=25 with the exact file in SVN. The issue (and why it was hard for me to reproduce initially) seems to be related to the inconsistent line endings in the file (a mixture of Windows and Unix), as I cannot reproduce the problem when I force them all to be Windows or all Unix. Asssuming the file has Windows line ends generally, there are exactly 14 Unix line ends before the <script> tag, which is the error in line number (39 is the correct baseLineNumber). I don't like coincidences like that.
Comment 3•15 years ago
|
||
I did the tests on Venkman 0.9.87.4 on Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1) Gecko/20090624 Firefox/3.5.
Comment 4•15 years ago
|
||
This is a bug in CTextToken::ConsumeParsedCharacterData. It simply counts the number of newlines in the text or style node, which ignores stray carriage returns. Unlike bug 488730, there isn't a really simple fix here without rewriting the way that we scan for </script>. I know that this is nice to have, but honestly, we might have to wait for the HTML5 parser to fix this.
Reporter | ||
Comment 5•15 years ago
|
||
Do you think we could rationally 'fix' the lines on Firebug side? I already have code to shift the line offsets. If I have an algorithm that works and more important doe not break on normal sources, it could be a working solution until the new parser. 1) only HTML files? 2) delete CR in what cases?
Comment 6•15 years ago
|
||
The HTML5 parser bug for line numbers is bug 483015. However, while implementing line numbers, I noticed that the expectations on how line numbers work for document.written content weren't documented anywhere.
Comment 7•14 years ago
|
||
Here is another test case (all line endings set to Windows) http://code.google.com/p/fbug/source/browse/tests/issues/2046/issue2046-2.html Online version is here: http://getfirebug.com/tests/issues/2046/issue2046-2.html The break in the file happens on line 7 instead of line 13. If the try-catch block is inserted into another block like as follows: { try-catch } it works. Is this related to this report? Honza
Reporter | ||
Updated•14 years ago
|
Whiteboard: [firebug-p1] → [firebug-p2]
Comment 8•3 years ago
|
||
Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority.
If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.
Severity: normal → S4
Priority: -- → P5
You need to log in
before you can comment on or make changes to this bug.
Description
•