Bug 925907 - Check for IN_SELECT_IN_TABLE in "reset the insertion mode" in HTML5 parser. r=hsivonen

This commit is contained in:
William Chen
2013-10-17 13:26:49 -07:00
parent d7caafffab
commit 838a23c20b
2 changed files with 26 additions and 1 deletions

View File

@@ -4325,7 +4325,19 @@ public abstract class TreeBuilder<T> implements TokenHandler,
}
}
if ("select" == name) {
// TODO: Fragment case. Add error reporting.
int ancestorIndex = i;
while (ancestorIndex > 0) {
StackNode<T> ancestor = stack[ancestorIndex--];
if ("http://www.w3.org/1999/xhtml" == ancestor.ns) {
if ("template" == ancestor.name) {
break;
}
if ("table" == ancestor.name) {
mode = IN_SELECT_IN_TABLE;
return;
}
}
}
mode = IN_SELECT;
return;
} else if ("td" == name || "th" == name) {