diff --git a/gumbo-parser/src/insertion_mode.h b/gumbo-parser/src/insertion_mode.h index 6cb1d341f0..b60054e40b 100644 --- a/gumbo-parser/src/insertion_mode.h +++ b/gumbo-parser/src/insertion_mode.h @@ -20,8 +20,6 @@ typedef enum { GUMBO_INSERTION_MODE_IN_TABLE_BODY, GUMBO_INSERTION_MODE_IN_ROW, GUMBO_INSERTION_MODE_IN_CELL, - GUMBO_INSERTION_MODE_IN_SELECT, - GUMBO_INSERTION_MODE_IN_SELECT_IN_TABLE, GUMBO_INSERTION_MODE_IN_TEMPLATE, GUMBO_INSERTION_MODE_AFTER_BODY, GUMBO_INSERTION_MODE_IN_FRAMESET, diff --git a/gumbo-parser/src/parser.c b/gumbo-parser/src/parser.c index 06f096f8dd..2a0578bec4 100644 --- a/gumbo-parser/src/parser.c +++ b/gumbo-parser/src/parser.c @@ -670,21 +670,6 @@ static GumboInsertionMode get_appropriate_insertion_mode ( } switch (node->v.element.tag) { - case GUMBO_TAG_SELECT: { - if (is_last) { - return GUMBO_INSERTION_MODE_IN_SELECT; - } - for (int i = index; i > 0; --i) { - const GumboNode* ancestor = open_elements->data[i]; - if (node_html_tag_is(ancestor, GUMBO_TAG_TEMPLATE)) { - return GUMBO_INSERTION_MODE_IN_SELECT; - } - if (node_html_tag_is(ancestor, GUMBO_TAG_TABLE)) { - return GUMBO_INSERTION_MODE_IN_SELECT_IN_TABLE; - } - } - return GUMBO_INSERTION_MODE_IN_SELECT; - } case GUMBO_TAG_TD: case GUMBO_TAG_TH: if (!is_last) return GUMBO_INSERTION_MODE_IN_CELL; @@ -1610,6 +1595,7 @@ static bool has_open_element(const GumboParser* parser, GumboTag tag) { TAG(TH), \ TAG(MARQUEE), \ TAG(OBJECT), \ + TAG(SELECT), \ TAG(TEMPLATE), \ TAG_MATHML(MI), \ TAG_MATHML(MO), \ @@ -1694,12 +1680,6 @@ static bool has_an_element_in_table_scope(const GumboParser* parser, GumboTag ta return has_an_element_in_specific_scope(parser, 1, &tag, false, &tags); } -// https://html.spec.whatwg.org/multipage/parsing.html#has-an-element-in-select-scope -static bool has_an_element_in_select_scope(const GumboParser* parser, GumboTag tag) { - static const TagSet tags = {TAG(OPTGROUP), TAG(OPTION)}; - return has_an_element_in_specific_scope(parser, 1, &tag, true, &tags); -} - // https://html.spec.whatwg.org/multipage/parsing.html#generate-implied-end-tags // "exception" is the "element to exclude from the process" listed in the spec. // Pass GUMBO_TAG_LAST to not exclude any of them. @@ -1804,18 +1784,6 @@ static void close_current_cell(GumboParser* parser, const GumboToken* token) { close_table_cell(parser, token, cell_tag); } -// This factors out the "act as if an end tag of tag name 'select' had been -// seen" clause of the spec, since it's referenced in several places. It pops -// all nodes from the stack until the current