Bug 1466449 - Update Tokenizer.java and StackNode.java to initialize properties. r=hsivonen

This commit is contained in:
Jonathan Kingston 2018-11-09 11:18:31 +00:00 committed by Emilio Cobos Álvarez
parent 8c8503b03f
commit 0d35be67e4
3 changed files with 59 additions and 2 deletions

View File

@ -97,7 +97,14 @@ final class StackNode<T> {
StackNode(int idxInTreeBuilder) {
this.idxInTreeBuilder = idxInTreeBuilder;
this.flags = 0;
this.name = null;
this.popName = null;
// CPPONLY: this.ns = 0;
this.node = null;
this.attributes = null;
this.refcount = 0;
// CPPONLY: this.htmlCreator = null;
}
// CPPONLY: public @HtmlCreator Object getHtmlCreator() {

View File

@ -527,12 +527,32 @@ public class Tokenizer implements Locator {
public Tokenizer(TokenHandler tokenHandler, boolean newAttributesEachTime) {
this.tokenHandler = tokenHandler;
this.encodingDeclarationHandler = null;
this.lastCR = false;
this.stateSave = 0;
this.returnStateSave = 0;
this.index = 0;
this.forceQuirks = false;
this.additional = '\u0000';
this.entCol = 0;
this.firstCharKey = 0;
this.lo = 0;
this.hi = 0;
this.candidate = 0;
this.charRefBufMark = 0;
this.value = 0;
this.seenDigits = false;
this.cstart = 0;
this.strBufLen = 0;
this.newAttributesEachTime = newAttributesEachTime;
// &CounterClockwiseContourIntegral; is the longest valid char ref and
// the semicolon never gets appended to the buffer.
this.charRefBuf = new char[32];
this.charRefBufLen = 0;
this.bmpChar = new char[1];
this.astralChar = new char[2];
this.endTagExpectation = null;
this.endTagExpectationAsArray = null;
this.endTag = false;
this.containsHyphen = false;
this.tagName = null;
this.nonInternedTagName = new ElementName();
@ -542,6 +562,11 @@ public class Tokenizer implements Locator {
this.publicIdentifier = null;
this.systemIdentifier = null;
this.attributes = null;
this.shouldSuspend = false;
this.confident = false;
this.line = 0;
// CPPONLY: this.attributeLine = 0;
this.interner = null;
}
// ]NOCPP]
@ -560,11 +585,31 @@ public class Tokenizer implements Locator {
// [NOCPP[
this.newAttributesEachTime = false;
// ]NOCPP]
this.lastCR = false;
this.stateSave = 0;
this.returnStateSave = 0;
this.index = 0;
this.forceQuirks = false;
this.additional = '\u0000';
this.entCol = 0;
this.firstCharKey = 0;
this.lo = 0;
this.hi = 0;
this.candidate = 0;
this.charRefBufMark = 0;
this.value = 0;
this.seenDigits = false;
this.cstart = 0;
this.strBufLen = 0;
// &CounterClockwiseContourIntegral; is the longest valid char ref and
// the semicolon never gets appended to the buffer.
this.charRefBuf = new char[32];
this.charRefBufLen = 0;
this.bmpChar = new char[1];
this.astralChar = new char[2];
this.endTagExpectation = null;
this.endTagExpectationAsArray = null;
this.endTag = false;
this.containsHyphen = false;
this.tagName = null;
this.nonInternedTagName = new ElementName();
@ -578,6 +623,11 @@ public class Tokenizer implements Locator {
// ]NOCPP]
// CPPONLY: this.attributes = tokenHandler.HasBuilder() ? new HtmlAttributes(mappingLangToXmlLang) : null;
// CPPONLY: this.newAttributesEachTime = !tokenHandler.HasBuilder();
this.shouldSuspend = false;
this.confident = false;
this.line = 0;
// CPPONLY: this.attributeLine = 0;
this.interner = null;
// CPPONLY: this.viewingXmlSource = viewingXmlSource;
}

View File

@ -131,7 +131,7 @@ nsHtml5Tokenizer::nsHtml5Tokenizer(nsHtml5TreeBuilder* tokenHandler,
, returnStateSave(0)
, index(0)
, forceQuirks(false)
, additional(u'\0')
, additional('\0')
, entCol(0)
, firstCharKey(0)
, lo(0)
@ -147,7 +147,7 @@ nsHtml5Tokenizer::nsHtml5Tokenizer(nsHtml5TreeBuilder* tokenHandler,
, bmpChar(jArray<char16_t, int32_t>::newJArray(1))
, astralChar(jArray<char16_t, int32_t>::newJArray(2))
, endTagExpectation(nullptr)
, endTagExpectationAsArray{}
, endTagExpectationAsArray(nullptr)
, endTag(false)
, containsHyphen(false)
, tagName(nullptr)