Skip to content

Commit b3c74e0

Browse files
Add HTML elements and attributes added since the initial release
1 parent 5e125fc commit b3c74e0

File tree

16 files changed

+202
-4
lines changed

16 files changed

+202
-4
lines changed

src/HTMLElementBase.hack

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ abstract xhp class HTMLElementBase extends SGMLStream\RootElement {
2424
'words',
2525
'characters',
2626
} autocapitalize,
27+
/**
28+
* @see https://html.spec.whatwg.org/multipage/interaction.html#attr-autocorrect
29+
*/
30+
enum {'', 'on', 'off'} autocorrect,
2731
/**
2832
* @see https://html.spec.whatwg.org/multipage/#attr-fe-autofocus
2933
*/
@@ -70,6 +74,10 @@ abstract xhp class HTMLElementBase extends SGMLStream\RootElement {
7074
* least one character in length and without ascii whitespace.
7175
*/
7276
string id,
77+
/**
78+
* @see https://html.spec.whatwg.org/multipage/interaction.html#the-inert-attribute
79+
*/
80+
SGMLStreamInterfaces\BooleanAttribute inert,
7381
/**
7482
* @see https://html.spec.whatwg.org/multipage/#attr-inputmode
7583
*/
@@ -123,6 +131,10 @@ abstract xhp class HTMLElementBase extends SGMLStream\RootElement {
123131
* Any text is allowed.
124132
*/
125133
string nonce,
134+
/**
135+
* @see https://html.spec.whatwg.org/multipage/popover.html#attr-popover
136+
*/
137+
enum {'', 'auto', 'manual', 'hint'} popover,
126138
/**
127139
* @see https://html.spec.whatwg.org/multipage/#handler-onabort
128140
*/
@@ -131,6 +143,18 @@ abstract xhp class HTMLElementBase extends SGMLStream\RootElement {
131143
* @see https://html.spec.whatwg.org/multipage/#handler-onauxclick
132144
*/
133145
string onauxclick,
146+
/**
147+
* @see https://html.spec.whatwg.org/multipage/webappapis.html#handler-onbeforeinput
148+
*/
149+
string onbeforeinput,
150+
/**
151+
* @see https://html.spec.whatwg.org/multipage/webappapis.html#handler-onbeforematch
152+
*/
153+
string onbeforematch,
154+
/**
155+
* @see https://html.spec.whatwg.org/multipage/webappapis.html#handler-onbeforetoggle
156+
*/
157+
string onbeforetoggle,
134158
/**
135159
* @see https://html.spec.whatwg.org/multipage/#handler-onblur
136160
*/
@@ -159,10 +183,22 @@ abstract xhp class HTMLElementBase extends SGMLStream\RootElement {
159183
* @see https://html.spec.whatwg.org/multipage/#handler-onclose
160184
*/
161185
string onclose,
186+
/**
187+
* @see https://html.spec.whatwg.org/multipage/webappapis.html#handler-oncommand
188+
*/
189+
string oncommand,
190+
/**
191+
* @see https://html.spec.whatwg.org/multipage/webappapis.html#handler-oncontextlost
192+
*/
193+
string oncontextlost,
162194
/**
163195
* @see https://html.spec.whatwg.org/multipage/#handler-oncontextmenu
164196
*/
165197
string oncontextmenu,
198+
/**
199+
* @see https://html.spec.whatwg.org/multipage/webappapis.html#handler-oncontextlost
200+
*/
201+
string oncontextrestored,
166202
/**
167203
* @see https://html.spec.whatwg.org/multipage/#handler-oncopy
168204
*/
@@ -331,6 +367,10 @@ abstract xhp class HTMLElementBase extends SGMLStream\RootElement {
331367
* @see https://html.spec.whatwg.org/multipage/#handler-onscroll
332368
*/
333369
string onscroll,
370+
/**
371+
* @see https://html.spec.whatwg.org/multipage/webappapis.html#handler-onscrollend
372+
*/
373+
string onscrollend,
334374
/**
335375
* @see https://html.spec.whatwg.org/multipage/#handler-onsecuritypolicyviolation
336376
*/
@@ -415,5 +455,9 @@ abstract xhp class HTMLElementBase extends SGMLStream\RootElement {
415455
/**
416456
* @see https://html.spec.whatwg.org/multipage/#attr-translate
417457
*/
418-
enum {'yes', 'no'} translate;
458+
enum {'yes', 'no'} translate,
459+
/**
460+
* @see https://html.spec.whatwg.org/multipage/interaction.html#attr-writingsuggestions
461+
*/
462+
enum {'', 'true', 'false'} writingsuggestions;
419463
}

src/tags/b/body.hack

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,18 @@ final xhp class body extends HTMLElementBase {
5353
* @see https://html.spec.whatwg.org/multipage/#handler-window-onpagehide
5454
*/
5555
string onpagehide,
56+
/**
57+
* @see https://html.spec.whatwg.org/multipage/webappapis.html#handler-window-onpagereveal
58+
*/
59+
string onpagereveal,
5660
/**
5761
* @see https://html.spec.whatwg.org/multipage/#handler-window-onpageshow
5862
*/
5963
string onpageshow,
64+
/**
65+
* @see https://html.spec.whatwg.org/multipage/webappapis.html#handler-window-onpageswap
66+
*/
67+
string onpageswap,
6068
/**
6169
* @see https://html.spec.whatwg.org/multipage/#handler-window-onpopstate
6270
*/

src/tags/b/button.hack

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ final xhp class button extends HTMLElementBase {
1313

1414
const string TAG_NAME = 'button';
1515
attribute
16+
/**
17+
* @see https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-command
18+
* Valid options include: toggle-popover, show-popover, hide-popover, close,
19+
* request-close, show-modal, and a custom command keyword of your choosing
20+
*/
21+
string command,
22+
/**
23+
* @see https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-commandfor
24+
* A valid id of the element on which to perform the command
25+
*/
26+
string commandfor,
1627
/**
1728
* @see https://html.spec.whatwg.org/multipage/#attr-fe-disabled
1829
*/
@@ -55,6 +66,15 @@ final xhp class button extends HTMLElementBase {
5566
* Any name except for the empty string and isindex.
5667
*/
5768
string name,
69+
/**
70+
* @see https://html.spec.whatwg.org/multipage/popover.html#attr-popovertarget
71+
* A valid id of the popovertarget
72+
*/
73+
string popovertarget,
74+
/**
75+
* @see https://html.spec.whatwg.org/multipage/popover.html#attr-popovertargetaction
76+
*/
77+
enum {'toggle', 'show', 'hide'} popovertargetaction,
5878
/**
5979
* @see https://html.spec.whatwg.org/multipage/#attr-button-type
6080
*/

src/tags/d/details.hack

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ final xhp class details extends HTMLElementBase {
1313

1414
const string TAG_NAME = 'details';
1515
attribute
16+
/**
17+
* @see https://html.spec.whatwg.org/multipage/interactive-elements.html#attr-details-name
18+
* Name of group of mutually-exclusive details elements
19+
*/
20+
string name,
1621
/**
1722
* @see https://html.spec.whatwg.org/multipage/#attr-details-open
1823
*/

src/tags/d/dialog.hack

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ final xhp class dialog extends HTMLElementBase {
1313

1414
const string TAG_NAME = 'dialog';
1515
attribute
16+
/**
17+
* @see https://html.spec.whatwg.org/multipage/interactive-elements.html#attr-dialog-closedby
18+
*/
19+
enum {'any', 'closerequest', 'none'} closedby,
1620
/**
1721
* @see https://html.spec.whatwg.org/multipage/#attr-dialog-open
1822
*/

src/tags/i/iframe.hack

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ final xhp class iframe extends HTMLElementBase {
2828
* @see https://html.spec.whatwg.org/multipage/#attr-dim-height
2929
*/
3030
int height,
31+
/**
32+
* @see https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-loading
33+
*/
34+
enum {'lazy', 'eager'} loading,
3135
/**
3236
* @see https://html.spec.whatwg.org/multipage/#attr-iframe-name
3337
* A valid browsing context name, for example, "__blank", "__self" or "__parent". For

src/tags/i/img.hack

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ final xhp class img extends HTMLElementBase {
2626
* @see https://html.spec.whatwg.org/multipage/#attr-img-decoding
2727
*/
2828
enum {'sync', 'async', 'auto'} decoding,
29+
/**
30+
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-fetchpriority
31+
* A modern way to increase (or decrease) the priority with which the browser fetches
32+
* a resource. See
33+
* https://html.spec.whatwg.org/multipage/urls-and-fetching.html#fetch-priority-attribute
34+
*/
35+
enum {'high', 'low', 'auto'} fetchpriority,
2936
/**
3037
* @see https://html.spec.whatwg.org/multipage/#attr-dim-height
3138
*/

src/tags/i/input.hack

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ final xhp class input extends HTMLElementBase {
1919
* string with no parameters, file extensions starting with a ".".
2020
*/
2121
string accept,
22+
/**
23+
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-alpha
24+
* If present, it indicates the CSS color's alpha component can be manipulated by the
25+
* end user and does not have to be fully opaque.
26+
*/
27+
SGMLStreamInterfaces\BooleanAttribute alpha,
2228
/**
2329
* @see https://html.spec.whatwg.org/multipage/#attr-input-alt
2430
* Any text which is an adequate replacement for the missing image.
@@ -33,6 +39,10 @@ final xhp class input extends HTMLElementBase {
3339
* @see https://html.spec.whatwg.org/multipage/#attr-input-checked
3440
*/
3541
SGMLStreamInterfaces\BooleanAttribute checked,
42+
/**
43+
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-colorspace
44+
*/
45+
enum {'limited-srgb', 'display-p3'} colorspace,
3646
/**
3747
* @see https://html.spec.whatwg.org/multipage/#attr-fe-dirname
3848
* Any name that is not an empty string. The browser will implicitly append `.dir` in
@@ -122,6 +132,15 @@ final xhp class input extends HTMLElementBase {
122132
* A string without a linefeed (\n) or carriage return (\r).
123133
*/
124134
string placeholder,
135+
/**
136+
* @see https://html.spec.whatwg.org/multipage/popover.html#attr-popovertarget
137+
* A valid id of the popovertarget
138+
*/
139+
string popovertarget,
140+
/**
141+
* @see https://html.spec.whatwg.org/multipage/popover.html#attr-popovertargetaction
142+
*/
143+
enum {'toggle', 'show', 'hide'} popovertargetaction,
125144
/**
126145
* @see https://html.spec.whatwg.org/multipage/#attr-input-readonly
127146
*/

src/tags/l/link.hack

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@ final xhp class link extends HTMLElementBase {
1919
* https://fetch.spec.whatwg.org/#concept-request-destination for more information.
2020
*/
2121
string as,
22+
/**
23+
* @see https://html.spec.whatwg.org/multipage/semantics.html#attr-link-blocking
24+
* Not very useful at this time. It is not possible to use this attribute to make
25+
* something that was render-blocking not render-blocking.
26+
*/
27+
enum {'render'} blocking,
2228
/**
2329
* @see https://html.spec.whatwg.org/multipage/#attr-link-color
24-
* I CSS color value.
30+
* A CSS color value.
2531
*/
2632
string color,
2733
/**
@@ -32,6 +38,13 @@ final xhp class link extends HTMLElementBase {
3238
* @see https://html.spec.whatwg.org/multipage/#attr-link-disabled
3339
*/
3440
SGMLStreamInterfaces\BooleanAttribute disabled,
41+
/**
42+
* @see https://html.spec.whatwg.org/multipage/semantics.html#attr-link-fetchpriority
43+
* A modern way to increase (or decrease) the priority with which the browser fetches
44+
* a resource. See
45+
* https://html.spec.whatwg.org/multipage/urls-and-fetching.html#fetch-priority-attribute
46+
*/
47+
enum {'high', 'low', 'auto'} fetchpriority,
3548
/**
3649
* @see https://html.spec.whatwg.org/multipage/#attr-link-href
3750
* A URL potentially surrounded by spaces.

src/tags/m/meta.hack

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ final xhp class meta extends HTMLElementBase {
3333
'x-ua-compatible',
3434
'content-security-policy',
3535
} http-equiv,
36+
/**
37+
* @see https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-media
38+
* Unless the name is theme-color, the media attribute has no effect on the
39+
* processing model and must not be used by authors.
40+
*/
41+
string media,
3642
/**
3743
* @see https://html.spec.whatwg.org/multipage/#attr-meta-name
3844
* Any name.

0 commit comments

Comments
 (0)