Skip to content

Commit c662883

Browse files
committed
implement
1 parent 16be1bc commit c662883

7 files changed

Lines changed: 372 additions & 322 deletions

File tree

package-lock.json

Lines changed: 138 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/parse5-parser-stream/test/parser-stream.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,27 @@ generateParsingTests(
1717
'40.foreign-fragment',
1818
'47.foreign-fragment',
1919
'48.foreign-fragment',
20+
// Select parsing was relaxed in the HTML spec.
21+
// https://github.com/whatwg/html/pull/10548
22+
// The forked test suite still tests the old behaviour.
23+
'13.menuitem-element',
24+
'29.tests1',
25+
'101.tests1',
26+
'3.tests10',
27+
'4.tests10',
28+
'16.tests10',
29+
'17.tests10',
30+
'4.tests9',
31+
'5.tests9',
32+
'17.tests9',
33+
'18.tests9',
34+
'13.tests18',
35+
'14.tests18',
36+
'17.webkit02',
37+
'30.tests7',
38+
'79.tests_innerHTML_1',
39+
'80.tests_innerHTML_1',
40+
'81.tests_innerHTML_1',
2041
],
2142
},
2243
(test, opts) => parseChunked(test, opts),

packages/parse5/lib/common/html.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export enum ATTRS {
1717
COLOR = 'color',
1818
FACE = 'face',
1919
SIZE = 'size',
20+
SELECTED = 'selected',
2021
}
2122

2223
/**
@@ -142,6 +143,7 @@ export enum TAG_NAMES {
142143
SEARCH = 'search',
143144
SECTION = 'section',
144145
SELECT = 'select',
146+
SELECTEDCONTENT = 'selectedcontent',
145147
SOURCE = 'source',
146148
SMALL = 'small',
147149
SPAN = 'span',
@@ -296,6 +298,7 @@ export enum TAG_ID {
296298
SEARCH,
297299
SECTION,
298300
SELECT,
301+
SELECTEDCONTENT,
299302
SOURCE,
300303
SMALL,
301304
SPAN,
@@ -428,6 +431,7 @@ const TAG_NAME_TO_ID = new Map<string, TAG_ID>([
428431
[TAG_NAMES.SEARCH, TAG_ID.SEARCH],
429432
[TAG_NAMES.SECTION, TAG_ID.SECTION],
430433
[TAG_NAMES.SELECT, TAG_ID.SELECT],
434+
[TAG_NAMES.SELECTEDCONTENT, TAG_ID.SELECTEDCONTENT],
431435
[TAG_NAMES.SOURCE, TAG_ID.SOURCE],
432436
[TAG_NAMES.SMALL, TAG_ID.SMALL],
433437
[TAG_NAMES.SPAN, TAG_ID.SPAN],

packages/parse5/lib/parser/index.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@ generateParsingTests(
1818
'40.foreign-fragment',
1919
'47.foreign-fragment',
2020
'48.foreign-fragment',
21+
// Select parsing was relaxed in the HTML spec.
22+
// https://github.com/whatwg/html/pull/10548
23+
// The forked test suite still tests the old behaviour.
24+
'13.menuitem-element',
25+
'29.tests1',
26+
'101.tests1',
27+
'3.tests10',
28+
'4.tests10',
29+
'16.tests10',
30+
'17.tests10',
31+
'4.tests9',
32+
'5.tests9',
33+
'17.tests9',
34+
'18.tests9',
35+
'13.tests18',
36+
'14.tests18',
37+
'17.webkit02',
38+
'30.tests7',
39+
'79.tests_innerHTML_1',
40+
'80.tests_innerHTML_1',
41+
'81.tests_innerHTML_1',
2142
],
2243
},
2344
(test, opts) => ({

0 commit comments

Comments
 (0)