Skip to content

Commit d5d0bb3

Browse files
committed
Remove special handling for <menuitem> tag
It has been removed from the whatwg HTML spec and the html5lib tests now expect it to be handled as an unknown element. See also: * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menuitem * whatwg/html#2319 * html5lib/html5lib-tests#88 All html5lib tree-construction tests are now passing: Ran 1689 tests in 0.15s Passed: 1689 Failed: 0 Skipped: 0
1 parent 6ebfca2 commit d5d0bb3

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/parser.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,7 @@ static bool is_special_node(const GumboNode* node) {
16681668
TAG(ADDRESS), TAG(APPLET), TAG(AREA), TAG(ARTICLE),
16691669
TAG(ASIDE), TAG(BASE), TAG(BASEFONT), TAG(BGSOUND), TAG(BLOCKQUOTE),
16701670
TAG(BODY), TAG(BR), TAG(BUTTON), TAG(CAPTION), TAG(CENTER), TAG(COL),
1671-
TAG(COLGROUP), TAG(MENUITEM), TAG(DD), TAG(DETAILS), TAG(DIR),
1671+
TAG(COLGROUP), TAG(DD), TAG(DETAILS), TAG(DIR),
16721672
TAG(DIV), TAG(DL), TAG(DT), TAG(EMBED), TAG(FIELDSET),
16731673
TAG(FIGCAPTION), TAG(FIGURE), TAG(FOOTER), TAG(FORM), TAG(FRAME),
16741674
TAG(FRAMESET), TAG(H1), TAG(H2), TAG(H3), TAG(H4), TAG(H5), TAG(H6),
@@ -2379,7 +2379,7 @@ static bool handle_in_head(GumboParser* parser, GumboToken* token) {
23792379
return handle_in_body(parser, token);
23802380
} else if (
23812381
tag_in(token, kStartTag, (TagSet) {
2382-
TAG(BASE), TAG(BASEFONT), TAG(BGSOUND), TAG(MENUITEM), TAG(LINK)
2382+
TAG(BASE), TAG(BASEFONT), TAG(BGSOUND), TAG(LINK)
23832383
})
23842384
) {
23852385
insert_element_from_token(parser, token);
@@ -2678,7 +2678,7 @@ static bool handle_in_body(GumboParser* parser, GumboToken* token) {
26782678
return false;
26792679
} else if (
26802680
tag_in(token, kStartTag, (TagSet) {
2681-
TAG(BASE), TAG(BASEFONT), TAG(BGSOUND), TAG(MENUITEM), TAG(LINK),
2681+
TAG(BASE), TAG(BASEFONT), TAG(BGSOUND), TAG(LINK),
26822682
TAG(META), TAG(NOFRAMES), TAG(SCRIPT), TAG(STYLE), TAG(TEMPLATE),
26832683
TAG(TITLE)
26842684
})

test/tree-construction.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ do
152152
if test["script-on"] then
153153
-- The "script-on" tests are not relevant to a non-scripted
154154
-- parser, so they are just ignored instead of "skipped".
155-
elseif input:find("<menuitem>") then
156-
skipped = skipped + 1
157155
else
158156
local expected = assert(test.document)
159157
assert(#expected > 0)

0 commit comments

Comments
 (0)