Skip to content

Commit 89296cd

Browse files
sideshowbarkerhsivonen
authored andcommitted
1 parent 7f2a144 commit 89296cd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,9 +1800,10 @@ public final void startTag(ElementName elementName,
18001800
case TBODY_OR_THEAD_OR_TFOOT:
18011801
case TR:
18021802
case TD_OR_TH:
1803-
errStrayStartTag(name);
18041803
eltPos = findLastInTableScope("caption");
18051804
if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) {
1805+
assert fragment || isTemplateContents();
1806+
errStrayStartTag(name);
18061807
break starttagloop;
18071808
}
18081809
generateImpliedEndTags();
@@ -3275,9 +3276,11 @@ public final void endTag(ElementName elementName) throws SAXException {
32753276
mode = IN_TABLE;
32763277
break endtagloop;
32773278
case TABLE:
3278-
errTableClosedWhileCaptionOpen();
32793279
eltPos = findLastInTableScope("caption");
3280+
32803281
if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) {
3282+
assert fragment || isTemplateContents();
3283+
errStrayEndTag(name);
32813284
break endtagloop;
32823285
}
32833286
generateImpliedEndTags();
@@ -6433,10 +6436,6 @@ private void errHtmlStartTagInForeignContext(@Local String name)
64336436
+ "\u201D in a foreign namespace context.");
64346437
}
64356438

6436-
private void errTableClosedWhileCaptionOpen() throws SAXException {
6437-
err("\u201Ctable\u201D closed but \u201Ccaption\u201D was still open.");
6438-
}
6439-
64406439
private void errNoTableRowToClose() throws SAXException {
64416440
err("No table row to close.");
64426441
}

0 commit comments

Comments
 (0)