[Webkit-unassigned] [Bug 42943] WebKit fails to compile when building with WML support enabled

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 16 15:43:57 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=42943





--- Comment #19 from Peter Rybin <peter.rybin at gmail.com>  2010-12-16 15:43:56 PST ---
Oh, I see. I gets a little more complicated that I thought.

I remember I didn't quite complete with refactoring in XML parser because I noticed an inconsistency around lineNumber/columnNumber methods: in some cases their result was used as 0-based, in other cases it was clearly used as 1-based. The problem was I didn't know which is correct. So I put TextPosition there, but I retained inconsistency by adding an explicit casting code.

What I did was the following:
XMLDocumentParser::textPosition method expects lineNumber/columnNumber works as a wrapper for lineNumber/columnNumber methods. Since most of the code expected lineNumber/columnNumber to return 0-based values, textPosition method takes them as 0-based.

Now I remember I had to add a helper method textPositionOneBased(). It returns same numbers, but treats them as 1-based; probably it should work for you.

Also it would be of a great help if you could tell what XMLDocumentParser::lineNumber/XMLDocumentParser::columnNumber result actually is: 0-based or 1-based. Please add a comment in this case. However it's a bit complicated by the fact there are 2 different implementations of the parser: "XMLDocumentParserQT.cpp" and "XMLDocumentParserLibxml2.cpp"

Adding annotation to at least one of these files will help fixing it in the future.




> I tried to use TextPosition1 as follows,
> 
> parser->handleError(XMLDocumentParser::fatal, errorMessage.latin1().data(), toOneBasedTextPosition(parser->textPosition()).m_line.oneBasedInt(), toOneBasedTextPosition(parser->textPosition()).m_column.oneBasedInt());
> 
> It gives us wrong error report.
> 
> For example,
> 
>  16   <card id="card2" title="Answer">
> *17     <p>You selected: $($$name)</p>
>  18   </card>
>  19 </wml
> 
> 17 line has an error, so if we use TextPosition1, it reports the following error,
> 
> "This page contains the following errors:
> error on line 18 at column 36: A variable reference uses invalid syntax.
> Below is a rendering of the page up to the first error."
> 
> I guess that the error should be on line 17 at column 26.
> 
> If we use TextPosition0, it reports,
> 
> "This page contains the following errors:
> error on line 17 at column 35: A variable reference uses invalid syntax.
> Below is a rendering of the page up to the first error."
> 
> It seems right except the column number, but actually, is line 16 right if we use TextPosition0?

Column number looks quite weird, I have no idea about it.
You are right, TextPosition0 should contain 16. This is because of inconsistency that I retained to keep refactoring accurate.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list