Skip to content

Commit 9448adc

Browse files
committed
Mozilla bug 1552008 - Track column number in the HTML. r=smaug,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D170579
1 parent bb67538 commit 9448adc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/nu/validator/htmlparser/impl/Tokenizer.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,9 @@ protected void startErrorReporting() throws SAXException {
14011401
public void start() throws SAXException {
14021402
initializeWithoutStarting();
14031403
tokenHandler.startTokenization(this);
1404+
// CPPONLY: line = 0;
1405+
// CPPONLY: col = 1;
1406+
// CPPONLY: nextCharOnNewLine = true;
14041407
// [NOCPP[
14051408
startErrorReporting();
14061409
// ]NOCPP]
@@ -6339,6 +6342,8 @@ private void initDoctypeFields() {
63396342
appendStrBuf('\n');
63406343
}
63416344

6345+
// [NOCPP[
6346+
63426347
@Inline protected void silentCarriageReturn() {
63436348
++line;
63446349
lastCR = true;
@@ -6348,6 +6353,8 @@ private void initDoctypeFields() {
63486353
++line;
63496354
}
63506355

6356+
// ]NOCPP]
6357+
63516358
private void emitCarriageReturn(@NoLength char[] buf, int pos)
63526359
throws SAXException {
63536360
silentCarriageReturn();
@@ -7165,11 +7172,15 @@ private void suspendIfRequestedAfterCurrentNonTextToken() {
71657172
return suspendAfterCurrentNonTextToken;
71667173
}
71677174

7175+
// [NOCPP[
7176+
71687177
@Inline protected char checkChar(@NoLength char[] buf, int pos)
71697178
throws SAXException {
71707179
return buf[pos];
71717180
}
71727181

7182+
// ]NOCPP]
7183+
71737184
public boolean internalEncodingDeclaration(String internalCharset)
71747185
throws SAXException {
71757186
if (encodingDeclarationHandler != null) {

0 commit comments

Comments
 (0)