Fix "in-row" insertion mode and add the corresponding logic to clear the stack back to row context
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
- (void)popElementsUntilElementPopped:(HTMLElement *)element;
|
||||
- (void)clearBackToTableContext;
|
||||
- (void)clearBackToTableBodyContext;
|
||||
- (void)clearBackToTableRowContext;
|
||||
- (void)popAll;
|
||||
|
||||
- (HTMLElement *)hasElementInScopeWithTagName:(NSString *)tagName;
|
||||
|
||||
@@ -152,6 +152,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)clearBackToTableRowContext
|
||||
{
|
||||
while (![self.currentNode.tagName isEqualToAny:@"tr", @"template", @"html", nil]) {
|
||||
[_stack removeLastObject];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)popAll
|
||||
{
|
||||
[_stack removeAllObjects];
|
||||
|
||||
Reference in New Issue
Block a user