10b57cec5SDimitry Andricclass Tag<string spelling> {
20b57cec5SDimitry Andric  string Spelling = spelling;
30b57cec5SDimitry Andric  bit EndTagOptional = 0;
40b57cec5SDimitry Andric  bit EndTagForbidden = 0;
50b57cec5SDimitry Andric}
60b57cec5SDimitry Andric
70b57cec5SDimitry Andricdef Em      : Tag<"em">;
80b57cec5SDimitry Andricdef Strong  : Tag<"strong">;
90b57cec5SDimitry Andricdef Tt      : Tag<"tt">;
100b57cec5SDimitry Andricdef I       : Tag<"i">;
110b57cec5SDimitry Andricdef B       : Tag<"b">;
120b57cec5SDimitry Andricdef Big     : Tag<"big">;
130b57cec5SDimitry Andricdef Small   : Tag<"small">;
140b57cec5SDimitry Andricdef Strike  : Tag<"strike">;
150b57cec5SDimitry Andricdef S       : Tag<"s">;
160b57cec5SDimitry Andricdef U       : Tag<"u">;
170b57cec5SDimitry Andricdef Font    : Tag<"font">;
180b57cec5SDimitry Andricdef A       : Tag<"a">;
190b57cec5SDimitry Andricdef Hr      : Tag<"hr"> { let EndTagForbidden = 1; }
200b57cec5SDimitry Andricdef Div     : Tag<"div">;
210b57cec5SDimitry Andricdef Span    : Tag<"span">;
220b57cec5SDimitry Andricdef H1      : Tag<"h1">;
230b57cec5SDimitry Andricdef H2      : Tag<"h2">;
240b57cec5SDimitry Andricdef H3      : Tag<"h3">;
250b57cec5SDimitry Andricdef H4      : Tag<"h4">;
260b57cec5SDimitry Andricdef H5      : Tag<"h5">;
270b57cec5SDimitry Andricdef H6      : Tag<"h6">;
280b57cec5SDimitry Andricdef Code    : Tag<"code">;
290b57cec5SDimitry Andricdef Blockquote : Tag<"blockquote">;
300b57cec5SDimitry Andricdef Sub     : Tag<"sub">;
310b57cec5SDimitry Andricdef Sup     : Tag<"sup">;
320b57cec5SDimitry Andricdef Img     : Tag<"img"> { let EndTagForbidden = 1; }
330b57cec5SDimitry Andricdef P       : Tag<"p"> { let EndTagOptional = 1; }
340b57cec5SDimitry Andricdef Br      : Tag<"br"> { let EndTagForbidden = 1; }
350b57cec5SDimitry Andricdef Pre     : Tag<"pre">;
360b57cec5SDimitry Andricdef Ins     : Tag<"ins">;
370b57cec5SDimitry Andricdef Del     : Tag<"del">;
380b57cec5SDimitry Andricdef Ul      : Tag<"ul">;
390b57cec5SDimitry Andricdef Ol      : Tag<"ol">;
400b57cec5SDimitry Andricdef Li      : Tag<"li"> { let EndTagOptional = 1; }
410b57cec5SDimitry Andricdef Dl      : Tag<"dl">;
420b57cec5SDimitry Andricdef Dt      : Tag<"dt"> { let EndTagOptional = 1; }
430b57cec5SDimitry Andricdef Dd      : Tag<"dd"> { let EndTagOptional = 1; }
440b57cec5SDimitry Andricdef Table   : Tag<"table">;
450b57cec5SDimitry Andricdef Caption : Tag<"caption">;
460b57cec5SDimitry Andricdef Thead   : Tag<"thead"> { let EndTagOptional = 1; }
470b57cec5SDimitry Andricdef Tfoot   : Tag<"tfoot"> { let EndTagOptional = 1; }
480b57cec5SDimitry Andricdef Tbody   : Tag<"tbody"> { let EndTagOptional = 1; }
490b57cec5SDimitry Andricdef Colgroup : Tag<"colgroup"> { let EndTagOptional = 1; }
500b57cec5SDimitry Andricdef Col     : Tag<"col"> { let EndTagForbidden = 1; }
510b57cec5SDimitry Andricdef Tr      : Tag<"tr"> { let EndTagOptional = 1; }
520b57cec5SDimitry Andricdef Th      : Tag<"th"> { let EndTagOptional = 1; }
530b57cec5SDimitry Andricdef Td      : Tag<"td"> { let EndTagOptional = 1; }
540b57cec5SDimitry Andric
55349cc55cSDimitry Andric// Define a list of attributes that are not safe to pass through to HTML
560b57cec5SDimitry Andric// output if the input is untrusted.
570b57cec5SDimitry Andric//
58349cc55cSDimitry Andric// FIXME: This should be a list of attributes that _are_ safe.  When changing
59349cc55cSDimitry Andric// this change, don't forget to change the default in the TableGen backend.
600b57cec5SDimitry Andricclass Attribute<string spelling> {
610b57cec5SDimitry Andric  string Spelling = spelling;
620b57cec5SDimitry Andric  bit IsSafeToPassThrough = 1;
630b57cec5SDimitry Andric}
640b57cec5SDimitry Andricclass EventHandlerContentAttribute<string spelling> : Attribute<spelling> {
650b57cec5SDimitry Andric  let IsSafeToPassThrough = 0;
660b57cec5SDimitry Andric}
670b57cec5SDimitry Andric
68