Skip to content

Commit 29d9e88

Browse files
Use CodegenXHPAttribute
Hack Codegen just got support for codegenning xhp classes. There are no changes to the code, other than formatting differences. I hope to be releasing this clean up codegen soon.
1 parent 58ec5cd commit 29d9e88

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+673
-344
lines changed

src/GlobalHTMLAttributes.hack

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,37 @@
22
/**
33
* This file is generated. Do not modify it manually!
44
*
5-
* @generated SignedSource<<791696ecef425920be00f0a97c386357>>
5+
* @generated SignedSource<<3d0df4bf352417b2f38cb5581ca6f8a3>>
66
*/
77
use namespace HTL\SGMLStreamInterfaces;
88

99
trait GlobalHTMLAttributes {
1010
attribute
1111
/**
1212
* @see https://html.spec.whatwg.org/multipage/#the-accesskey-attribute
13-
* An ordered set of unique space-separated tokens none of which are identical to another token and each of which must be
14-
* exactly one code point in length.
13+
* An ordered set of unique space-separated tokens none of which are identical to
14+
* another token and each of which must be exactly one code point in length.
1515
*/
1616
string accesskey,
1717
/**
1818
* @see https://html.spec.whatwg.org/multipage/#attr-autocapitalize
1919
*/
20-
enum {'off', 'none', 'on', 'sentences', 'words', 'characters'} autocapitalize,
20+
enum {
21+
'off',
22+
'none',
23+
'on',
24+
'sentences',
25+
'words',
26+
'characters',
27+
} autocapitalize,
2128
/**
2229
* @see https://html.spec.whatwg.org/multipage/#attr-fe-autofocus
2330
*/
2431
SGMLStreamInterfaces\BooleanAttribute autofocus,
2532
/**
2633
* @see https://html.spec.whatwg.org/multipage/#classes
27-
* A set of space-separated tokens representing the various classes that the element belongs to.
34+
* A set of space-separated tokens representing the various classes that the element
35+
* belongs to.
2836
*/
2937
string class,
3038
/**
@@ -44,21 +52,38 @@ trait GlobalHTMLAttributes {
4452
/**
4553
* @see https://html.spec.whatwg.org/multipage/#attr-enterkeyhint
4654
*/
47-
enum {'enter', 'done', 'go', 'next', 'previous', 'search', 'send'} enterkeyhint,
55+
enum {
56+
'enter',
57+
'done',
58+
'go',
59+
'next',
60+
'previous',
61+
'search',
62+
'send',
63+
} enterkeyhint,
4864
/**
4965
* @see https://html.spec.whatwg.org/multipage/#attr-hidden
5066
*/
5167
SGMLStreamInterfaces\BooleanAttribute hidden,
5268
/**
5369
* @see https://html.spec.whatwg.org/multipage/#the-id-attribute
54-
* A unique value amount all id attributes of the HTML elements in your document. At least one character in length and
55-
* without ascii whitespace.
70+
* A unique value amount all id attributes of the HTML elements in your document. At
71+
* least one character in length and without ascii whitespace.
5672
*/
5773
string id,
5874
/**
5975
* @see https://html.spec.whatwg.org/multipage/#attr-inputmode
6076
*/
61-
enum {'none', 'text', 'tel', 'url', 'email', 'numeric', 'decimal', 'search'} inputmode,
77+
enum {
78+
'none',
79+
'text',
80+
'tel',
81+
'url',
82+
'email',
83+
'numeric',
84+
'decimal',
85+
'search',
86+
} inputmode,
6287
/**
6388
* @see https://html.spec.whatwg.org/multipage/#attr-is
6489
* A valid custom element name.
@@ -76,7 +101,8 @@ trait GlobalHTMLAttributes {
76101
string itemprop,
77102
/**
78103
* @see https://html.spec.whatwg.org/multipage/#attr-itemref
79-
* A set of unique space-separated tokens referring to HTML element ids in the current document.
104+
* A set of unique space-separated tokens referring to HTML element ids in the
105+
* current document.
80106
*/
81107
string itemref,
82108
/**
@@ -364,7 +390,8 @@ trait GlobalHTMLAttributes {
364390
string role,
365391
/**
366392
* @see https://html.spec.whatwg.org/multipage/#attr-slot
367-
* As far as I understand, any string is valid, since <slot name=?> is allowed to be any string.
393+
* As far as I understand, any string is valid, since <slot name=?> is allowed to be
394+
* any string.
368395
*/
369396
string slot,
370397
/**

src/tags/a/a.hack

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
/**
33
* This file is generated. Do not modify it manually!
44
*
5-
* @generated SignedSource<<903fa32a4eddc3399122cf3352ed14ec>>
5+
* @generated SignedSource<<1dd64b545c74373e0b9fd2a9cf09a896>>
66
*/
77
use namespace HTL\SGMLStream;
88

99
/**
1010
* @see https://html.spec.whatwg.org/multipage/#the-a-element
1111
*/
1212
final xhp class a extends SGMLStream\RootElement {
13-
protected string $tagName = 'a';
13+
1414
use GlobalHTMLAttributes;
1515
use SGMLStream\ElementWithOpenAndCloseTags;
16-
1716
attribute
1817
/**
1918
* @see https://html.spec.whatwg.org/multipage/#attr-hyperlink-download
@@ -38,7 +37,17 @@ final xhp class a extends SGMLStream\RootElement {
3837
/**
3938
* @see https://html.spec.whatwg.org/multipage/#attr-hyperlink-referrerpolicy
4039
*/
41-
enum {'', 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin', 'unsafe-url'} referrerpolicy,
40+
enum {
41+
'',
42+
'no-referrer',
43+
'no-referrer-when-downgrade',
44+
'same-origin',
45+
'origin',
46+
'strict-origin',
47+
'origin-when-cross-origin',
48+
'strict-origin-when-cross-origin',
49+
'unsafe-url',
50+
} referrerpolicy,
4251
/**
4352
* @see https://html.spec.whatwg.org/multipage/#attr-hyperlink-rel
4453
* A space separated list of keywords. F.e. "next" or "license". See
@@ -47,7 +56,8 @@ final xhp class a extends SGMLStream\RootElement {
4756
string rel,
4857
/**
4958
* @see https://html.spec.whatwg.org/multipage/#attr-hyperlink-target
50-
* A valid browsing context name, for example, "__blank", "__self" or "__parent". For more see
59+
* A valid browsing context name, for example, "__blank", "__self" or "__parent". For
60+
* more see
5161
* https://html.spec.whatwg.org/multipage/browsers.html#valid-browsing-context-name-or-keyword.
5262
*/
5363
string target,
@@ -56,4 +66,6 @@ final xhp class a extends SGMLStream\RootElement {
5666
* A MIME type string.
5767
*/
5868
string type;
69+
70+
protected string $tagName = 'a';
5971
}

src/tags/a/abbr.hack

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
/**
33
* This file is generated. Do not modify it manually!
44
*
5-
* @generated SignedSource<<8b7e0d1acbf98b01aaf3a1f53d6096b2>>
5+
* @generated SignedSource<<3017ace5a8ce23038e39e290f93fc791>>
66
*/
77
use namespace HTL\SGMLStream;
88

99
/**
1010
* @see https://html.spec.whatwg.org/multipage/#the-abbr-element
1111
*/
1212
final xhp class abbr extends SGMLStream\RootElement {
13-
protected string $tagName = 'abbr';
13+
1414
use GlobalHTMLAttributes;
1515
use SGMLStream\ElementWithOpenAndCloseTags;
16+
17+
protected string $tagName = 'abbr';
1618
}

src/tags/a/address.hack

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
/**
33
* This file is generated. Do not modify it manually!
44
*
5-
* @generated SignedSource<<acd7372779cd95f6fa0f5b2810d8c7dd>>
5+
* @generated SignedSource<<5b7d8b2c896d08633c67286176bb49fd>>
66
*/
77
use namespace HTL\SGMLStream;
88

99
/**
1010
* @see https://html.spec.whatwg.org/multipage/#the-address-element
1111
*/
1212
final xhp class address extends SGMLStream\RootElement {
13-
protected string $tagName = 'address';
13+
1414
use GlobalHTMLAttributes;
1515
use SGMLStream\ElementWithOpenAndCloseTags;
16+
17+
protected string $tagName = 'address';
1618
}

src/tags/a/area.hack

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
/**
33
* This file is generated. Do not modify it manually!
44
*
5-
* @generated SignedSource<<15a1bb9c1ed0b036cbf38090eefa0311>>
5+
* @generated SignedSource<<b4e9130b890b32144da06a1a1ef89f9a>>
66
*/
77
use namespace HTL\SGMLStream;
88

99
/**
1010
* @see https://html.spec.whatwg.org/multipage/#the-area-element
1111
*/
1212
final xhp class area extends SGMLStream\RootElement {
13-
protected string $tagName = 'area';
13+
1414
use GlobalHTMLAttributes;
1515
use SGMLStream\ElementWithOpenAndCloseTags;
16-
1716
attribute
1817
/**
1918
* @see https://html.spec.whatwg.org/multipage/#attr-area-alt
@@ -43,7 +42,17 @@ final xhp class area extends SGMLStream\RootElement {
4342
/**
4443
* @see https://html.spec.whatwg.org/multipage/#attr-hyperlink-referrerpolicy
4544
*/
46-
enum {'', 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin', 'unsafe-url'} referrerpolicy,
45+
enum {
46+
'',
47+
'no-referrer',
48+
'no-referrer-when-downgrade',
49+
'same-origin',
50+
'origin',
51+
'strict-origin',
52+
'origin-when-cross-origin',
53+
'strict-origin-when-cross-origin',
54+
'unsafe-url',
55+
} referrerpolicy,
4756
/**
4857
* @see https://html.spec.whatwg.org/multipage/#attr-hyperlink-rel
4958
* A space separated list of keywords. F.e. "next" or "license". See
@@ -56,8 +65,11 @@ final xhp class area extends SGMLStream\RootElement {
5665
enum {'circle', 'default', 'poly', 'rect'} shape,
5766
/**
5867
* @see https://html.spec.whatwg.org/multipage/#attr-hyperlink-target
59-
* A valid browsing context name, for example, "__blank", "__self" or "__parent". For more see
68+
* A valid browsing context name, for example, "__blank", "__self" or "__parent". For
69+
* more see
6070
* https://html.spec.whatwg.org/multipage/browsers.html#valid-browsing-context-name-or-keyword.
6171
*/
6272
string target;
73+
74+
protected string $tagName = 'area';
6375
}

src/tags/a/article.hack

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
/**
33
* This file is generated. Do not modify it manually!
44
*
5-
* @generated SignedSource<<bf5cadeab8af5bec6d923c25ccc1a812>>
5+
* @generated SignedSource<<4399f483e55c84965a810a7b57041520>>
66
*/
77
use namespace HTL\SGMLStream;
88

99
/**
1010
* @see https://html.spec.whatwg.org/multipage/#the-article-element
1111
*/
1212
final xhp class article extends SGMLStream\RootElement {
13-
protected string $tagName = 'article';
13+
1414
use GlobalHTMLAttributes;
1515
use SGMLStream\ElementWithOpenTagOnly;
16+
17+
protected string $tagName = 'article';
1618
}

src/tags/a/aside.hack

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
/**
33
* This file is generated. Do not modify it manually!
44
*
5-
* @generated SignedSource<<f0830926868c09672bdeca81a48652e7>>
5+
* @generated SignedSource<<e6a17e569e04a675b499e78aad59de4a>>
66
*/
77
use namespace HTL\SGMLStream;
88

99
/**
1010
* @see https://html.spec.whatwg.org/multipage/#the-aside-element
1111
*/
1212
final xhp class aside extends SGMLStream\RootElement {
13-
protected string $tagName = 'aside';
13+
1414
use GlobalHTMLAttributes;
1515
use SGMLStream\ElementWithOpenAndCloseTags;
16+
17+
protected string $tagName = 'aside';
1618
}

src/tags/a/audio.hack

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
/**
33
* This file is generated. Do not modify it manually!
44
*
5-
* @generated SignedSource<<6f5da413458e204736fcb91379e7b85d>>
5+
* @generated SignedSource<<3a54c2fbef190eae23f66919de90e5de>>
66
*/
77
use namespace HTL\{SGMLStream, SGMLStreamInterfaces};
88

99
/**
1010
* @see https://html.spec.whatwg.org/multipage/#the-audio-element
1111
*/
1212
final xhp class audio extends SGMLStream\RootElement {
13-
protected string $tagName = 'audio';
13+
1414
use GlobalHTMLAttributes;
1515
use SGMLStream\ElementWithOpenAndCloseTags;
16-
1716
attribute
1817
/**
1918
* @see https://html.spec.whatwg.org/multipage/#attr-media-autoplay
@@ -44,4 +43,6 @@ final xhp class audio extends SGMLStream\RootElement {
4443
* A URL potentially surrounded by spaces.
4544
*/
4645
string src;
46+
47+
protected string $tagName = 'audio';
4748
}

src/tags/b/b.hack

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
/**
33
* This file is generated. Do not modify it manually!
44
*
5-
* @generated SignedSource<<ff90540cf31d69b36fc86e11cd3bf837>>
5+
* @generated SignedSource<<6af288bb5063bd888137f952eb26c58a>>
66
*/
77
use namespace HTL\SGMLStream;
88

99
/**
1010
* @see https://html.spec.whatwg.org/multipage/#the-b-element
1111
*/
1212
final xhp class b extends SGMLStream\RootElement {
13-
protected string $tagName = 'b';
13+
1414
use GlobalHTMLAttributes;
1515
use SGMLStream\ElementWithOpenAndCloseTags;
16+
17+
protected string $tagName = 'b';
1618
}

src/tags/b/base.hack

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
/**
33
* This file is generated. Do not modify it manually!
44
*
5-
* @generated SignedSource<<84cbc62bf5dcf3697ee8a1a5f26fb78f>>
5+
* @generated SignedSource<<f6098369ce175a8530e1d518c471c557>>
66
*/
77
use namespace HTL\SGMLStream;
88

99
/**
1010
* @see https://html.spec.whatwg.org/multipage/#the-base-element
1111
*/
1212
final xhp class base extends SGMLStream\RootElement {
13-
protected string $tagName = 'base';
13+
1414
use GlobalHTMLAttributes;
1515
use SGMLStream\ElementWithOpenTagOnly;
16-
1716
attribute
1817
/**
1918
* @see https://html.spec.whatwg.org/multipage/#attr-base-href
@@ -22,8 +21,11 @@ final xhp class base extends SGMLStream\RootElement {
2221
string href,
2322
/**
2423
* @see https://html.spec.whatwg.org/multipage/#attr-base-target
25-
* A valid browsing context name, for example, "__blank", "__self" or "__parent". For more see
24+
* A valid browsing context name, for example, "__blank", "__self" or "__parent". For
25+
* more see
2626
* https://html.spec.whatwg.org/multipage/browsers.html#valid-browsing-context-name-or-keyword.
2727
*/
2828
string target;
29+
30+
protected string $tagName = 'base';
2931
}

0 commit comments

Comments
 (0)