-
Notifications
You must be signed in to change notification settings - Fork 0
/
attributes.go
770 lines (670 loc) · 25.6 KB
/
attributes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
package html_types
import "time"
// Global attributes
type GlobalAttributes struct {
AccessKey string `json:"accesskey,omitempty"`
AutoCapitalize string `json:"autocapitalize,omitempty"`
Class string `json:"class,omitempty"`
ContentEditable bool `json:"contenteditable,omitempty"`
Data map[string]string `json:"data,omitempty"` // Data attributes in the form of data-*
Dir string `json:"dir,omitempty"`
Draggable bool `json:"draggable,omitempty"`
EnterKeyHint string `json:"enterkeyhint,omitempty"`
Hidden bool `json:"hidden,omitempty"`
Id string `json:"id,omitempty"`
InputMode string `json:"inputmode,omitempty"`
Is string `json:"is,omitempty"`
ItemId string `json:"itemid,omitempty"`
ItemProp string `json:"itemprop,omitempty"`
ItemRef string `json:"itemref,omitempty"`
ItemScope bool `json:"itemscope,omitempty"`
ItemType string `json:"itemtype,omitempty"`
Lang string `json:"lang,omitempty"`
Part string `json:"part,omitempty"`
Slot string `json:"slot,omitempty"`
SpellCheck bool `json:"spellcheck,omitempty"`
Style string `json:"style,omitempty"`
TabIndex int `json:"tabindex,omitempty"`
Title string `json:"title,omitempty"`
Translate string `json:"translate,omitempty"`
Role string `json:"role,omitempty"`
// Event handler attributes
OnClick string `json:"onclick,omitempty"`
OnChange string `json:"onchange,omitempty"`
OnInput string `json:"oninput,omitempty"`
OnSubmit string `json:"onsubmit,omitempty"`
OnKeyDown string `json:"onkeydown,omitempty"`
OnKeyPress string `json:"onkeypress,omitempty"`
OnKeyUp string `json:"onkeyup,omitempty"`
OnMouseDown string `json:"onmousedown,omitempty"`
OnMouseMove string `json:"onmousemove,omitempty"`
OnMouseOut string `json:"onmouseout,omitempty"`
OnMouseOver string `json:"onmouseover,omitempty"`
OnMouseUp string `json:"onmouseup,omitempty"`
}
// A attributes
type AnchorAttributes struct {
GlobalAttributes
Href string `json:"href,omitempty"`
Target string `json:"target,omitempty"`
Download string `json:"download,omitempty"`
Ping string `json:"ping,omitempty"`
Rel string `json:"rel,omitempty"`
HrefLang string `json:"hreflang,omitempty"`
ReferrerPolicy string `json:"referrerpolicy,omitempty"`
Type string `json:"type,omitempty"`
}
// Area attributes
type AreaAttributes struct {
GlobalAttributes
Alt string `json:"alt,omitempty"`
Coords string `json:"coords,omitempty"`
Shape string `json:"shape,omitempty"`
Href string `json:"href,omitempty"`
Target string `json:"target,omitempty"`
Download string `json:"download,omitempty"`
Ping string `json:"ping,omitempty"`
Rel string `json:"rel,omitempty"`
HrefLang string `json:"hreflang,omitempty"`
ReferrerPolicy string `json:"referrerpolicy,omitempty"`
}
// Audio, Video attributes
type MediaAttributes struct {
GlobalAttributes
Src string `json:"src,omitempty"`
CrossOrigin string `json:"crossorigin,omitempty"`
Preload string `json:"preload,omitempty"`
AutoPlay bool `json:"autoplay,omitempty"`
Controls bool `json:"controls,omitempty"`
Loop bool `json:"loop,omitempty"`
Muted bool `json:"muted,omitempty"`
Default bool `json:"default,omitempty"`
Kind string `json:"kind,omitempty"`
Label string `json:"label,omitempty"`
SrcLang string `json:"srclang,omitempty"`
}
// Base attributes
type BaseAttributes struct {
GlobalAttributes
Href string `json:"href,omitempty"`
Target string `json:"target,omitempty"`
}
// Blockquote, Q attributes
type QuoteAttributes struct {
GlobalAttributes
Cite string `json:"cite,omitempty"`
}
// Button attributes
type ButtonAttributes struct {
GlobalAttributes
AutoFocus bool `json:"autofocus,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Form string `json:"form,omitempty"`
FormAction string `json:"formaction,omitempty"`
FormEncType string `json:"formenctype,omitempty"`
FormMethod string `json:"formmethod,omitempty"`
FormNoValidate bool `json:"formnovalidate,omitempty"`
FormTarget string `json:"formtarget,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Value string `json:"value,omitempty"`
}
// Canvas attributes
type CanvasAttributes struct {
GlobalAttributes
Height int `json:"height,omitempty"`
Width int `json:"width,omitempty"`
}
// Col, Colgroup attributes
type ColAttributes struct {
GlobalAttributes
Span int `json:"span,omitempty"`
}
// Data attributes
type DataAttributes struct {
GlobalAttributes
Value string `json:"value,omitempty"`
}
// Embed attributes
type EmbedAttributes struct {
GlobalAttributes
Src string `json:"src,omitempty"`
Type string `json:"type,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
}
// Fieldset attributes
type FieldsetAttributes struct {
GlobalAttributes
Disabled bool `json:"disabled,omitempty"`
Form string `json:"form,omitempty"`
Name string `json:"name,omitempty"`
}
// Form attributes
type FormAttributes struct {
GlobalAttributes
AcceptCharset string `json:"accept-charset,omitempty"`
Action string `json:"action,omitempty"`
AutoComplete string `json:"autocomplete,omitempty"`
EncType string `json:"enctype,omitempty"`
Method string `json:"method,omitempty"`
NoValidate bool `json:"novalidate,omitempty"`
Target string `json:"target,omitempty"`
}
// Iframe attributes
type IframeAttributes struct {
GlobalAttributes
Allow string `json:"allow,omitempty"`
AllowFullScreen bool `json:"allowfullscreen,omitempty"`
AllowPaymentRequest bool `json:"allowpaymentrequest,omitempty"`
FrameBorder string `json:"frameborder,omitempty"`
Height string `json:"height,omitempty"`
LongDesc string `json:"longdesc,omitempty"`
MarginHeight string `json:"marginheight,omitempty"`
MarginWidth string `json:"marginwidth,omitempty"`
Name string `json:"name,omitempty"`
ReferrerPolicy string `json:"referrerpolicy,omitempty"`
Sandbox string `json:"sandbox,omitempty"`
Scrolling string `json:"scrolling,omitempty"`
Src string `json:"src,omitempty"`
SrcDoc string `json:"srcdoc,omitempty"`
Width string `json:"width,omitempty"`
}
// Img attributes
type ImgAttributes struct {
GlobalAttributes
Alt string `json:"alt,omitempty"`
CrossOrigin string `json:"crossorigin,omitempty"`
Decoding string `json:"decoding,omitempty"`
Height int `json:"height,omitempty"`
IsMap bool `json:"ismap,omitempty"`
Loading string `json:"loading,omitempty"`
ReferrerPolicy string `json:"referrerpolicy,omitempty"`
Sizes string `json:"sizes,omitempty"`
Src string `json:"src,omitempty"`
SrcSet string `json:"srcset,omitempty"`
UseMap string `json:"usemap,omitempty"`
Width int `json:"width,omitempty"`
}
// Input attributes
type InputAttributes struct {
GlobalAttributes
Accept string `json:"accept,omitempty"`
Alt string `json:"alt,omitempty"`
AutoComplete string `json:"autocomplete,omitempty"`
AutoFocus bool `json:"autofocus,omitempty"`
Capture string `json:"capture,omitempty"`
Checked bool `json:"checked,omitempty"`
DirName string `json:"dirname,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Form string `json:"form,omitempty"`
FormAction string `json:"formaction,omitempty"`
FormEncType string `json:"formenctype,omitempty"`
FormMethod string `json:"formmethod,omitempty"`
FormNoValidate bool `json:"formnovalidate,omitempty"`
FormTarget string `json:"formtarget,omitempty"`
Height int `json:"height,omitempty"`
List string `json:"list,omitempty"`
Max string `json:"max,omitempty"`
MaxLength int `json:"maxlength,omitempty"`
Min string `json:"min,omitempty"`
MinLength int `json:"minlength,omitempty"`
Multiple bool `json:"multiple,omitempty"`
Name string `json:"name,omitempty"`
Pattern string `json:"pattern,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
ReadOnly bool `json:"readonly,omitempty"`
Required bool `json:"required,omitempty"`
Size int `json:"size,omitempty"`
Src string `json:"src,omitempty"`
Step string `json:"step,omitempty"`
Type string `json:"type,omitempty"`
Value string `json:"value,omitempty"`
Width int `json:"width,omitempty"`
}
// Label attributes
type LabelAttributes struct {
GlobalAttributes
Form string `json:"form,omitempty"`
HtmlFor string `json:"for,omitempty"`
}
// Link attributes
type LinkAttributes struct {
GlobalAttributes
CrossOrigin string `json:"crossorigin,omitempty"`
Href string `json:"href,omitempty"`
HrefLang string `json:"hreflang,omitempty"`
Media string `json:"media,omitempty"`
Rel string `json:"rel,omitempty"`
Sizes string `json:"sizes,omitempty"`
Type string `json:"type,omitempty"`
}
// Map attributes
type MapAttributes struct {
GlobalAttributes
Name string `json:"name,omitempty"`
}
// Meta attributes
type MetaAttributes struct {
GlobalAttributes
Charset string `json:"charset,omitempty"`
Content string `json:"content,omitempty"`
HttpEquiv string `json:"http-equiv,omitempty"`
Name string `json:"name,omitempty"`
}
// Meter attributes
type MeterAttributes struct {
GlobalAttributes
Value float64 `json:"value,omitempty"`
Min float64 `json:"min,omitempty"`
Max float64 `json:"max,omitempty"`
Low float64 `json:"low,omitempty"`
High float64 `json:"high,omitempty"`
Optimum float64 `json:"optimum,omitempty"`
}
// Object attributes
type ObjectAttributes struct {
GlobalAttributes
Data string `json:"data,omitempty"`
Form string `json:"form,omitempty"`
Height int `json:"height,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
UseMap string `json:"usemap,omitempty"`
Width int `json:"width,omitempty"`
}
// Ol attributes
type OlAttributes struct {
GlobalAttributes
Reversed bool `json:"reversed,omitempty"`
Start int `json:"start,omitempty"`
Type string `json:"type,omitempty"`
}
// Optgroup attributes
type OptgroupAttributes struct {
GlobalAttributes
Disabled bool `json:"disabled,omitempty"`
Label string `json:"label,omitempty"`
}
// Option attributes
type OptionAttributes struct {
GlobalAttributes
Disabled bool `json:"disabled,omitempty"`
Label string `json:"label,omitempty"`
Selected bool `json:"selected,omitempty"`
Value string `json:"value,omitempty"`
}
// Output attributes
type OutputAttributes struct {
GlobalAttributes
For string `json:"for,omitempty"`
Form string `json:"form,omitempty"`
Name string `json:"name,omitempty"`
}
// Param attributes
type ParamAttributes struct {
GlobalAttributes
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
}
// Progress attributes
type ProgressAttributes struct {
GlobalAttributes
Max float64 `json:"max,omitempty"`
Value float64 `json:"value,omitempty"`
}
// Script attributes
type ScriptAttributes struct {
GlobalAttributes
Async bool `json:"async,omitempty"`
Defer bool `json:"defer,omitempty"`
Src string `json:"src,omitempty"`
Type string `json:"type,omitempty"`
}
// Select attributes
type SelectAttributes struct {
GlobalAttributes
AutoComplete string `json:"autocomplete,omitempty"`
AutoFocus bool `json:"autofocus,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Form string `json:"form,omitempty"`
Multiple bool `json:"multiple,omitempty"`
Name string `json:"name,omitempty"`
Required bool `json:"required,omitempty"`
Size int `json:"size,omitempty"`
}
// Source attributes
type SourceAttributes struct {
GlobalAttributes
Media string `json:"media,omitempty"`
Sizes string `json:"sizes,omitempty"`
Src string `json:"src,omitempty"`
SrcSet string `json:"srcset,omitempty"`
Type string `json:"type,omitempty"`
}
// Style attributes
type StyleAttributes struct {
GlobalAttributes
Media string `json:"media,omitempty"`
Type string `json:"type,omitempty"`
}
// Table attributes
type TableAttributes struct {
GlobalAttributes
Border string `json:"border,omitempty"`
}
// Textarea attributes
type TextareaAttributes struct {
GlobalAttributes
AutoComplete string `json:"autocomplete,omitempty"`
AutoFocus bool `json:"autofocus,omitempty"`
Cols int `json:"cols,omitempty"`
DirName string `json:"dirname,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Form string `json:"form,omitempty"`
MaxLength int `json:"maxlength,omitempty"`
MinLength int `json:"minlength,omitempty"`
Name string `json:"name,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
ReadOnly bool `json:"readonly,omitempty"`
Required bool `json:"required,omitempty"`
Rows int `json:"rows,omitempty"`
Wrap string `json:"wrap,omitempty"`
}
// Time attributes
type TimeAttributes struct {
GlobalAttributes
DateTime time.Time `json:"datetime,omitempty"`
}
// Track attributes
type TrackAttributes struct {
GlobalAttributes
Default bool `json:"default,omitempty"`
Kind string `json:"kind,omitempty"`
Label string `json:"label,omitempty"`
Src string `json:"src,omitempty"`
SrcLang string `json:"srclang,omitempty"`
}
// Video attributes
type VideoAttributes struct {
GlobalAttributes
Src string `json:"src,omitempty"`
CrossOrigin string `json:"crossorigin,omitempty"`
Preload string `json:"preload,omitempty"`
AutoPlay bool `json:"autoplay,omitempty"`
Controls bool `json:"controls,omitempty"`
Loop bool `json:"loop,omitempty"`
Muted bool `json:"muted,omitempty"`
Height int `json:"height,omitempty"`
Width int `json:"width,omitempty"`
Poster string `json:"poster,omitempty"`
}
// List attributes
type UlAttributes struct {
GlobalAttributes
}
// List attributes
type LiAttributes struct {
GlobalAttributes
Value int `json:"value,omitempty"`
}
// Details attributes
type DetailsAttributes struct {
GlobalAttributes
Open bool `json:"open,omitempty"`
}
// Dialog attributes
type DialogAttributes struct {
GlobalAttributes
Open bool `json:"open,omitempty"`
}
// Abbr attributes
type AbbrAttributes struct {
GlobalAttributes
}
// Address attributes
type AddressAttributes struct {
GlobalAttributes
}
// Article attributes
type ArticleAttributes struct {
GlobalAttributes
}
// Aside attributes
type AsideAttributes struct {
GlobalAttributes
}
// B attributes
type BAttributes struct {
GlobalAttributes
}
// Bdi attributes
type BdiAttributes struct {
GlobalAttributes
}
// Bdo attributes
type BdoAttributes struct {
GlobalAttributes
}
// Body attributes
type BodyAttributes struct {
GlobalAttributes
OnAfterPrint string `json:"onafterprint,omitempty"`
OnBeforePrint string `json:"onbeforeprint,omitempty"`
OnBeforeUnload string `json:"onbeforeunload,omitempty"`
OnHashChange string `json:"onhashchange,omitempty"`
OnLoad string `json:"onload,omitempty"`
OnMessage string `json:"onmessage,omitempty"`
OnOffline string `json:"onoffline,omitempty"`
OnOnline string `json:"ononline,omitempty"`
OnPageHide string `json:"onpagehide,omitempty"`
OnPageShow string `json:"onpageshow,omitempty"`
OnPopState string `json:"onpopstate,omitempty"`
OnResize string `json:"onresize,omitempty"`
OnStorage string `json:"onstorage,omitempty"`
OnUnload string `json:"onunload,omitempty"`
}
// Br attributes
type BrAttributes struct {
GlobalAttributes
}
// Caption attributes
type CaptionAttributes struct {
GlobalAttributes
}
// Cite attributes
type CiteAttributes struct {
GlobalAttributes
}
// Code attributes
type CodeAttributes struct {
GlobalAttributes
}
// Datalist attributes
type DatalistAttributes struct {
GlobalAttributes
}
// Dd attributes
type DdAttributes struct {
GlobalAttributes
}
// Del attributes
type DelAttributes struct {
GlobalAttributes
Cite string `json:"cite,omitempty"`
DateTime string `json:"datetime,omitempty"`
}
// Dfn attributes
type DfnAttributes struct {
GlobalAttributes
}
// Div attributes
type DivAttributes struct {
GlobalAttributes
}
// Dl attributes
type DlAttributes struct {
GlobalAttributes
}
// Dt attributes
type DtAttributes struct {
GlobalAttributes
}
// Em attributes
type EmAttributes struct {
GlobalAttributes
}
// Figcaption attributes
type FigcaptionAttributes struct {
GlobalAttributes
}
// Figure attributes
type FigureAttributes struct {
GlobalAttributes
}
// Footer attributes
type FooterAttributes struct {
GlobalAttributes
}
// Header attributes
type HeaderAttributes struct {
GlobalAttributes
}
// H1, H2, H3, H4, H5, H6 attributes
type HeadingAttributes struct {
GlobalAttributes
}
// Hr attributes
type HrAttributes struct {
GlobalAttributes
}
// Html attributes
type HtmlAttributes struct {
GlobalAttributes
Manifest string `json:"manifest,omitempty"`
}
// I attributes
type IAttributes struct {
GlobalAttributes
}
// Ins attributes
type InsAttributes struct {
GlobalAttributes
Cite string `json:"cite,omitempty"`
DateTime string `json:"datetime,omitempty"`
}
// Kbd attributes
type KbdAttributes struct {
GlobalAttributes
}
// Main attributes
type MainAttributes struct {
GlobalAttributes
}
// Mark attributes
type MarkAttributes struct {
GlobalAttributes
}
// Nav attributes
type NavAttributes struct {
GlobalAttributes
}
// Noscript attributes
type NoscriptAttributes struct {
GlobalAttributes
}
// P attributes
type PAttributes struct {
GlobalAttributes
}
// Pre attributes
type PreAttributes struct {
GlobalAttributes
}
// Ruby attributes
type RubyAttributes struct {
GlobalAttributes
}
// S attributes
type SAttributes struct {
GlobalAttributes
}
// Samp attributes
type SampAttributes struct {
GlobalAttributes
}
// Section attributes
type SectionAttributes struct {
GlobalAttributes
}
// Small attributes
type SmallAttributes struct {
GlobalAttributes
}
// Span attributes
type SpanAttributes struct {
GlobalAttributes
}
// Strong attributes
type StrongAttributes struct {
GlobalAttributes
}
// Sub attributes
type SubAttributes struct {
GlobalAttributes
}
// Summary attributes
type SummaryAttributes struct {
GlobalAttributes
}
// Sup attributes
type SupAttributes struct {
GlobalAttributes
}
// Template attributes
type TemplateAttributes struct {
GlobalAttributes
}
// Tbody attributes
type TbodyAttributes struct {
GlobalAttributes
}
// Td attributes
type TdAttributes struct {
GlobalAttributes
ColSpan int `json:"colspan,omitempty"`
Headers string `json:"headers,omitempty"`
RowSpan int `json:"rowspan,omitempty"`
}
// Tfoot attributes
type TfootAttributes struct {
GlobalAttributes
}
// Th attributes
type ThAttributes struct {
GlobalAttributes
ColSpan int `json:"colspan,omitempty"`
Headers string `json:"headers,omitempty"`
RowSpan int `json:"rowspan,omitempty"`
Scope string `json:"scope,omitempty"`
}
// Thead attributes
type TheadAttributes struct {
GlobalAttributes
}
// Tr attributes
type TrAttributes struct {
GlobalAttributes
}
// U attributes
type UAttributes struct {
GlobalAttributes
}
// Var attributes
type VarAttributes struct {
GlobalAttributes
}
// Wbr attributes
type WbrAttributes struct {
GlobalAttributes
}