/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
lib/html/data.js
1 277 строк
29 KB
Alexander Akait
feat(css): safe CSS minify transforms, measured against the engine (#21588)
03 авг 2026, 14:58
Не верифицирован
03 авг 2026, 14:58
f2462c2
Код
Авторство
О чём код?
/* MIT License http://www.opensource.org/licenses/mit-license.php Author sheo13666q @sheo13666q */ "use strict"; // GENERATED by tooling/generate-html-data.js — do not edit. // cspell:ignore advasoft altglyph altglyphdef altglyphitem animatecolor animatemotion animatetransform arcrole aswedit attributename attributetype basefrequency baseprofile bgsound calcmode clippathunits diffuseconstant fedropshadow filterunits glyphref gradienttransform gradientunits hotjava hotmetal kernelmatrix kernelunitlength keypoints keysplines keytimes limitingconeangle markerheight markerwidth maskcontentunits maskunits metrius mtext numoctaves pathlength patterncontentunits patterntransform patternunits pointsatx pointsaty pointsatz preservealpha primitiveunits refx refy repeatcount repeatdur requiredextensions requiredfeatures silmaril softquad specularconstant specularexponent startoffset stddeviation stitchtiles surfacescale systemlanguage tablevalues targetx targety textlength viewbox viewtarget webtechs xchannelselector ychannelselector // Reflected-attribute tables from webref's extraction of the HTML IDL (see tooling/generate-html-data.js); everything else is the // generator's SUPPLEMENT, which carries the spec facts no dataset states. /** * §13.1.2.4: the elements a `<p>` end tag may be omitted in front of. * @type {Set<string>} */ const P_FOLLOWED_BY = new Set([ "address", "article", "aside", "blockquote", "details", "div", "dl", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "main", "menu", "nav", "ol", "p", "pre", "section", "table", "ul" ]); /** * §13.1.2.4: the element names whose end tag may be omitted when the next * sibling is one of the mapped names. `<html>`, `<head>` and `<body>` are * deliberately absent — their end tags are omissible too, but non-browser * consumers routinely mis-parse a document that is missing them. * @type {Map<string, Set<string>>} */ const OPTIONAL_END_TAG_FOLLOWERS = new Map([ ["li", new Set(["li"])], ["dt", new Set(["dt", "dd"])], ["dd", new Set(["dd", "dt"])], ["rt", new Set(["rt", "rp"])], ["rp", new Set(["rt", "rp"])], ["optgroup", new Set(["optgroup"])], ["option", new Set(["option", "optgroup"])], ["thead", new Set(["tbody", "tfoot"])], ["tbody", new Set(["tbody", "tfoot"])], ["tfoot", new Set()], ["tr", new Set(["tr"])], ["td", new Set(["td", "th"])], ["th", new Set(["td", "th"])], ["p", P_FOLLOWED_BY] ]); /** * §13.1.2.4: the elements whose end tag may be omitted unless ASCII whitespace * or a comment follows. A different condition from the follower-set rule above: * what closes these is the insertion mode, whatever the next element is, so only * a node that would move inside them keeps the tag. * @type {Set<string>} */ const OPTIONAL_END_TAG_UNLESS_TRAILING_NODE = new Set(["caption", "colgroup"]); /** * The subset of `OPTIONAL_END_TAG_FOLLOWERS` that may also drop the end tag with * nothing left in the parent. `<dt>` and `<thead>` are absent: the spec gives * them no such clause. * @type {Set<string>} */ const OPTIONAL_END_TAG_AT_END = new Set([ "li", "dd", "rt", "rp", "optgroup", "option", "tbody", "tfoot", "tr", "td", "th", "p" ]); /** * §13.1.2.4: a trailing `</p>` stays inside these, whose content model would * otherwise absorb what follows. * @type {Set<string>} */ const P_KEEPS_END_TAG_IN = new Set([ "a", "audio", "del", "ins", "map", "noscript", "video" ]); /** * §2.4.2 boolean attributes, mapped to the elements each one is boolean *on* * (`null` = a global attribute). Elsewhere the same name is an ordinary * attribute whose value a script may read. * @type {Map<string, Set<string> | null>} */ const BOOLEAN_ATTRIBUTES = new Map([ ["allowfullscreen", new Set(["iframe"])], ["alpha", new Set(["input"])], ["async", new Set(["script"])], ["autofocus", null], ["autoplay", new Set(["audio", "video"])], ["checked", new Set(["input"])], ["compact", new Set(["dl", "menu", "ol", "ul"])], ["controls", new Set(["audio", "img", "video"])], ["declare", new Set(["object"])], ["default", new Set(["track"])], ["defer", new Set(["script"])], [ "disabled", new Set([ "button", "fieldset", "input", "link", "optgroup", "option", "select", "textarea" ]) ], ["formnovalidate", new Set(["button", "input"])], ["headingreset", null], ["inert", null], ["ismap", new Set(["img"])], ["itemscope", null], ["loop", new Set(["audio", "video"])], ["multiple", new Set(["input", "select"])], ["muted", new Set(["audio", "video"])], ["nohref", new Set(["area"])], ["nomodule", new Set(["script"])], ["noshade", new Set(["hr"])], ["novalidate", new Set(["form"])], ["nowrap", new Set(["td", "th"])], ["open", new Set(["details", "dialog"])], ["playsinline", new Set(["video"])], ["readonly", new Set(["input", "textarea"])], ["required", new Set(["input", "select", "textarea"])], ["reversed", new Set(["ol"])], ["selected", new Set(["option"])], ["shadowrootclonable", new Set(["template"])], ["shadowrootdelegatesfocus", new Set(["template"])], ["shadowrootserializable", new Set(["template"])] ]); /** * The attributes whose value is a srcset (WHATWG "parse a srcset attribute"). * @type {Set<string>} */ const SRCSET_ATTRIBUTES = new Set(["srcset", "imagesrcset"]); /** * The attributes whose value is an ASCII-whitespace-separated token list, mapped * to the elements they are one on (`null` = a global attribute), so collapsing * the separators keeps the set the DOM reads. The element matters: `for` is a * token list on `<output>` but one id on `<label>`, and an id may contain a * space; `sizes` is one on `<link>` but a source-size list on `<img>`. * @type {Map<string, Set<string> | null>} */ const TOKEN_LIST_ATTRIBUTES = new Map([ ["accesskey", null], ["blocking", new Set(["link", "script", "style"])], ["class", null], ["for", new Set(["output"])], ["headers", new Set(["td", "th"])], ["itemprop", null], ["itemref", null], ["itemtype", null], ["part", null], ["ping", new Set(["a", "area"])], ["rel", new Set(["a", "area", "form", "link"])], ["sandbox", new Set(["iframe"])], ["sizes", new Set(["link"])] ]); /** * Attributes parsed as a URL, mapped to the elements they are one on. The URL * parser strips leading and trailing C0 controls and spaces, so trimming the * ASCII whitespace among them resolves to the same URL. * @type {Map<string, Set<string> | null>} */ const URL_ATTRIBUTES = new Map([ ["action", new Set(["form"])], ["cite", new Set(["blockquote", "del", "ins", "q"])], ["codebase", new Set(["object"])], ["data", new Set(["object"])], ["formaction", new Set(["button", "input"])], ["href", new Set(["a", "area", "base", "link"])], ["longdesc", new Set(["iframe", "img"])], ["lowsrc", new Set(["img"])], ["manifest", new Set(["html"])], ["poster", new Set(["video"])], [ "src", new Set([ "audio", "embed", "iframe", "img", "input", "script", "source", "track", "video" ]) ] ]); /** * Attributes parsed with the integer rules, mapped to the elements they are one * on (`null` = a global attribute). Those rules skip leading whitespace and * stop at the first non-digit, so trimming and dropping leading zeros parse the * same. `width` / `height` are absent on `<td>` and `<table>`, where the * legacy dimension grammar also admits a percentage. * @type {Map<string, Set<string> | null>} */ const INTEGER_ATTRIBUTES = new Map([ ["cols", new Set(["textarea"])], ["colspan", new Set(["td", "th"])], ["headingoffset", null], [ "height", new Set([ "canvas", "embed", "iframe", "img", "input", "object", "source", "video" ]) ], ["hspace", new Set(["img", "object"])], ["maxlength", new Set(["input", "textarea"])], ["minlength", new Set(["input", "textarea"])], ["rows", new Set(["textarea"])], ["rowspan", new Set(["td", "th"])], ["size", new Set(["input", "select"])], ["span", new Set(["col", "colgroup"])], ["start", new Set(["ol"])], ["tabindex", null], ["value", new Set(["li"])], ["vspace", new Set(["img", "object"])], [ "width", new Set([ "canvas", "embed", "iframe", "img", "input", "object", "pre", "source", "video" ]) ] ]); /** * The subset of `INTEGER_ATTRIBUTES` parsed with the "rules for parsing * integers" rather than the non-negative ones — only those accept a `+` or * `-`, so elsewhere a signed value does not parse at all and has to stand. * @type {Set<string>} */ const SIGNED_INTEGER_ATTRIBUTES = new Set(["start", "tabindex", "value"]); /** * Attributes whose value is a comma-separated list, so the whitespace around * each comma and around the ends carries nothing. Whitespace *inside* an item is * never dropped: it belongs to the token `accept` keeps, separates numbers in * `coords`, and carries the media condition in `sizes`. * @type {Set<string>} */ const COMMA_LIST_ATTRIBUTES = new Set(["accept", "coords", "sizes"]); /** * §13.1.2 void elements: no end tag, and no children to close one over. * @type {Set<string>} */ const VOID = new Set([ "area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr" ]); /** * §13.2.4.2's "special" category — the elements the adoption agency and the scope tests treat as barriers. * @type {Set<string>} */ const SPECIAL = new Set([ "address", "applet", "area", "article", "aside", "base", "basefont", "bgsound", "blockquote", "body", "br", "button", "caption", "center", "col", "colgroup", "dd", "details", "dir", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "keygen", "li", "link", "listing", "main", "marquee", "menu", "meta", "nav", "noembed", "noframes", "noscript", "object", "ol", "p", "param", "plaintext", "pre", "script", "search", "section", "select", "source", "style", "summary", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "title", "tr", "track", "ul", "wbr", "xmp" ]); /** * §13.2.4.3 formatting elements: the ones reconstructed from the list of active formatting elements. * @type {Set<string>} */ const FORMATTING = new Set([ "a", "b", "big", "code", "em", "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u" ]); /** * The heading elements, whose start tag closes an open one. * @type {Set<string>} */ const HEADING = new Set(["h1", "h2", "h3", "h4", "h5", "h6"]); /** * §13.2.6.5 "adjust SVG tag name": lowercased source name -> the camelCased SVG name. * @type {Record<string, string>} */ const SVG_TAG_ADJUST = Object.assign(Object.create(null), { altglyph: "altGlyph", altglyphdef: "altGlyphDef", altglyphitem: "altGlyphItem", animatecolor: "animateColor", animatemotion: "animateMotion", animatetransform: "animateTransform", clippath: "clipPath", feblend: "feBlend", fecolormatrix: "feColorMatrix", fecomponenttransfer: "feComponentTransfer", fecomposite: "feComposite", feconvolvematrix: "feConvolveMatrix", fediffuselighting: "feDiffuseLighting", fedisplacementmap: "feDisplacementMap", fedistantlight: "feDistantLight", fedropshadow: "feDropShadow", feflood: "feFlood", fefunca: "feFuncA", fefuncb: "feFuncB", fefuncg: "feFuncG", fefuncr: "feFuncR", fegaussianblur: "feGaussianBlur", feimage: "feImage", femerge: "feMerge", femergenode: "feMergeNode", femorphology: "feMorphology", feoffset: "feOffset", fepointlight: "fePointLight", fespecularlighting: "feSpecularLighting", fespotlight: "feSpotLight", fetile: "feTile", feturbulence: "feTurbulence", foreignobject: "foreignObject", glyphref: "glyphRef", lineargradient: "linearGradient", radialgradient: "radialGradient", textpath: "textPath" }); /** * §13.2.6.1 "adjust SVG attributes": lowercased source name -> the camelCased SVG attribute. * @type {Record<string, string>} */ const SVG_ATTR_ADJUST = Object.assign(Object.create(null), { attributename: "attributeName", attributetype: "attributeType", basefrequency: "baseFrequency", baseprofile: "baseProfile", calcmode: "calcMode", clippathunits: "clipPathUnits", diffuseconstant: "diffuseConstant", edgemode: "edgeMode", filterunits: "filterUnits", glyphref: "glyphRef", gradienttransform: "gradientTransform", gradientunits: "gradientUnits", kernelmatrix: "kernelMatrix", kernelunitlength: "kernelUnitLength", keypoints: "keyPoints", keysplines: "keySplines", keytimes: "keyTimes", lengthadjust: "lengthAdjust", limitingconeangle: "limitingConeAngle", markerheight: "markerHeight", markerunits: "markerUnits", markerwidth: "markerWidth", maskcontentunits: "maskContentUnits", maskunits: "maskUnits", numoctaves: "numOctaves", pathlength: "pathLength", patterncontentunits: "patternContentUnits", patterntransform: "patternTransform", patternunits: "patternUnits", pointsatx: "pointsAtX", pointsaty: "pointsAtY", pointsatz: "pointsAtZ", preservealpha: "preserveAlpha", preserveaspectratio: "preserveAspectRatio", primitiveunits: "primitiveUnits", refx: "refX", refy: "refY", repeatcount: "repeatCount", repeatdur: "repeatDur", requiredextensions: "requiredExtensions", requiredfeatures: "requiredFeatures", specularconstant: "specularConstant", specularexponent: "specularExponent", spreadmethod: "spreadMethod", startoffset: "startOffset", stddeviation: "stdDeviation", stitchtiles: "stitchTiles", surfacescale: "surfaceScale", systemlanguage: "systemLanguage", tablevalues: "tableValues", targetx: "targetX", targety: "targetY", textlength: "textLength", viewbox: "viewBox", viewtarget: "viewTarget", xchannelselector: "xChannelSelector", ychannelselector: "yChannelSelector", zoomandpan: "zoomAndPan" }); /** * §13.2.6.1 "adjust foreign attributes": the attributes serialized with a namespace prefix. * @type {Record<string, string>} */ const FOREIGN_ATTR_NS = Object.assign(Object.create(null), { "xlink:actuate": "xlink actuate", "xlink:arcrole": "xlink arcrole", "xlink:href": "xlink href", "xlink:role": "xlink role", "xlink:show": "xlink show", "xlink:title": "xlink title", "xlink:type": "xlink type", "xml:lang": "xml lang", "xml:space": "xml space", xmlns: "xmlns", "xmlns:xlink": "xmlns xlink" }); /** * MathML text integration points (§13.2.6.5): HTML content resumes inside them. * @type {Set<string>} */ const MATHML_TEXT_INTEGRATION = new Set(["mi", "mo", "mn", "ms", "mtext"]); /** * The MathML elements an HTML breakout pops back to. * @type {Set<string>} */ const MATHML_SPECIAL = new Set([ "mi", "mo", "mn", "ms", "mtext", "annotation-xml" ]); /** * HTML integration points in SVG (§13.2.6.5). * @type {Set<string>} */ const SVG_SPECIAL = new Set(["foreignobject", "desc", "title"]); /** * §13.2.4.2 "the stack of open elements has an element in scope": the elements that stop the walk. * @type {Set<string>} */ const HTML_SCOPE = new Set([ "applet", "caption", "html", "table", "td", "th", "marquee", "object", "template" ]); /** * §13.2.6.4.7 "generate implied end tags": the elements popped without their end tag. * @type {Set<string>} */ const IMPLIED = new Set([ "dd", "dt", "li", "optgroup", "option", "p", "rb", "rp", "rt", "rtc" ]); /** * "generate all implied end tags thoroughly" — the wider list the table modes use. * @type {Set<string>} */ const IMPLIED_THOROUGH = new Set([ "caption", "colgroup", "dd", "dt", "li", "optgroup", "option", "p", "rb", "rp", "rt", "rtc", "tbody", "td", "tfoot", "th", "thead", "tr" ]); /** * "clear the stack back to a table context" stops here. * @type {Set<string>} */ const CLEAR_TABLE = new Set(["table", "template", "html"]); /** * "clear the stack back to a table body context" stops here. * @type {Set<string>} */ const CLEAR_TABLE_BODY = new Set([ "tbody", "tfoot", "thead", "template", "html" ]); /** * "clear the stack back to a table row context" stops here. * @type {Set<string>} */ const CLEAR_TABLE_ROW = new Set(["tr", "template", "html"]); /** * The table-scope barrier (§13.2.4.2 "has an element in table scope"). * @type {Set<string>} */ const TABLE_SCOPE_STOP = new Set(["html", "table", "template"]); /** * The elements "in table" text is fostered out of. * @type {Set<string>} */ const TABLE_CONTEXT = new Set(["table", "tbody", "tfoot", "thead", "tr"]); /** * The three row-group elements, interchangeable in the table modes. * @type {Set<string>} */ const TBODY_GROUP = new Set(["tbody", "tfoot", "thead"]); /** * The two cell elements. * @type {Set<string>} */ const TD_TH = new Set(["td", "th"]); /** * The cell elements plus their row, closed together. * @type {Set<string>} */ const TD_TH_TR = new Set(["td", "th", "tr"]); /** * The head elements "in body" re-dispatches to "in head". * @type {Set<string>} */ const STYLE_SCRIPT_TEMPLATE = new Set(["style", "script", "template"]); /** * The end tags "after head" / "before head" act on rather than ignore. * @type {Set<string>} */ const HEAD_BODY_HTML_BR = new Set(["head", "body", "html", "br"]); /** * The end tags "after body" acts on rather than ignores. * @type {Set<string>} */ const BODY_HTML_BR = new Set(["body", "html", "br"]); /** * Void elements "in head" inserts and immediately pops. * @type {Set<string>} */ const HEAD_VOID_ELEMENTS = new Set([ "base", "basefont", "bgsound", "link", "meta" ]); /** * The raw-text elements "in head" tokenizes as such. * @type {Set<string>} */ const NOFRAMES_STYLE_NOSCRIPT = new Set(["noframes", "style", "noscript"]); /** * "in head noscript" start tags handled by reprocessing in "in head". * @type {Set<string>} */ const IN_HEAD_NOSCRIPT_PASSTHROUGH = new Set([ "basefont", "bgsound", "link", "meta", "noframes", "style" ]); /** * The elements that belong in `<head>`. * @type {Set<string>} */ const HEAD_ELEMENTS = new Set([ "base", "basefont", "bgsound", "link", "meta", "noframes", "script", "style", "template", "title" ]); /** * Start tags "in body" closes an open `<p>` before inserting. * @type {Set<string>} */ const BLOCK_START = new Set([ "address", "article", "aside", "blockquote", "center", "details", "dialog", "dir", "div", "dl", "fieldset", "figcaption", "figure", "footer", "header", "hgroup", "main", "menu", "nav", "ol", "p", "search", "section", "summary", "ul" ]); /** * End tags "in body" closes a block for — `BLOCK_START` plus the elements with no start-tag clause of their own. * @type {Set<string>} */ const BLOCK_END = new Set([ "address", "article", "aside", "blockquote", "button", "center", "details", "dialog", "dir", "div", "dl", "fieldset", "figcaption", "figure", "footer", "header", "hgroup", "listing", "main", "menu", "nav", "ol", "pre", "search", "section", "summary", "ul" ]); /** * The three elements `</form>` and the block end tags share a close path with. * @type {Set<string>} */ const ADDRESS_DIV_P = new Set(["address", "div", "p"]); /** * The elements that push a marker onto the list of active formatting elements. * @type {Set<string>} */ const APPLET_MARQUEE_OBJECT = new Set(["applet", "marquee", "object"]); /** * Void start tags "in body" that reconstruct the active formatting elements first. * @type {Set<string>} */ const VOID_FORMATTING = new Set([ "area", "br", "embed", "img", "keygen", "wbr" ]); /** * Void start tags "in body" that do not reconstruct. * @type {Set<string>} */ const PARAM_SOURCE_TRACK = new Set(["param", "source", "track"]); /** * Table start tags "in body" ignores outside a table. * @type {Set<string>} */ const IGNORED_BODY_TABLE_STARTS = new Set([ "caption", "col", "colgroup", "frame", "head", "tbody", "td", "tfoot", "th", "thead", "tr" ]); /** * End tags "in table" ignores. * @type {Set<string>} */ const IN_TABLE_IGNORED_ENDS = new Set([ "body", "caption", "col", "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" ]); /** * Start tags "in caption" closes the caption for. * @type {Set<string>} */ const CAPTION_TABLE_STARTS = new Set([ "caption", "col", "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr" ]); /** * End tags "in caption" ignores. * @type {Set<string>} */ const CAPTION_IGNORED_ENDS = new Set([ "body", "col", "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" ]); /** * Start tags "in table body" closes the row group for. * @type {Set<string>} */ const TBODY_TRIGGER_STARTS = new Set([ "caption", "col", "colgroup", "tbody", "tfoot", "thead" ]); /** * End tags "in table body" ignores. * @type {Set<string>} */ const TBODY_IGNORED_ENDS = new Set([ "body", "caption", "col", "colgroup", "html", "td", "th", "tr" ]); /** * Start tags "in row" closes the row for. * @type {Set<string>} */ const ROW_TRIGGER_STARTS = new Set([ "caption", "col", "colgroup", "tbody", "tfoot", "thead", "tr" ]); /** * End tags "in row" ignores. * @type {Set<string>} */ const ROW_IGNORED_ENDS = new Set([ "body", "caption", "col", "colgroup", "html", "td", "th" ]); /** * End tags "in cell" ignores. * @type {Set<string>} */ const CELL_IGNORED_ENDS = new Set([ "body", "caption", "col", "colgroup", "html" ]); /** * Elements whose text is tokenized raw, so no character reference in it is decoded. * @type {Set<string>} */ const NO_DECODE_TEXT = new Set([ "script", "style", "xmp", "iframe", "noembed", "noframes", "plaintext" ]); /** * HTML start tags that break out of foreign (SVG/MathML) content. * @type {Set<string>} */ const FOREIGN_BREAKOUT = new Set([ "b", "big", "blockquote", "body", "br", "center", "code", "dd", "div", "dl", "dt", "em", "embed", "h1", "h2", "h3", "h4", "h5", "h6", "head", "hr", "i", "img", "li", "listing", "menu", "meta", "nobr", "ol", "p", "pre", "ruby", "s", "small", "span", "strong", "strike", "sub", "sup", "table", "tt", "u", "ul", "var" ]); /** * The `<font>` attributes that make it break out of foreign content. * @type {Set<string>} */ const FONT_BREAKOUT_ATTRS = new Set(["color", "face", "size"]); /** * Raw text / escapable raw text elements (§13.1.2) plus the other RAWTEXT/RCDATA/PLAINTEXT-tokenized ones. * @type {Set<string>} */ const RAW_TEXT_ELEMENTS = new Set([ "script", "style", "textarea", "title", "xmp", "iframe", "noembed", "noframes", "noscript", "plaintext" ]); /** * Public-id prefixes that force quirks mode (the "quirks mode" doctype table). * @type {string[]} */ const QUIRKY_PREFIXES = [ "+//silmaril//dtd html pro v0r11 19970101//", "-//as//dtd html 3.0 aswedit + extensions//", "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", "-//ietf//dtd html 2.0 level 1//", "-//ietf//dtd html 2.0 level 2//", "-//ietf//dtd html 2.0 strict level 1//", "-//ietf//dtd html 2.0 strict level 2//", "-//ietf//dtd html 2.0 strict//", "-//ietf//dtd html 2.0//", "-//ietf//dtd html 2.1e//", "-//ietf//dtd html 3.0//", "-//ietf//dtd html 3.2 final//", "-//ietf//dtd html 3.2//", "-//ietf//dtd html 3//", "-//ietf//dtd html level 0//", "-//ietf//dtd html level 1//", "-//ietf//dtd html level 2//", "-//ietf//dtd html level 3//", "-//ietf//dtd html strict level 0//", "-//ietf//dtd html strict level 1//", "-//ietf//dtd html strict level 2//", "-//ietf//dtd html strict level 3//", "-//ietf//dtd html strict//", "-//ietf//dtd html//", "-//metrius//dtd metrius presentational//", "-//microsoft//dtd internet explorer 2.0 html strict//", "-//microsoft//dtd internet explorer 2.0 html//", "-//microsoft//dtd internet explorer 2.0 tables//", "-//microsoft//dtd internet explorer 3.0 html strict//", "-//microsoft//dtd internet explorer 3.0 html//", "-//microsoft//dtd internet explorer 3.0 tables//", "-//netscape comm. corp.//dtd html//", "-//netscape comm. corp.//dtd strict html//", "-//o'reilly and associates//dtd html 2.0//", "-//o'reilly and associates//dtd html extended 1.0//", "-//o'reilly and associates//dtd html extended relaxed 1.0//", "-//sq//dtd html 2.0 hotmetal + extensions//", "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", "-//spyglass//dtd html 2.0 extended//", "-//sun microsystems corp.//dtd hotjava html//", "-//sun microsystems corp.//dtd hotjava strict html//", "-//w3c//dtd html 3 1995-03-24//", "-//w3c//dtd html 3.2 draft//", "-//w3c//dtd html 3.2 final//", "-//w3c//dtd html 3.2//", "-//w3c//dtd html 3.2s draft//", "-//w3c//dtd html 4.0 frameset//", "-//w3c//dtd html 4.0 transitional//", "-//w3c//dtd html experimental 19960712//", "-//w3c//dtd html experimental 970421//", "-//w3c//dtd w3 html//", "-//w3o//dtd w3 html 3.0//", "-//webtechs//dtd mozilla html 2.0//", "-//webtechs//dtd mozilla html//" ]; /** * Public ids that force quirks mode exactly. * @type {Set<string>} */ const QUIRKY_EXACT = new Set([ "-//w3o//dtd w3 html strict 3.0//en//", "-/w3c/dtd html 4.0 transitional/en", "html" ]); /** * Elements whose text children serialize literally, no escaping. `textarea` / `title` are escapable, so they are not here. * @type {Set<string>} */ const LITERAL_TEXT_PARENTS = new Set([ "script", "style", "xmp", "iframe", "noembed", "noframes", "plaintext" ]); /** * The only elements the printer may leave transparent when they lack a source tag: the parser re-implies them identically. Any other tag-less element (adoption-agency clone, reconstructed formatting element, renamed token) must be materialized or the DOM changes. * @type {Set<string>} */ const TRANSPARENT_IMPLIED_ELEMENTS = new Set([ "html", "head", "body", "colgroup", "tbody", "tr" ]); /** * Elements the parser strips one leading newline from, so a serialized body that still begins with one needs it re-added. * @type {Set<string>} */ const LEADING_NEWLINE_ELEMENTS = new Set(["pre", "textarea", "listing"]); /** * `<script>` bodies that are JSON: the two dedicated types plus any `+json` subtype (`application/ld+json`). * @type {Set<string>} */ const JSON_SCRIPT_TYPES = new Set([ "application/json", "importmap", "speculationrules" ]); module.exports.ADDRESS_DIV_P = ADDRESS_DIV_P; module.exports.APPLET_MARQUEE_OBJECT = APPLET_MARQUEE_OBJECT; module.exports.BLOCK_END = BLOCK_END; module.exports.BLOCK_START = BLOCK_START; module.exports.BODY_HTML_BR = BODY_HTML_BR; module.exports.BOOLEAN_ATTRIBUTES = BOOLEAN_ATTRIBUTES; module.exports.CAPTION_IGNORED_ENDS = CAPTION_IGNORED_ENDS; module.exports.CAPTION_TABLE_STARTS = CAPTION_TABLE_STARTS; module.exports.CELL_IGNORED_ENDS = CELL_IGNORED_ENDS; module.exports.CLEAR_TABLE = CLEAR_TABLE; module.exports.CLEAR_TABLE_BODY = CLEAR_TABLE_BODY; module.exports.CLEAR_TABLE_ROW = CLEAR_TABLE_ROW; module.exports.COMMA_LIST_ATTRIBUTES = COMMA_LIST_ATTRIBUTES; module.exports.FONT_BREAKOUT_ATTRS = FONT_BREAKOUT_ATTRS; module.exports.FOREIGN_ATTR_NS = FOREIGN_ATTR_NS; module.exports.FOREIGN_BREAKOUT = FOREIGN_BREAKOUT; module.exports.FORMATTING = FORMATTING; module.exports.HEADING = HEADING; module.exports.HEAD_BODY_HTML_BR = HEAD_BODY_HTML_BR; module.exports.HEAD_ELEMENTS = HEAD_ELEMENTS; module.exports.HEAD_VOID_ELEMENTS = HEAD_VOID_ELEMENTS; module.exports.HTML_SCOPE = HTML_SCOPE; module.exports.IGNORED_BODY_TABLE_STARTS = IGNORED_BODY_TABLE_STARTS; module.exports.IMPLIED = IMPLIED; module.exports.IMPLIED_THOROUGH = IMPLIED_THOROUGH; module.exports.INTEGER_ATTRIBUTES = INTEGER_ATTRIBUTES; module.exports.IN_HEAD_NOSCRIPT_PASSTHROUGH = IN_HEAD_NOSCRIPT_PASSTHROUGH; module.exports.IN_TABLE_IGNORED_ENDS = IN_TABLE_IGNORED_ENDS; module.exports.JSON_SCRIPT_TYPES = JSON_SCRIPT_TYPES; module.exports.LEADING_NEWLINE_ELEMENTS = LEADING_NEWLINE_ELEMENTS; module.exports.LITERAL_TEXT_PARENTS = LITERAL_TEXT_PARENTS; module.exports.MATHML_SPECIAL = MATHML_SPECIAL; module.exports.MATHML_TEXT_INTEGRATION = MATHML_TEXT_INTEGRATION; module.exports.NOFRAMES_STYLE_NOSCRIPT = NOFRAMES_STYLE_NOSCRIPT; module.exports.NO_DECODE_TEXT = NO_DECODE_TEXT; module.exports.OPTIONAL_END_TAG_AT_END = OPTIONAL_END_TAG_AT_END; module.exports.OPTIONAL_END_TAG_FOLLOWERS = OPTIONAL_END_TAG_FOLLOWERS; module.exports.OPTIONAL_END_TAG_UNLESS_TRAILING_NODE = OPTIONAL_END_TAG_UNLESS_TRAILING_NODE; module.exports.PARAM_SOURCE_TRACK = PARAM_SOURCE_TRACK; module.exports.P_FOLLOWED_BY = P_FOLLOWED_BY; module.exports.P_KEEPS_END_TAG_IN = P_KEEPS_END_TAG_IN; module.exports.QUIRKY_EXACT = QUIRKY_EXACT; module.exports.QUIRKY_PREFIXES = QUIRKY_PREFIXES; module.exports.RAW_TEXT_ELEMENTS = RAW_TEXT_ELEMENTS; module.exports.ROW_IGNORED_ENDS = ROW_IGNORED_ENDS; module.exports.ROW_TRIGGER_STARTS = ROW_TRIGGER_STARTS; module.exports.SIGNED_INTEGER_ATTRIBUTES = SIGNED_INTEGER_ATTRIBUTES; module.exports.SPECIAL = SPECIAL; module.exports.SRCSET_ATTRIBUTES = SRCSET_ATTRIBUTES; module.exports.STYLE_SCRIPT_TEMPLATE = STYLE_SCRIPT_TEMPLATE; module.exports.SVG_ATTR_ADJUST = SVG_ATTR_ADJUST; module.exports.SVG_SPECIAL = SVG_SPECIAL; module.exports.SVG_TAG_ADJUST = SVG_TAG_ADJUST; module.exports.TABLE_CONTEXT = TABLE_CONTEXT; module.exports.TABLE_SCOPE_STOP = TABLE_SCOPE_STOP; module.exports.TBODY_GROUP = TBODY_GROUP; module.exports.TBODY_IGNORED_ENDS = TBODY_IGNORED_ENDS; module.exports.TBODY_TRIGGER_STARTS = TBODY_TRIGGER_STARTS; module.exports.TD_TH = TD_TH; module.exports.TD_TH_TR = TD_TH_TR; module.exports.TOKEN_LIST_ATTRIBUTES = TOKEN_LIST_ATTRIBUTES; module.exports.TRANSPARENT_IMPLIED_ELEMENTS = TRANSPARENT_IMPLIED_ELEMENTS; module.exports.URL_ATTRIBUTES = URL_ATTRIBUTES; module.exports.VOID = VOID; module.exports.VOID_FORMATTING = VOID_FORMATTING;