⌈⌋ ⎇ branch:  Bitrhythm


Hex Artifact Content

Artifact e777ba3d1811d9def39b24ef463f152b6095a1d032301fd41df6a96b402dd231:


0000: 65 78 70 6f 72 74 0a 63 6f 6e 73 74 0a 20 20 2f  export.const.  /
0010: 2f 20 62 65 20 61 77 61 72 65 2c 20 69 6e 74 65  / be aware, inte
0020: 72 6e 61 6c 20 75 73 61 67 65 0a 20 20 2f 2f 20  rnal usage.  // 
0030: 41 54 54 45 4e 54 49 4f 4e 3a 20 70 72 65 66 69  ATTENTION: prefi
0040: 78 20 74 68 65 20 67 6c 6f 62 61 6c 20 64 79 6e  x the global dyn
0050: 61 6d 69 63 20 76 61 72 69 61 62 6c 65 73 20 77  amic variables w
0060: 69 74 68 20 60 5f 5f 60 0a 20 20 2f 2f 20 74 61  ith `__`.  // ta
0070: 67 73 20 69 6e 73 74 61 6e 63 65 73 20 63 61 63  gs instances cac
0080: 68 65 0a 20 20 5f 5f 54 41 47 53 5f 43 41 43 48  he.  __TAGS_CACH
0090: 45 20 3d 20 5b 5d 2c 0a 20 20 2f 2f 20 74 61 67  E = [],.  // tag
00a0: 73 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e  s implementation
00b0: 20 63 61 63 68 65 0a 20 20 5f 5f 54 41 47 5f 49   cache.  __TAG_I
00c0: 4d 50 4c 20 3d 20 7b 7d 2c 0a 20 20 59 49 45 4c  MPL = {},.  YIEL
00d0: 44 5f 54 41 47 20 3d 20 27 79 69 65 6c 64 27 2c  D_TAG = 'yield',
00e0: 0a 0a 20 20 2f 2a 2a 0a 20 20 20 2a 20 43 6f 6e  ..  /**.   * Con
00f0: 73 74 0a 20 20 20 2a 2f 0a 20 20 47 4c 4f 42 41  st.   */.  GLOBA
0100: 4c 5f 4d 49 58 49 4e 20 3d 20 27 5f 5f 67 6c 6f  L_MIXIN = '__glo
0110: 62 61 6c 5f 6d 69 78 69 6e 27 2c 0a 0a 20 20 2f  bal_mixin',..  /
0120: 2f 20 72 69 6f 74 20 73 70 65 63 69 66 69 63 20  / riot specific 
0130: 70 72 65 66 69 78 65 73 20 6f 72 20 61 74 74 72  prefixes or attr
0140: 69 62 75 74 65 73 0a 20 20 41 54 54 52 53 5f 50  ibutes.  ATTRS_P
0150: 52 45 46 49 58 20 3d 20 27 72 69 6f 74 2d 27 2c  REFIX = 'riot-',
0160: 0a 0a 20 20 2f 2f 20 52 69 6f 74 20 44 69 72 65  ..  // Riot Dire
0170: 63 74 69 76 65 73 0a 20 20 52 45 46 5f 44 49 52  ctives.  REF_DIR
0180: 45 43 54 49 56 45 53 20 3d 20 5b 27 72 65 66 27  ECTIVES = ['ref'
0190: 2c 20 27 64 61 74 61 2d 72 65 66 27 5d 2c 0a 20  , 'data-ref'],. 
01a0: 20 49 53 5f 44 49 52 45 43 54 49 56 45 20 3d 20   IS_DIRECTIVE = 
01b0: 27 64 61 74 61 2d 69 73 27 2c 0a 20 20 43 4f 4e  'data-is',.  CON
01c0: 44 49 54 49 4f 4e 41 4c 5f 44 49 52 45 43 54 49  DITIONAL_DIRECTI
01d0: 56 45 20 3d 20 27 69 66 27 2c 0a 20 20 4c 4f 4f  VE = 'if',.  LOO
01e0: 50 5f 44 49 52 45 43 54 49 56 45 20 3d 20 27 65  P_DIRECTIVE = 'e
01f0: 61 63 68 27 2c 0a 20 20 4c 4f 4f 50 5f 4e 4f 5f  ach',.  LOOP_NO_
0200: 52 45 4f 52 44 45 52 5f 44 49 52 45 43 54 49 56  REORDER_DIRECTIV
0210: 45 20 3d 20 27 6e 6f 2d 72 65 6f 72 64 65 72 27  E = 'no-reorder'
0220: 2c 0a 20 20 53 48 4f 57 5f 44 49 52 45 43 54 49  ,.  SHOW_DIRECTI
0230: 56 45 20 3d 20 27 73 68 6f 77 27 2c 0a 20 20 48  VE = 'show',.  H
0240: 49 44 45 5f 44 49 52 45 43 54 49 56 45 20 3d 20  IDE_DIRECTIVE = 
0250: 27 68 69 64 65 27 2c 0a 20 20 4b 45 59 5f 44 49  'hide',.  KEY_DI
0260: 52 45 43 54 49 56 45 20 3d 20 27 6b 65 79 27 2c  RECTIVE = 'key',
0270: 0a 20 20 52 49 4f 54 5f 45 56 45 4e 54 53 5f 4b  .  RIOT_EVENTS_K
0280: 45 59 20 3d 20 27 5f 5f 72 69 6f 74 2d 65 76 65  EY = '__riot-eve
0290: 6e 74 73 5f 5f 27 2c 0a 0a 20 20 2f 2f 20 66 6f  nts__',..  // fo
02a0: 72 20 74 79 70 65 6f 66 20 3d 3d 20 27 27 20 63  r typeof == '' c
02b0: 6f 6d 70 61 72 69 73 6f 6e 73 0a 20 20 54 5f 53  omparisons.  T_S
02c0: 54 52 49 4e 47 20 3d 20 27 73 74 72 69 6e 67 27  TRING = 'string'
02d0: 2c 0a 20 20 54 5f 4f 42 4a 45 43 54 20 3d 20 27  ,.  T_OBJECT = '
02e0: 6f 62 6a 65 63 74 27 2c 0a 20 20 54 5f 55 4e 44  object',.  T_UND
02f0: 45 46 20 20 3d 20 27 75 6e 64 65 66 69 6e 65 64  EF  = 'undefined
0300: 27 2c 0a 20 20 54 5f 46 55 4e 43 54 49 4f 4e 20  ',.  T_FUNCTION 
0310: 3d 20 27 66 75 6e 63 74 69 6f 6e 27 2c 0a 0a 20  = 'function',.. 
0320: 20 58 4c 49 4e 4b 5f 4e 53 20 3d 20 27 68 74 74   XLINK_NS = 'htt
0330: 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f 72 67 2f 31  p://www.w3.org/1
0340: 39 39 39 2f 78 6c 69 6e 6b 27 2c 0a 20 20 53 56  999/xlink',.  SV
0350: 47 5f 4e 53 20 3d 20 27 68 74 74 70 3a 2f 2f 77  G_NS = 'http://w
0360: 77 77 2e 77 33 2e 6f 72 67 2f 32 30 30 30 2f 73  ww.w3.org/2000/s
0370: 76 67 27 2c 0a 20 20 58 4c 49 4e 4b 5f 52 45 47  vg',.  XLINK_REG
0380: 45 58 20 3d 20 2f 5e 78 6c 69 6e 6b 3a 28 5c 77  EX = /^xlink:(\w
0390: 2b 29 2f 2c 0a 0a 20 20 57 49 4e 20 3d 20 74 79  +)/,..  WIN = ty
03a0: 70 65 6f 66 20 77 69 6e 64 6f 77 20 3d 3d 3d 20  peof window === 
03b0: 54 5f 55 4e 44 45 46 20 3f 20 2f 2a 20 69 73 74  T_UNDEF ? /* ist
03c0: 61 6e 62 75 6c 20 69 67 6e 6f 72 65 20 6e 65 78  anbul ignore nex
03d0: 74 20 2a 2f 20 75 6e 64 65 66 69 6e 65 64 20 3a  t */ undefined :
03e0: 20 77 69 6e 64 6f 77 2c 0a 0a 20 20 2f 2f 20 73   window,..  // s
03f0: 70 65 63 69 61 6c 20 6e 61 74 69 76 65 20 74 61  pecial native ta
0400: 67 73 20 74 68 61 74 20 63 61 6e 6e 6f 74 20 62  gs that cannot b
0410: 65 20 74 72 65 61 74 65 64 20 6c 69 6b 65 20 74  e treated like t
0420: 68 65 20 6f 74 68 65 72 73 0a 20 20 52 45 5f 53  he others.  RE_S
0430: 50 45 43 49 41 4c 5f 54 41 47 53 20 3d 20 2f 5e  PECIAL_TAGS = /^
0440: 28 3f 3a 74 28 3f 3a 62 6f 64 79 7c 68 65 61 64  (?:t(?:body|head
0450: 7c 66 6f 6f 74 7c 5b 72 68 64 5d 29 7c 63 61 70  |foot|[rhd])|cap
0460: 74 69 6f 6e 7c 63 6f 6c 28 3f 3a 67 72 6f 75 70  tion|col(?:group
0470: 29 3f 7c 6f 70 74 28 3f 3a 69 6f 6e 7c 67 72 6f  )?|opt(?:ion|gro
0480: 75 70 29 29 24 2f 2c 0a 20 20 52 45 5f 53 50 45  up))$/,.  RE_SPE
0490: 43 49 41 4c 5f 54 41 47 53 5f 4e 4f 5f 4f 50 54  CIAL_TAGS_NO_OPT
04a0: 49 4f 4e 20 3d 20 2f 5e 28 3f 3a 74 28 3f 3a 62  ION = /^(?:t(?:b
04b0: 6f 64 79 7c 68 65 61 64 7c 66 6f 6f 74 7c 5b 72  ody|head|foot|[r
04c0: 68 64 5d 29 7c 63 61 70 74 69 6f 6e 7c 63 6f 6c  hd])|caption|col
04d0: 28 3f 3a 67 72 6f 75 70 29 3f 29 24 2f 2c 0a 20  (?:group)?)$/,. 
04e0: 20 52 45 5f 45 56 45 4e 54 53 5f 50 52 45 46 49   RE_EVENTS_PREFI
04f0: 58 20 3d 20 2f 5e 6f 6e 2f 2c 0a 20 20 52 45 5f  X = /^on/,.  RE_
0500: 48 54 4d 4c 5f 41 54 54 52 53 20 3d 20 2f 28 5b  HTML_ATTRS = /([
0510: 2d 5c 77 5d 2b 29 20 3f 3d 20 3f 28 3f 3a 22 28  -\w]+) ?= ?(?:"(
0520: 5b 5e 22 5d 2a 29 7c 27 28 5b 5e 27 5d 2a 29 7c  [^"]*)|'([^']*)|
0530: 28 7b 5b 5e 7d 5d 2a 7d 29 29 2f 67 2c 0a 20 20  ({[^}]*}))/g,.  
0540: 2f 2f 20 73 6f 6d 65 20 44 4f 4d 20 61 74 74 72  // some DOM attr
0550: 69 62 75 74 65 73 20 6d 75 73 74 20 62 65 20 6e  ibutes must be n
0560: 6f 72 6d 61 6c 69 7a 65 64 0a 20 20 43 41 53 45  ormalized.  CASE
0570: 5f 53 45 4e 53 49 54 49 56 45 5f 41 54 54 52 49  _SENSITIVE_ATTRI
0580: 42 55 54 45 53 20 3d 20 7b 0a 20 20 20 20 27 76  BUTES = {.    'v
0590: 69 65 77 62 6f 78 27 3a 20 27 76 69 65 77 42 6f  iewbox': 'viewBo
05a0: 78 27 2c 0a 20 20 20 20 27 70 72 65 73 65 72 76  x',.    'preserv
05b0: 65 61 73 70 65 63 74 72 61 74 69 6f 27 3a 20 27  easpectratio': '
05c0: 70 72 65 73 65 72 76 65 41 73 70 65 63 74 52 61  preserveAspectRa
05d0: 74 69 6f 27 0a 20 20 7d 2c 0a 20 20 2f 2a 2a 0a  tio'.  },.  /**.
05e0: 20 20 20 2a 20 4d 61 74 63 68 65 73 20 62 6f 6f     * Matches boo
05f0: 6c 65 61 6e 20 48 54 4d 4c 20 61 74 74 72 69 62  lean HTML attrib
0600: 75 74 65 73 20 69 6e 20 74 68 65 20 72 69 6f 74  utes in the riot
0610: 20 74 61 67 20 64 65 66 69 6e 69 74 69 6f 6e 2e   tag definition.
0620: 0a 20 20 20 2a 20 57 69 74 68 20 61 20 6c 6f 6e  .   * With a lon
0630: 67 20 6c 69 73 74 20 6c 69 6b 65 20 74 68 69 73  g list like this
0640: 2c 20 61 20 72 65 67 65 78 20 69 73 20 66 61 73  , a regex is fas
0650: 74 65 72 20 74 68 61 6e 20 60 5b 5d 2e 69 6e 64  ter than `[].ind
0660: 65 78 4f 66 60 20 69 6e 20 6d 6f 73 74 20 62 72  exOf` in most br
0670: 6f 77 73 65 72 73 2e 0a 20 20 20 2a 20 40 63 6f  owsers..   * @co
0680: 6e 73 74 20 7b 52 65 67 45 78 70 7d 0a 20 20 20  nst {RegExp}.   
0690: 2a 20 40 73 65 65 20 5b 61 74 74 72 69 62 75 74  * @see [attribut
06a0: 65 73 2e 6d 64 5d 28 68 74 74 70 73 3a 2f 2f 67  es.md](https://g
06b0: 69 74 68 75 62 2e 63 6f 6d 2f 72 69 6f 74 2f 63  ithub.com/riot/c
06c0: 6f 6d 70 69 6c 65 72 2f 62 6c 6f 62 2f 64 65 76  ompiler/blob/dev
06d0: 2f 64 6f 63 2f 61 74 74 72 69 62 75 74 65 73 2e  /doc/attributes.
06e0: 6d 64 29 0a 20 20 20 2a 2f 0a 20 20 52 45 5f 42  md).   */.  RE_B
06f0: 4f 4f 4c 5f 41 54 54 52 53 20 3d 20 2f 5e 28 3f  OOL_ATTRS = /^(?
0700: 3a 64 69 73 61 62 6c 65 64 7c 63 68 65 63 6b 65  :disabled|checke
0710: 64 7c 72 65 61 64 6f 6e 6c 79 7c 72 65 71 75 69  d|readonly|requi
0720: 72 65 64 7c 61 6c 6c 6f 77 66 75 6c 6c 73 63 72  red|allowfullscr
0730: 65 65 6e 7c 61 75 74 6f 28 3f 3a 66 6f 63 75 73  een|auto(?:focus
0740: 7c 70 6c 61 79 29 7c 63 6f 6d 70 61 63 74 7c 63  |play)|compact|c
0750: 6f 6e 74 72 6f 6c 73 7c 64 65 66 61 75 6c 74 7c  ontrols|default|
0760: 66 6f 72 6d 6e 6f 76 61 6c 69 64 61 74 65 7c 68  formnovalidate|h
0770: 69 64 64 65 6e 7c 69 73 6d 61 70 7c 69 74 65 6d  idden|ismap|item
0780: 73 63 6f 70 65 7c 6c 6f 6f 70 7c 6d 75 6c 74 69  scope|loop|multi
0790: 70 6c 65 7c 6d 75 74 65 64 7c 6e 6f 28 3f 3a 72  ple|muted|no(?:r
07a0: 65 73 69 7a 65 7c 73 68 61 64 65 7c 76 61 6c 69  esize|shade|vali
07b0: 64 61 74 65 7c 77 72 61 70 29 3f 7c 6f 70 65 6e  date|wrap)?|open
07c0: 7c 72 65 76 65 72 73 65 64 7c 73 65 61 6d 6c 65  |reversed|seamle
07d0: 73 73 7c 73 65 6c 65 63 74 65 64 7c 73 6f 72 74  ss|selected|sort
07e0: 61 62 6c 65 7c 74 72 75 65 73 70 65 65 64 7c 74  able|truespeed|t
07f0: 79 70 65 6d 75 73 74 6d 61 74 63 68 29 24 2f 2c  ypemustmatch)$/,
0800: 0a 20 20 2f 2f 20 76 65 72 73 69 6f 6e 23 20 66  .  // version# f
0810: 6f 72 20 49 45 20 38 2d 31 31 2c 20 30 20 66 6f  or IE 8-11, 0 fo
0820: 72 20 6f 74 68 65 72 73 0a 20 20 49 45 5f 56 45  r others.  IE_VE
0830: 52 53 49 4f 4e 20 3d 20 28 57 49 4e 20 26 26 20  RSION = (WIN && 
0840: 57 49 4e 2e 64 6f 63 75 6d 65 6e 74 20 7c 7c 20  WIN.document || 
0850: 2f 2a 20 69 73 74 61 6e 62 75 6c 20 69 67 6e 6f  /* istanbul igno
0860: 72 65 20 6e 65 78 74 20 2a 2f 20 7b 7d 29 2e 64  re next */ {}).d
0870: 6f 63 75 6d 65 6e 74 4d 6f 64 65 20 7c 20 30 0a  ocumentMode | 0.