XMLDocumentParserQt.cpp incorrectly converts 0-based number into 1-based number
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Sep 2011 20:49:55 +0000 (20:49 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Sep 2011 20:49:55 +0000 (20:49 +0000)
commitdbe529f44fa66a790690a0369905a509c22dbed7
tree09c30d56efb5f534129a53678bd9902ba4fc92c8
parent2e2ffd8e27694ea4b2855ab9498b6ed3fe7574bb
XMLDocumentParserQt.cpp incorrectly converts 0-based number into 1-based number
https://bugs.webkit.org/show_bug.cgi?id=63540

Source/WebCore:

ZeroBasedNumber/OneBasedNumber are used in more places, inconsistency
in xml parser is fixed.

Patch by Peter Rybin <peter.rybin@gmail.com> on 2011-09-15
Reviewed by Adam Barth.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::eventHandlerLineNumber):
* dom/ScriptableDocumentParser.h:
* dom/StyleElement.cpp:
(WebCore::StyleElement::StyleElement):
* dom/ViewportArguments.cpp:
(WebCore::parserLineNumber):
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::lineNumber):
* html/parser/HTMLDocumentParser.h:
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::buildInitiatorObject):
* svg/SVGDocumentExtensions.cpp:
(WebCore::parserLineNumber):
* xml/parser/NewXMLDocumentParser.cpp:
(WebCore::NewXMLDocumentParser::lineNumber):
* xml/parser/NewXMLDocumentParser.h:
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::pushCurrentNode):
* xml/parser/XMLDocumentParser.h:
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::PendingCallbacks::appendErrorCallback):
(WebCore::XMLDocumentParser::doWrite):
(WebCore::XMLDocumentParser::startElementNs):
(WebCore::XMLDocumentParser::error):
(WebCore::XMLDocumentParser::lineNumber):
(WebCore::XMLDocumentParser::columnNumber):
(WebCore::XMLDocumentParser::textPosition):
* xml/parser/XMLDocumentParserQt.cpp:
(WebCore::XMLDocumentParser::doWrite):
(WebCore::XMLDocumentParser::doEnd):
(WebCore::XMLDocumentParser::lineNumber):
(WebCore::XMLDocumentParser::columnNumber):
(WebCore::XMLDocumentParser::textPosition):
(WebCore::XMLDocumentParser::parse):
(WebCore::XMLDocumentParser::parseStartElement):

LayoutTests:

Bug is fixed, incorrect test expectations are properly fixed (line
number '0' is reported no more).

Patch by Peter Rybin <peter.rybin@gmail.com> on 2011-09-15
Reviewed by Adam Barth.

* fast/parser/changing-attrbutes-crash-expected.txt:
* html5lib/runner-expected.txt:
* platform/chromium/html5lib/runner-expected.txt:
* svg/custom/invalid-length-units-expected.txt:
* svg/custom/poly-parsing-error-expected.txt:
* svg/custom/svg-parse-overflow-1-expected.txt:
* svg/custom/svg-parse-overflow-2-expected.txt:
* svg/custom/svg-parse-overflow-3-expected.txt:
* svg/custom/svg-parse-overflow-4-expected.txt:
* svg/custom/svg-parse-overflow-5-expected.txt:
* svg/dom/fuzz-path-parser-expected.txt:
* svg/dom/path-parser-expected.txt:
* svg/dom/points-parser-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/parser/changing-attrbutes-crash-expected.txt
LayoutTests/html5lib/runner-expected.txt
LayoutTests/platform/chromium/html5lib/runner-expected.txt
LayoutTests/svg/custom/invalid-length-units-expected.txt
LayoutTests/svg/custom/poly-parsing-error-expected.txt
LayoutTests/svg/custom/svg-parse-overflow-1-expected.txt
LayoutTests/svg/custom/svg-parse-overflow-2-expected.txt
LayoutTests/svg/custom/svg-parse-overflow-3-expected.txt
LayoutTests/svg/custom/svg-parse-overflow-4-expected.txt
LayoutTests/svg/custom/svg-parse-overflow-5-expected.txt
LayoutTests/svg/dom/fuzz-path-parser-expected.txt
LayoutTests/svg/dom/path-parser-expected.txt
LayoutTests/svg/dom/points-parser-expected.txt
Source/JavaScriptCore/wtf/text/TextPosition.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/dom/ScriptableDocumentParser.h
Source/WebCore/dom/StyleElement.cpp
Source/WebCore/dom/ViewportArguments.cpp
Source/WebCore/html/parser/HTMLDocumentParser.cpp
Source/WebCore/html/parser/HTMLDocumentParser.h
Source/WebCore/inspector/InspectorResourceAgent.cpp
Source/WebCore/svg/SVGDocumentExtensions.cpp
Source/WebCore/xml/parser/NewXMLDocumentParser.cpp
Source/WebCore/xml/parser/NewXMLDocumentParser.h
Source/WebCore/xml/parser/XMLDocumentParser.cpp
Source/WebCore/xml/parser/XMLDocumentParser.h
Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp
Source/WebCore/xml/parser/XMLDocumentParserQt.cpp