RESOLVED FIXED 63540
XMLDocumentParserQt.cpp incorrectly converts 0-based number into 1-based number
https://bugs.webkit.org/show_bug.cgi?id=63540
Summary XMLDocumentParserQt.cpp incorrectly converts 0-based number into 1-based number
Peter Rybin
Reported 2011-06-28 09:56:19 PDT
Its method textPositionOneBased has incorrect converting. Now that number are typed it is evident. Probably underlying m_stream.lineNumber is incorrectly reinterpreted as 0-based value.
Attachments
Patch (97.88 KB, patch)
2011-09-14 16:13 PDT, Peter Rybin
no flags
Patch (98.95 KB, patch)
2011-09-15 09:01 PDT, Peter Rybin
no flags
Peter Rybin
Comment 1 2011-09-14 16:13:59 PDT
Adam Barth
Comment 2 2011-09-14 16:43:25 PDT
Comment on attachment 107418 [details] Patch Usually we add "using WTF::ZeroBasedNumber" to the header so we don't need to use the WTF macro everywhere. Have you validated that the new line numbers in the tests are all right?
Peter Rybin
Comment 3 2011-09-14 16:47:44 PDT
(In reply to comment #2) > (From update of attachment 107418 [details]) > Usually we add "using WTF::ZeroBasedNumber" to the header so we don't need to use the WTF macro everywhere. Have you validated that the new line numbers in the tests are all right? I considered this type somewhat temporary (2 type are to be merged into "BasedNumber" maybe). However let me try to add 'using' anyway. Yes, I went over all expectations and checked that the new numbers are correct.
Peter Rybin
Comment 4 2011-09-15 09:01:28 PDT
Adam Barth
Comment 5 2011-09-15 11:25:30 PDT
Comment on attachment 107501 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=107501&action=review Thanks. > Source/WebCore/html/parser/HTMLDocumentParser.cpp:451 > - return m_tokenizer->lineNumber(); > + return ZeroBasedNumber::fromZeroBasedInt(m_tokenizer->lineNumber()); Should m_tokenizer->lineNumber() return a ZeroBasedNumber ?
WebKit Review Bot
Comment 6 2011-09-15 11:55:19 PDT
Comment on attachment 107501 [details] Patch Rejecting attachment 107501 [details] from commit-queue. peter.rybin@gmail.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py. - If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. - If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.
anton muhin
Comment 7 2011-09-15 12:31:09 PDT
Comment on attachment 107501 [details] Patch Let's give it a try again
WebKit Review Bot
Comment 8 2011-09-15 13:49:01 PDT
Comment on attachment 107501 [details] Patch Clearing flags on attachment: 107501 Committed r95223: <http://trac.webkit.org/changeset/95223>
WebKit Review Bot
Comment 9 2011-09-15 13:49:06 PDT
All reviewed patches have been landed. Closing bug.
Peter Rybin
Comment 10 2011-09-16 11:46:01 PDT
> > Source/WebCore/html/parser/HTMLDocumentParser.cpp:451 > > - return m_tokenizer->lineNumber(); > > + return ZeroBasedNumber::fromZeroBasedInt(m_tokenizer->lineNumber()); > > Should m_tokenizer->lineNumber() return a ZeroBasedNumber ? I think so. I'm going to change it in the next bug/patch. However I realize that I won't be able to replace all integers with *BasedNumbers myself everywhere.
Note You need to log in before you can comment on or make changes to this bug.