endTagTable method

void endTagTable(
  1. EndTagToken token
)

Implementation

void endTagTable(EndTagToken token) {
  if (tree.elementInScope('table', variant: 'table')) {
    tree.generateImpliedEndTags();
    final last = tree.openElements.last;
    if (last.localName != 'table') {
      parser.parseError(token.span, 'end-tag-too-early-named',
          {'gotName': 'table', 'expectedName': last.localName});
    }
    while (tree.openElements.last.localName != 'table') {
      tree.openElements.removeLast();
    }
    final node = tree.openElements.removeLast();
    node.endSourceSpan = token.span;
    parser.resetInsertionMode();
  } else {
    // innerHTML case
    assert(parser.innerHTMLMode);
    parser.parseError(token.span, 'undefined-error');
  }
}