|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- 'use strict';
-
- const NS = (exports.NAMESPACES = {
- HTML: 'http://www.w3.org/1999/xhtml',
- MATHML: 'http://www.w3.org/1998/Math/MathML',
- SVG: 'http://www.w3.org/2000/svg',
- XLINK: 'http://www.w3.org/1999/xlink',
- XML: 'http://www.w3.org/XML/1998/namespace',
- XMLNS: 'http://www.w3.org/2000/xmlns/'
- });
-
- exports.ATTRS = {
- TYPE: 'type',
- ACTION: 'action',
- ENCODING: 'encoding',
- PROMPT: 'prompt',
- NAME: 'name',
- COLOR: 'color',
- FACE: 'face',
- SIZE: 'size'
- };
-
- exports.DOCUMENT_MODE = {
- NO_QUIRKS: 'no-quirks',
- QUIRKS: 'quirks',
- LIMITED_QUIRKS: 'limited-quirks'
- };
-
- const $ = (exports.TAG_NAMES = {
- A: 'a',
- ADDRESS: 'address',
- ANNOTATION_XML: 'annotation-xml',
- APPLET: 'applet',
- AREA: 'area',
- ARTICLE: 'article',
- ASIDE: 'aside',
-
- B: 'b',
- BASE: 'base',
- BASEFONT: 'basefont',
- BGSOUND: 'bgsound',
- BIG: 'big',
- BLOCKQUOTE: 'blockquote',
- BODY: 'body',
- BR: 'br',
- BUTTON: 'button',
-
- CAPTION: 'caption',
- CENTER: 'center',
- CODE: 'code',
- COL: 'col',
- COLGROUP: 'colgroup',
-
- DD: 'dd',
- DESC: 'desc',
- DETAILS: 'details',
- DIALOG: 'dialog',
- DIR: 'dir',
- DIV: 'div',
- DL: 'dl',
- DT: 'dt',
-
- EM: 'em',
- EMBED: 'embed',
-
- FIELDSET: 'fieldset',
- FIGCAPTION: 'figcaption',
- FIGURE: 'figure',
- FONT: 'font',
- FOOTER: 'footer',
- FOREIGN_OBJECT: 'foreignObject',
- FORM: 'form',
- FRAME: 'frame',
- FRAMESET: 'frameset',
-
- H1: 'h1',
- H2: 'h2',
- H3: 'h3',
- H4: 'h4',
- H5: 'h5',
- H6: 'h6',
- HEAD: 'head',
- HEADER: 'header',
- HGROUP: 'hgroup',
- HR: 'hr',
- HTML: 'html',
-
- I: 'i',
- IMG: 'img',
- IMAGE: 'image',
- INPUT: 'input',
- IFRAME: 'iframe',
-
- KEYGEN: 'keygen',
-
- LABEL: 'label',
- LI: 'li',
- LINK: 'link',
- LISTING: 'listing',
-
- MAIN: 'main',
- MALIGNMARK: 'malignmark',
- MARQUEE: 'marquee',
- MATH: 'math',
- MENU: 'menu',
- META: 'meta',
- MGLYPH: 'mglyph',
- MI: 'mi',
- MO: 'mo',
- MN: 'mn',
- MS: 'ms',
- MTEXT: 'mtext',
-
- NAV: 'nav',
- NOBR: 'nobr',
- NOFRAMES: 'noframes',
- NOEMBED: 'noembed',
- NOSCRIPT: 'noscript',
-
- OBJECT: 'object',
- OL: 'ol',
- OPTGROUP: 'optgroup',
- OPTION: 'option',
-
- P: 'p',
- PARAM: 'param',
- PLAINTEXT: 'plaintext',
- PRE: 'pre',
-
- RB: 'rb',
- RP: 'rp',
- RT: 'rt',
- RTC: 'rtc',
- RUBY: 'ruby',
-
- S: 's',
- SCRIPT: 'script',
- SECTION: 'section',
- SELECT: 'select',
- SOURCE: 'source',
- SMALL: 'small',
- SPAN: 'span',
- STRIKE: 'strike',
- STRONG: 'strong',
- STYLE: 'style',
- SUB: 'sub',
- SUMMARY: 'summary',
- SUP: 'sup',
-
- TABLE: 'table',
- TBODY: 'tbody',
- TEMPLATE: 'template',
- TEXTAREA: 'textarea',
- TFOOT: 'tfoot',
- TD: 'td',
- TH: 'th',
- THEAD: 'thead',
- TITLE: 'title',
- TR: 'tr',
- TRACK: 'track',
- TT: 'tt',
-
- U: 'u',
- UL: 'ul',
-
- SVG: 'svg',
-
- VAR: 'var',
-
- WBR: 'wbr',
-
- XMP: 'xmp'
- });
-
- exports.SPECIAL_ELEMENTS = {
- [NS.HTML]: {
- [$.ADDRESS]: true,
- [$.APPLET]: true,
- [$.AREA]: true,
- [$.ARTICLE]: true,
- [$.ASIDE]: true,
- [$.BASE]: true,
- [$.BASEFONT]: true,
- [$.BGSOUND]: true,
- [$.BLOCKQUOTE]: true,
- [$.BODY]: true,
- [$.BR]: true,
- [$.BUTTON]: true,
- [$.CAPTION]: true,
- [$.CENTER]: true,
- [$.COL]: true,
- [$.COLGROUP]: true,
- [$.DD]: true,
- [$.DETAILS]: true,
- [$.DIR]: true,
- [$.DIV]: true,
- [$.DL]: true,
- [$.DT]: true,
- [$.EMBED]: true,
- [$.FIELDSET]: true,
- [$.FIGCAPTION]: true,
- [$.FIGURE]: true,
- [$.FOOTER]: true,
- [$.FORM]: true,
- [$.FRAME]: true,
- [$.FRAMESET]: true,
- [$.H1]: true,
- [$.H2]: true,
- [$.H3]: true,
- [$.H4]: true,
- [$.H5]: true,
- [$.H6]: true,
- [$.HEAD]: true,
- [$.HEADER]: true,
- [$.HGROUP]: true,
- [$.HR]: true,
- [$.HTML]: true,
- [$.IFRAME]: true,
- [$.IMG]: true,
- [$.INPUT]: true,
- [$.LI]: true,
- [$.LINK]: true,
- [$.LISTING]: true,
- [$.MAIN]: true,
- [$.MARQUEE]: true,
- [$.MENU]: true,
- [$.META]: true,
- [$.NAV]: true,
- [$.NOEMBED]: true,
- [$.NOFRAMES]: true,
- [$.NOSCRIPT]: true,
- [$.OBJECT]: true,
- [$.OL]: true,
- [$.P]: true,
- [$.PARAM]: true,
- [$.PLAINTEXT]: true,
- [$.PRE]: true,
- [$.SCRIPT]: true,
- [$.SECTION]: true,
- [$.SELECT]: true,
- [$.SOURCE]: true,
- [$.STYLE]: true,
- [$.SUMMARY]: true,
- [$.TABLE]: true,
- [$.TBODY]: true,
- [$.TD]: true,
- [$.TEMPLATE]: true,
- [$.TEXTAREA]: true,
- [$.TFOOT]: true,
- [$.TH]: true,
- [$.THEAD]: true,
- [$.TITLE]: true,
- [$.TR]: true,
- [$.TRACK]: true,
- [$.UL]: true,
- [$.WBR]: true,
- [$.XMP]: true
- },
- [NS.MATHML]: {
- [$.MI]: true,
- [$.MO]: true,
- [$.MN]: true,
- [$.MS]: true,
- [$.MTEXT]: true,
- [$.ANNOTATION_XML]: true
- },
- [NS.SVG]: {
- [$.TITLE]: true,
- [$.FOREIGN_OBJECT]: true,
- [$.DESC]: true
- }
- };
|