1class Tag<string spelling> { 2 string Spelling = spelling; 3 bit EndTagOptional = 0; 4 bit EndTagForbidden = 0; 5} 6 7def Em : Tag<"em">; 8def Strong : Tag<"strong">; 9def Tt : Tag<"tt">; 10def I : Tag<"i">; 11def B : Tag<"b">; 12def Big : Tag<"big">; 13def Small : Tag<"small">; 14def Strike : Tag<"strike">; 15def S : Tag<"s">; 16def U : Tag<"u">; 17def Font : Tag<"font">; 18def A : Tag<"a">; 19def Hr : Tag<"hr"> { let EndTagForbidden = 1; } 20def Div : Tag<"div">; 21def Span : Tag<"span">; 22def H1 : Tag<"h1">; 23def H2 : Tag<"h2">; 24def H3 : Tag<"h3">; 25def H4 : Tag<"h4">; 26def H5 : Tag<"h5">; 27def H6 : Tag<"h6">; 28def Code : Tag<"code">; 29def Blockquote : Tag<"blockquote">; 30def Sub : Tag<"sub">; 31def Sup : Tag<"sup">; 32def Img : Tag<"img"> { let EndTagForbidden = 1; } 33def P : Tag<"p"> { let EndTagOptional = 1; } 34def Br : Tag<"br"> { let EndTagForbidden = 1; } 35def Pre : Tag<"pre">; 36def Ins : Tag<"ins">; 37def Del : Tag<"del">; 38def Ul : Tag<"ul">; 39def Ol : Tag<"ol">; 40def Li : Tag<"li"> { let EndTagOptional = 1; } 41def Dl : Tag<"dl">; 42def Dt : Tag<"dt"> { let EndTagOptional = 1; } 43def Dd : Tag<"dd"> { let EndTagOptional = 1; } 44def Table : Tag<"table">; 45def Caption : Tag<"caption">; 46def Thead : Tag<"thead"> { let EndTagOptional = 1; } 47def Tfoot : Tag<"tfoot"> { let EndTagOptional = 1; } 48def Tbody : Tag<"tbody"> { let EndTagOptional = 1; } 49def Colgroup : Tag<"colgroup"> { let EndTagOptional = 1; } 50def Col : Tag<"col"> { let EndTagForbidden = 1; } 51def Tr : Tag<"tr"> { let EndTagOptional = 1; } 52def Th : Tag<"th"> { let EndTagOptional = 1; } 53def Td : Tag<"td"> { let EndTagOptional = 1; } 54 55// Define a list of attributes that are not safe to pass through to HTML 56// output if the input is untrusted. 57// 58// FIXME: This should be a list of attributes that _are_ safe. When changing 59// this change, don't forget to change the default in the TableGen backend. 60class Attribute<string spelling> { 61 string Spelling = spelling; 62 bit IsSafeToPassThrough = 1; 63} 64class EventHandlerContentAttribute<string spelling> : Attribute<spelling> { 65 let IsSafeToPassThrough = 0; 66} 67 68