Fix "in-row" insertion mode and add the corresponding logic to clear the stack back to row context

This commit is contained in:
iska
2015-04-05 13:27:45 +02:00
parent b73be50e2b
commit caba3efd95
3 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -1873,7 +1873,7 @@
switch (token.type) {
case HTMLTokenTypeStartTag:
if ([token.asTagToken.tagName isEqualToAny:@"th", @"td", nil]) {
[_stackOfOpenElements clearBackToTableContext];
[_stackOfOpenElements clearBackToTableRowContext];
[self insertElementForToken:token.asTagToken];
[self switchInsertionMode:HTMLInsertionModeInCell];
[_listOfActiveFormattingElements addMarker];
+1
View File
@@ -32,6 +32,7 @@
- (void)popElementsUntilElementPopped:(HTMLElement *)element;
- (void)clearBackToTableContext;
- (void)clearBackToTableBodyContext;
- (void)clearBackToTableRowContext;
- (void)popAll;
- (HTMLElement *)hasElementInScopeWithTagName:(NSString *)tagName;
+7
View File
@@ -152,6 +152,13 @@
}
}
- (void)clearBackToTableRowContext
{
while (![self.currentNode.tagName isEqualToAny:@"tr", @"template", @"html", nil]) {
[_stack removeLastObject];
}
}
- (void)popAll
{
[_stack removeAllObjects];