123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- 'use strict';
- var 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'
- };
- var $ = 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',
- MENUITEM: 'menuitem',
- 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'
- };
- var SPECIAL_ELEMENTS = exports.SPECIAL_ELEMENTS = Object.create(null);
- SPECIAL_ELEMENTS[NS.HTML] = Object.create(null);
- SPECIAL_ELEMENTS[NS.HTML][$.ADDRESS] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.APPLET] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.AREA] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.ARTICLE] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.ASIDE] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.BASE] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.BASEFONT] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.BGSOUND] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.BLOCKQUOTE] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.BODY] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.BR] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.BUTTON] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.CAPTION] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.CENTER] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.COL] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.COLGROUP] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.DD] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.DETAILS] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.DIR] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.DIV] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.DL] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.DT] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.EMBED] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.FIELDSET] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.FIGCAPTION] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.FIGURE] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.FOOTER] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.FORM] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.FRAME] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.FRAMESET] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.H1] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.H2] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.H3] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.H4] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.H5] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.H6] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.HEAD] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.HEADER] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.HGROUP] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.HR] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.HTML] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.IFRAME] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.IMG] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.INPUT] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.LI] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.LINK] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.LISTING] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.MAIN] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.MARQUEE] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.MENU] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.META] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.NAV] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.NOEMBED] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.NOFRAMES] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.NOSCRIPT] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.OBJECT] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.OL] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.P] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.PARAM] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.PLAINTEXT] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.PRE] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.SCRIPT] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.SECTION] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.SELECT] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.SOURCE] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.STYLE] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.SUMMARY] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.TABLE] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.TBODY] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.TD] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.TEMPLATE] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.TEXTAREA] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.TFOOT] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.TH] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.THEAD] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.TITLE] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.TR] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.TRACK] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.UL] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.WBR] = true;
- SPECIAL_ELEMENTS[NS.HTML][$.XMP] = true;
- SPECIAL_ELEMENTS[NS.MATHML] = Object.create(null);
- SPECIAL_ELEMENTS[NS.MATHML][$.MI] = true;
- SPECIAL_ELEMENTS[NS.MATHML][$.MO] = true;
- SPECIAL_ELEMENTS[NS.MATHML][$.MN] = true;
- SPECIAL_ELEMENTS[NS.MATHML][$.MS] = true;
- SPECIAL_ELEMENTS[NS.MATHML][$.MTEXT] = true;
- SPECIAL_ELEMENTS[NS.MATHML][$.ANNOTATION_XML] = true;
- SPECIAL_ELEMENTS[NS.SVG] = Object.create(null);
- SPECIAL_ELEMENTS[NS.SVG][$.TITLE] = true;
- SPECIAL_ELEMENTS[NS.SVG][$.FOREIGN_OBJECT] = true;
- SPECIAL_ELEMENTS[NS.SVG][$.DESC] = true;
|