Bug 40809 - Line numbers incorrect in XHTML documents
Summary: Line numbers incorrect in XHTML documents
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2010-06-17 21:31 PDT by Tony Gentilcore
Modified: 2016-08-03 11:48 PDT (History)
9 users (show)

See Also:

Layout Test for XHTML script line numbers (635 bytes, application/xhtml+xml)
2010-06-22 09:13 PDT, Tony Gentilcore
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Gentilcore 2010-06-17 21:31:28 PDT
Line numbers are not reported correctly in XHTML documents.

See failing expectations in:
Comment 1 Tony Gentilcore 2010-06-22 09:13:26 PDT
Created attachment 59378 [details]
Layout Test for XHTML script line numbers
Comment 2 Tony Gentilcore 2010-06-22 09:18:48 PDT
Please consider this bug available.

I ran into this problem while working on: https://bugs.webkit.org/show_bug.cgi?id=40649

I spent a little bit of time looking into a fix, but eventually gave up as libxml2 doesn't seem to be behaving the way we expect.

All of the following methods returned the total number of lines in the document, not the line at the current point:
 - context->input->line
 - context->node->line
 - xmlSAX2GetLineNumber(context)

I also tried setting context->linenumbers = 1 and lineNumbersDefault(1) during initialization, but to no avail.

So I'm just uploading my test case in the hopes that it might be helpful to someone who knows more about libxml2.
Comment 3 Eric Seidel (no email) 2010-06-22 11:53:46 PDT
It's possible Qt may already pass this test since they have their own XML impl.
Comment 4 Alexey Proskuryakov 2010-06-23 08:53:12 PDT
See also: bug 5206, bug 19800, bug 35451, bug 18855, bug 34078. Actually, bug 19800 has an XML test case.
Comment 5 Alexey Proskuryakov 2011-09-15 11:38:37 PDT
The attached test case seems to work fine in Safari 5.1 (Web Inspector says that the exception was on line 25). Is there still something to investigate here?

The bugs I mentioned above are all still open, but I haven't attempted to reproduced them now.
Comment 6 BJ Burg 2016-08-03 11:48:44 PDT
Nothing left to do. Closing.