cloudstructs 0.9.19 → 0.9.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/.jsii +3 -3
  2. package/assets/slack-textract/detect.lambda/index.js +21 -10
  3. package/lib/codecommit-mirror/index.js +2 -2
  4. package/lib/dmarc/index.js +1 -1
  5. package/lib/ecs-service-roller/index.js +2 -2
  6. package/lib/email-receiver/receiver.js +1 -1
  7. package/lib/mjml-template/index.js +1 -1
  8. package/lib/saml-identity-provider/index.js +2 -2
  9. package/lib/slack-app/manifest.js +1 -1
  10. package/lib/slack-app/slack-app.js +2 -2
  11. package/lib/slack-events/index.js +1 -1
  12. package/lib/slack-textract/index.js +1 -1
  13. package/lib/ssl-server-test/index.js +1 -1
  14. package/lib/state-machine-cr-provider/index.js +1 -1
  15. package/lib/static-website/index.js +1 -1
  16. package/lib/toolkit-cleaner/index.js +1 -1
  17. package/lib/url-shortener/index.js +1 -1
  18. package/node_modules/@babel/runtime/helpers/esm/superPropGet.js +4 -4
  19. package/node_modules/@babel/runtime/helpers/esm/superPropSet.js +2 -2
  20. package/node_modules/@babel/runtime/helpers/superPropGet.js +4 -4
  21. package/node_modules/@babel/runtime/helpers/superPropSet.js +2 -2
  22. package/node_modules/@babel/runtime/package.json +1 -1
  23. package/node_modules/@slack/logger/node_modules/@types/node/README.md +1 -1
  24. package/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +2 -2
  25. package/node_modules/@slack/logger/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  26. package/node_modules/@slack/logger/node_modules/@types/node/compatibility/index.d.ts +9 -0
  27. package/node_modules/@slack/logger/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  28. package/node_modules/@slack/logger/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  29. package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +10 -9
  30. package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +2 -2
  31. package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +15 -4
  32. package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +1 -1
  33. package/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +17 -48
  34. package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +37 -0
  35. package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +8 -10
  36. package/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +91 -0
  37. package/node_modules/@slack/logger/node_modules/@types/node/package.json +4 -3
  38. package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +24 -0
  39. package/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +1 -1
  40. package/node_modules/@slack/logger/node_modules/@types/node/stream/promises.d.ts +8 -1
  41. package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +5 -2
  42. package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +2 -2
  43. package/node_modules/@slack/logger/node_modules/@types/node/test.d.ts +17 -5
  44. package/node_modules/@slack/logger/node_modules/@types/node/ts5.6/index.d.ts +8 -10
  45. package/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +7 -4
  46. package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +15 -10
  47. package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +81 -27
  48. package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +1 -1
  49. package/node_modules/@slack/web-api/dist/WebClient.d.ts +36 -4
  50. package/node_modules/@slack/web-api/dist/WebClient.d.ts.map +1 -1
  51. package/node_modules/@slack/web-api/dist/WebClient.js +23 -10
  52. package/node_modules/@slack/web-api/dist/WebClient.js.map +1 -1
  53. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  54. package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +2 -2
  55. package/node_modules/@slack/web-api/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  56. package/node_modules/@slack/web-api/node_modules/@types/node/compatibility/index.d.ts +9 -0
  57. package/node_modules/@slack/web-api/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  58. package/node_modules/@slack/web-api/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  59. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +10 -9
  60. package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +2 -2
  61. package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +15 -4
  62. package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +1 -1
  63. package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +17 -48
  64. package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +37 -0
  65. package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +8 -10
  66. package/node_modules/@slack/web-api/node_modules/@types/node/module.d.ts +91 -0
  67. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +4 -3
  68. package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +24 -0
  69. package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +1 -1
  70. package/node_modules/@slack/web-api/node_modules/@types/node/stream/promises.d.ts +8 -1
  71. package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +5 -2
  72. package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +2 -2
  73. package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +17 -5
  74. package/node_modules/@slack/web-api/node_modules/@types/node/ts5.6/index.d.ts +8 -10
  75. package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +7 -4
  76. package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +15 -10
  77. package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +81 -27
  78. package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +1 -1
  79. package/node_modules/@slack/web-api/package.json +1 -1
  80. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
  81. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +2 -2
  82. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  83. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/index.d.ts +9 -0
  84. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  85. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  86. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +10 -9
  87. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +2 -2
  88. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +15 -4
  89. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +1 -1
  90. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +17 -48
  91. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +37 -0
  92. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +8 -10
  93. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +91 -0
  94. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +4 -3
  95. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +24 -0
  96. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +1 -1
  97. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +8 -1
  98. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +5 -2
  99. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +2 -2
  100. package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +17 -5
  101. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/index.d.ts +8 -10
  102. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +7 -4
  103. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +15 -10
  104. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +81 -27
  105. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +1 -1
  106. package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
  107. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +2 -2
  108. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  109. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/index.d.ts +9 -0
  110. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  111. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  112. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +10 -9
  113. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +2 -2
  114. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +15 -4
  115. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +1 -1
  116. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +17 -48
  117. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +37 -0
  118. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +8 -10
  119. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +91 -0
  120. package/node_modules/@types/keyv/node_modules/@types/node/package.json +4 -3
  121. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +24 -0
  122. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +1 -1
  123. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +8 -1
  124. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +5 -2
  125. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +2 -2
  126. package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +17 -5
  127. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/index.d.ts +8 -10
  128. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +7 -4
  129. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +15 -10
  130. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +81 -27
  131. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +1 -1
  132. package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
  133. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +2 -2
  134. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  135. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/index.d.ts +9 -0
  136. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  137. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  138. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +10 -9
  139. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +2 -2
  140. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +15 -4
  141. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +1 -1
  142. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +17 -48
  143. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +37 -0
  144. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +8 -10
  145. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +91 -0
  146. package/node_modules/@types/responselike/node_modules/@types/node/package.json +4 -3
  147. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +24 -0
  148. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +1 -1
  149. package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +8 -1
  150. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +5 -2
  151. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +2 -2
  152. package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +17 -5
  153. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/index.d.ts +8 -10
  154. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +7 -4
  155. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +15 -10
  156. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +81 -27
  157. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +1 -1
  158. package/node_modules/form-data/Readme.md +4 -4
  159. package/node_modules/form-data/lib/form_data.js +1 -1
  160. package/node_modules/form-data/package.json +9 -6
  161. package/node_modules/parse5/dist/cjs/common/doctype.d.ts +0 -1
  162. package/node_modules/parse5/dist/cjs/common/doctype.js +2 -4
  163. package/node_modules/parse5/dist/cjs/common/error-codes.d.ts +0 -1
  164. package/node_modules/parse5/dist/cjs/common/error-codes.js +1 -2
  165. package/node_modules/parse5/dist/cjs/common/foreign-content.d.ts +0 -1
  166. package/node_modules/parse5/dist/cjs/common/foreign-content.js +7 -9
  167. package/node_modules/parse5/dist/cjs/common/html.d.ts +32 -31
  168. package/node_modules/parse5/dist/cjs/common/html.js +41 -42
  169. package/node_modules/parse5/dist/cjs/common/token.d.ts +0 -1
  170. package/node_modules/parse5/dist/cjs/common/token.js +3 -4
  171. package/node_modules/parse5/dist/cjs/common/unicode.d.ts +1 -8
  172. package/node_modules/parse5/dist/cjs/common/unicode.js +7 -14
  173. package/node_modules/parse5/dist/cjs/index.d.ts +15 -4
  174. package/node_modules/parse5/dist/cjs/index.js +3 -6
  175. package/node_modules/parse5/dist/cjs/parser/formatting-element-list.d.ts +0 -1
  176. package/node_modules/parse5/dist/cjs/parser/formatting-element-list.js +1 -2
  177. package/node_modules/parse5/dist/cjs/parser/index.d.ts +72 -8
  178. package/node_modules/parse5/dist/cjs/parser/index.js +81 -9
  179. package/node_modules/parse5/dist/cjs/parser/open-element-stack.d.ts +2 -2
  180. package/node_modules/parse5/dist/cjs/parser/open-element-stack.js +95 -87
  181. package/node_modules/parse5/dist/cjs/serializer/index.d.ts +1 -2
  182. package/node_modules/parse5/dist/cjs/serializer/index.js +8 -9
  183. package/node_modules/parse5/dist/cjs/tokenizer/index.d.ts +130 -131
  184. package/node_modules/parse5/dist/cjs/tokenizer/index.js +87 -281
  185. package/node_modules/parse5/dist/cjs/tokenizer/preprocessor.d.ts +3 -4
  186. package/node_modules/parse5/dist/cjs/tokenizer/preprocessor.js +8 -7
  187. package/node_modules/parse5/dist/cjs/tree-adapters/default.d.ts +0 -1
  188. package/node_modules/parse5/dist/cjs/tree-adapters/default.js +9 -10
  189. package/node_modules/parse5/dist/cjs/tree-adapters/interface.d.ts +7 -2
  190. package/node_modules/parse5/dist/cjs/tree-adapters/interface.js +0 -1
  191. package/node_modules/parse5/dist/common/doctype.d.ts +0 -1
  192. package/node_modules/parse5/dist/common/doctype.js +0 -1
  193. package/node_modules/parse5/dist/common/error-codes.d.ts +0 -1
  194. package/node_modules/parse5/dist/common/error-codes.js +1 -2
  195. package/node_modules/parse5/dist/common/foreign-content.d.ts +0 -1
  196. package/node_modules/parse5/dist/common/foreign-content.js +0 -2
  197. package/node_modules/parse5/dist/common/html.d.ts +32 -31
  198. package/node_modules/parse5/dist/common/html.js +38 -38
  199. package/node_modules/parse5/dist/common/token.d.ts +0 -1
  200. package/node_modules/parse5/dist/common/token.js +1 -2
  201. package/node_modules/parse5/dist/common/unicode.d.ts +1 -8
  202. package/node_modules/parse5/dist/common/unicode.js +1 -8
  203. package/node_modules/parse5/dist/index.d.ts +15 -4
  204. package/node_modules/parse5/dist/index.js +0 -3
  205. package/node_modules/parse5/dist/parser/formatting-element-list.d.ts +0 -1
  206. package/node_modules/parse5/dist/parser/formatting-element-list.js +1 -2
  207. package/node_modules/parse5/dist/parser/index.d.ts +72 -8
  208. package/node_modules/parse5/dist/parser/index.js +82 -10
  209. package/node_modules/parse5/dist/parser/open-element-stack.d.ts +2 -2
  210. package/node_modules/parse5/dist/parser/open-element-stack.js +96 -88
  211. package/node_modules/parse5/dist/serializer/index.d.ts +1 -2
  212. package/node_modules/parse5/dist/serializer/index.js +6 -6
  213. package/node_modules/parse5/dist/tokenizer/index.d.ts +130 -131
  214. package/node_modules/parse5/dist/tokenizer/index.js +88 -282
  215. package/node_modules/parse5/dist/tokenizer/preprocessor.d.ts +3 -4
  216. package/node_modules/parse5/dist/tokenizer/preprocessor.js +8 -7
  217. package/node_modules/parse5/dist/tree-adapters/default.d.ts +0 -1
  218. package/node_modules/parse5/dist/tree-adapters/default.js +9 -10
  219. package/node_modules/parse5/dist/tree-adapters/interface.d.ts +7 -2
  220. package/node_modules/parse5/dist/tree-adapters/interface.js +0 -1
  221. package/node_modules/parse5/package.json +4 -4
  222. package/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.d.ts +1 -2
  223. package/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.js +11 -12
  224. package/node_modules/parse5-htmlparser2-tree-adapter/dist/index.d.ts +1 -2
  225. package/node_modules/parse5-htmlparser2-tree-adapter/dist/index.js +9 -10
  226. package/node_modules/parse5-htmlparser2-tree-adapter/package.json +7 -6
  227. package/package.json +16 -16
  228. package/node_modules/@slack/logger/node_modules/@types/node/globals.global.d.ts +0 -1
  229. package/node_modules/@slack/web-api/node_modules/@types/node/globals.global.d.ts +0 -1
  230. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.global.d.ts +0 -1
  231. package/node_modules/@types/keyv/node_modules/@types/node/globals.global.d.ts +0 -1
  232. package/node_modules/@types/responselike/node_modules/@types/node/globals.global.d.ts +0 -1
  233. package/node_modules/form-data/README.md.bak +0 -358
@@ -6,7 +6,7 @@ import * as doctype from '../common/doctype.js';
6
6
  import * as foreignContent from '../common/foreign-content.js';
7
7
  import { ERR } from '../common/error-codes.js';
8
8
  import * as unicode from '../common/unicode.js';
9
- import { TAG_ID as $, TAG_NAMES as TN, NS, ATTRS, SPECIAL_ELEMENTS, DOCUMENT_MODE, isNumberedHeader, getTagID, } from '../common/html.js';
9
+ import { TAG_ID as $, TAG_NAMES as TN, NS, ATTRS, SPECIAL_ELEMENTS, DOCUMENT_MODE, NUMBERED_HEADERS, getTagID, } from '../common/html.js';
10
10
  import { TokenType, getTokenAttr, } from '../common/token.js';
11
11
  //Misc constants
12
12
  const HIDDEN_INPUT_TYPE = 'hidden';
@@ -57,26 +57,41 @@ const defaultParserOptions = {
57
57
  };
58
58
  //Parser
59
59
  export class Parser {
60
- constructor(options, document, fragmentContext = null, scriptHandler = null) {
60
+ constructor(options, document,
61
+ /** @internal */
62
+ fragmentContext = null,
63
+ /** @internal */
64
+ scriptHandler = null) {
61
65
  this.fragmentContext = fragmentContext;
62
66
  this.scriptHandler = scriptHandler;
63
67
  this.currentToken = null;
64
68
  this.stopped = false;
69
+ /** @internal */
65
70
  this.insertionMode = InsertionMode.INITIAL;
71
+ /** @internal */
66
72
  this.originalInsertionMode = InsertionMode.INITIAL;
73
+ /** @internal */
67
74
  this.headElement = null;
75
+ /** @internal */
68
76
  this.formElement = null;
69
77
  /** Indicates that the current node is not an element in the HTML namespace */
70
78
  this.currentNotInHTML = false;
71
79
  /**
72
80
  * The template insertion mode stack is maintained from the left.
73
81
  * Ie. the topmost element will always have index 0.
82
+ *
83
+ * @internal
74
84
  */
75
85
  this.tmplInsertionModeStack = [];
86
+ /** @internal */
76
87
  this.pendingCharacterTokens = [];
88
+ /** @internal */
77
89
  this.hasNonWhitespacePendingCharacterToken = false;
90
+ /** @internal */
78
91
  this.framesetOk = true;
92
+ /** @internal */
79
93
  this.skipNextNewLine = false;
94
+ /** @internal */
80
95
  this.fosterParentingEnabled = false;
81
96
  this.options = {
82
97
  ...defaultParserOptions,
@@ -130,6 +145,7 @@ export class Parser {
130
145
  return fragment;
131
146
  }
132
147
  //Errors
148
+ /** @internal */
133
149
  _err(token, code, beforeToken) {
134
150
  var _a;
135
151
  if (!this.onParseError)
@@ -147,12 +163,14 @@ export class Parser {
147
163
  this.onParseError(err);
148
164
  }
149
165
  //Stack events
166
+ /** @internal */
150
167
  onItemPush(node, tid, isTop) {
151
168
  var _a, _b;
152
169
  (_b = (_a = this.treeAdapter).onItemPush) === null || _b === void 0 ? void 0 : _b.call(_a, node);
153
170
  if (isTop && this.openElements.stackTop > 0)
154
171
  this._setContextModes(node, tid);
155
172
  }
173
+ /** @internal */
156
174
  onItemPop(node, isTop) {
157
175
  var _a, _b;
158
176
  if (this.options.sourceCodeLocationInfo) {
@@ -177,6 +195,7 @@ export class Parser {
177
195
  this.currentNotInHTML = !isHTML;
178
196
  this.tokenizer.inForeignNode = !isHTML && !this._isIntegrationPoint(tid, current);
179
197
  }
198
+ /** @protected */
180
199
  _switchToTextParsing(currentToken, nextTokenizerState) {
181
200
  this._insertElement(currentToken, NS.HTML);
182
201
  this.tokenizer.state = nextTokenizerState;
@@ -189,11 +208,13 @@ export class Parser {
189
208
  this.tokenizer.state = TokenizerMode.PLAINTEXT;
190
209
  }
191
210
  //Fragment parsing
211
+ /** @protected */
192
212
  _getAdjustedCurrentElement() {
193
213
  return this.openElements.stackTop === 0 && this.fragmentContext
194
214
  ? this.fragmentContext
195
215
  : this.openElements.current;
196
216
  }
217
+ /** @protected */
197
218
  _findFormInFragmentContext() {
198
219
  let node = this.fragmentContext;
199
220
  while (node) {
@@ -236,6 +257,7 @@ export class Parser {
236
257
  }
237
258
  }
238
259
  //Tree mutation
260
+ /** @protected */
239
261
  _setDocumentType(token) {
240
262
  const name = token.name || '';
241
263
  const publicId = token.publicId || '';
@@ -249,6 +271,7 @@ export class Parser {
249
271
  }
250
272
  }
251
273
  }
274
+ /** @protected */
252
275
  _attachElementToTree(element, location) {
253
276
  if (this.options.sourceCodeLocationInfo) {
254
277
  const loc = location && {
@@ -265,20 +288,28 @@ export class Parser {
265
288
  this.treeAdapter.appendChild(parent, element);
266
289
  }
267
290
  }
291
+ /**
292
+ * For self-closing tags. Add an element to the tree, but skip adding it
293
+ * to the stack.
294
+ */
295
+ /** @protected */
268
296
  _appendElement(token, namespaceURI) {
269
297
  const element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs);
270
298
  this._attachElementToTree(element, token.location);
271
299
  }
300
+ /** @protected */
272
301
  _insertElement(token, namespaceURI) {
273
302
  const element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs);
274
303
  this._attachElementToTree(element, token.location);
275
304
  this.openElements.push(element, token.tagID);
276
305
  }
306
+ /** @protected */
277
307
  _insertFakeElement(tagName, tagID) {
278
308
  const element = this.treeAdapter.createElement(tagName, NS.HTML, []);
279
309
  this._attachElementToTree(element, null);
280
310
  this.openElements.push(element, tagID);
281
311
  }
312
+ /** @protected */
282
313
  _insertTemplate(token) {
283
314
  const tmpl = this.treeAdapter.createElement(token.tagName, NS.HTML, token.attrs);
284
315
  const content = this.treeAdapter.createDocumentFragment();
@@ -288,6 +319,7 @@ export class Parser {
288
319
  if (this.options.sourceCodeLocationInfo)
289
320
  this.treeAdapter.setNodeSourceCodeLocation(content, null);
290
321
  }
322
+ /** @protected */
291
323
  _insertFakeRootElement() {
292
324
  const element = this.treeAdapter.createElement(TN.HTML, NS.HTML, []);
293
325
  if (this.options.sourceCodeLocationInfo)
@@ -295,6 +327,7 @@ export class Parser {
295
327
  this.treeAdapter.appendChild(this.openElements.current, element);
296
328
  this.openElements.push(element, $.HTML);
297
329
  }
330
+ /** @protected */
298
331
  _appendCommentNode(token, parent) {
299
332
  const commentNode = this.treeAdapter.createCommentNode(token.data);
300
333
  this.treeAdapter.appendChild(parent, commentNode);
@@ -302,6 +335,7 @@ export class Parser {
302
335
  this.treeAdapter.setNodeSourceCodeLocation(commentNode, token.location);
303
336
  }
304
337
  }
338
+ /** @protected */
305
339
  _insertCharacters(token) {
306
340
  let parent;
307
341
  let beforeElement;
@@ -333,12 +367,14 @@ export class Parser {
333
367
  this.treeAdapter.setNodeSourceCodeLocation(textNode, token.location);
334
368
  }
335
369
  }
370
+ /** @protected */
336
371
  _adoptNodes(donor, recipient) {
337
372
  for (let child = this.treeAdapter.getFirstChild(donor); child; child = this.treeAdapter.getFirstChild(donor)) {
338
373
  this.treeAdapter.detachNode(child);
339
374
  this.treeAdapter.appendChild(recipient, child);
340
375
  }
341
376
  }
377
+ /** @protected */
342
378
  _setEndLocation(element, closingToken) {
343
379
  if (this.treeAdapter.getNodeSourceCodeLocation(element) && closingToken.location) {
344
380
  const ctLoc = closingToken.location;
@@ -388,6 +424,7 @@ export class Parser {
388
424
  ((token.tagID === $.MGLYPH || token.tagID === $.MALIGNMARK) &&
389
425
  !this._isIntegrationPoint(currentTagId, current, NS.HTML)));
390
426
  }
427
+ /** @protected */
391
428
  _processToken(token) {
392
429
  switch (token.type) {
393
430
  case TokenType.CHARACTER: {
@@ -425,12 +462,14 @@ export class Parser {
425
462
  }
426
463
  }
427
464
  //Integration points
465
+ /** @protected */
428
466
  _isIntegrationPoint(tid, element, foreignNS) {
429
467
  const ns = this.treeAdapter.getNamespaceURI(element);
430
468
  const attrs = this.treeAdapter.getAttrList(element);
431
469
  return foreignContent.isIntegrationPoint(tid, ns, attrs, foreignNS);
432
470
  }
433
471
  //Active formatting elements reconstruction
472
+ /** @protected */
434
473
  _reconstructActiveFormattingElements() {
435
474
  const listLength = this.activeFormattingElements.entries.length;
436
475
  if (listLength) {
@@ -444,17 +483,20 @@ export class Parser {
444
483
  }
445
484
  }
446
485
  //Close elements
486
+ /** @protected */
447
487
  _closeTableCell() {
448
488
  this.openElements.generateImpliedEndTags();
449
489
  this.openElements.popUntilTableCellPopped();
450
490
  this.activeFormattingElements.clearToLastMarker();
451
491
  this.insertionMode = InsertionMode.IN_ROW;
452
492
  }
493
+ /** @protected */
453
494
  _closePElement() {
454
495
  this.openElements.generateImpliedEndTagsWithExclusion($.P);
455
496
  this.openElements.popUntilTagNamePopped($.P);
456
497
  }
457
498
  //Insertion modes
499
+ /** @protected */
458
500
  _resetInsertionMode() {
459
501
  for (let i = this.openElements.stackTop; i >= 0; i--) {
460
502
  //Insertion mode reset map
@@ -520,6 +562,7 @@ export class Parser {
520
562
  }
521
563
  this.insertionMode = InsertionMode.IN_BODY;
522
564
  }
565
+ /** @protected */
523
566
  _resetInsertionModeForSelect(selectIdx) {
524
567
  if (selectIdx > 0) {
525
568
  for (let i = selectIdx - 1; i > 0; i--) {
@@ -536,12 +579,15 @@ export class Parser {
536
579
  this.insertionMode = InsertionMode.IN_SELECT;
537
580
  }
538
581
  //Foster parenting
582
+ /** @protected */
539
583
  _isElementCausesFosterParenting(tn) {
540
584
  return TABLE_STRUCTURE_TAGS.has(tn);
541
585
  }
586
+ /** @protected */
542
587
  _shouldFosterParentOnInsertion() {
543
588
  return this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.currentTagId);
544
589
  }
590
+ /** @protected */
545
591
  _findFosterParentingLocation() {
546
592
  for (let i = this.openElements.stackTop; i >= 0; i--) {
547
593
  const openElement = this.openElements.items[i];
@@ -565,6 +611,7 @@ export class Parser {
565
611
  }
566
612
  return { parent: this.openElements.items[0], beforeElement: null };
567
613
  }
614
+ /** @protected */
568
615
  _fosterParentElement(element) {
569
616
  const location = this._findFosterParentingLocation();
570
617
  if (location.beforeElement) {
@@ -575,10 +622,12 @@ export class Parser {
575
622
  }
576
623
  }
577
624
  //Special elements
625
+ /** @protected */
578
626
  _isSpecialElement(element, id) {
579
627
  const ns = this.treeAdapter.getNamespaceURI(element);
580
628
  return SPECIAL_ELEMENTS[ns].has(id);
581
629
  }
630
+ /** @internal */
582
631
  onCharacter(token) {
583
632
  this.skipNextNewLine = false;
584
633
  if (this.tokenizer.inForeignNode) {
@@ -649,6 +698,7 @@ export class Parser {
649
698
  // Do nothing
650
699
  }
651
700
  }
701
+ /** @internal */
652
702
  onNullCharacter(token) {
653
703
  this.skipNextNewLine = false;
654
704
  if (this.tokenizer.inForeignNode) {
@@ -706,6 +756,7 @@ export class Parser {
706
756
  // Do nothing
707
757
  }
708
758
  }
759
+ /** @internal */
709
760
  onComment(token) {
710
761
  this.skipNextNewLine = false;
711
762
  if (this.currentNotInHTML) {
@@ -751,6 +802,7 @@ export class Parser {
751
802
  // Do nothing
752
803
  }
753
804
  }
805
+ /** @internal */
754
806
  onDoctype(token) {
755
807
  this.skipNextNewLine = false;
756
808
  switch (this.insertionMode) {
@@ -773,6 +825,7 @@ export class Parser {
773
825
  // Do nothing
774
826
  }
775
827
  }
828
+ /** @internal */
776
829
  onStartTag(token) {
777
830
  this.skipNextNewLine = false;
778
831
  this.currentToken = token;
@@ -790,6 +843,7 @@ export class Parser {
790
843
  * for nested calls.
791
844
  *
792
845
  * @param token The token to process.
846
+ * @protected
793
847
  */
794
848
  _processStartTag(token) {
795
849
  if (this.shouldProcessStartTagTokenInForeignContent(token)) {
@@ -799,6 +853,7 @@ export class Parser {
799
853
  this._startTagOutsideForeignContent(token);
800
854
  }
801
855
  }
856
+ /** @protected */
802
857
  _startTagOutsideForeignContent(token) {
803
858
  switch (this.insertionMode) {
804
859
  case InsertionMode.INITIAL: {
@@ -893,6 +948,7 @@ export class Parser {
893
948
  // Do nothing
894
949
  }
895
950
  }
951
+ /** @internal */
896
952
  onEndTag(token) {
897
953
  this.skipNextNewLine = false;
898
954
  this.currentToken = token;
@@ -903,6 +959,7 @@ export class Parser {
903
959
  this._endTagOutsideForeignContent(token);
904
960
  }
905
961
  }
962
+ /** @protected */
906
963
  _endTagOutsideForeignContent(token) {
907
964
  switch (this.insertionMode) {
908
965
  case InsertionMode.INITIAL: {
@@ -997,6 +1054,7 @@ export class Parser {
997
1054
  // Do nothing
998
1055
  }
999
1056
  }
1057
+ /** @internal */
1000
1058
  onEof(token) {
1001
1059
  switch (this.insertionMode) {
1002
1060
  case InsertionMode.INITIAL: {
@@ -1059,6 +1117,7 @@ export class Parser {
1059
1117
  // Do nothing
1060
1118
  }
1061
1119
  }
1120
+ /** @internal */
1062
1121
  onWhitespaceCharacter(token) {
1063
1122
  if (this.skipNextNewLine) {
1064
1123
  this.skipNextNewLine = false;
@@ -1631,7 +1690,7 @@ function numberedHeaderStartTagInBody(p, token) {
1631
1690
  if (p.openElements.hasInButtonScope($.P)) {
1632
1691
  p._closePElement();
1633
1692
  }
1634
- if (isNumberedHeader(p.openElements.currentTagId)) {
1693
+ if (NUMBERED_HEADERS.has(p.openElements.currentTagId)) {
1635
1694
  p.openElements.pop();
1636
1695
  }
1637
1696
  p._insertElement(token, NS.HTML);
@@ -1793,9 +1852,9 @@ function iframeStartTagInBody(p, token) {
1793
1852
  p.framesetOk = false;
1794
1853
  p._switchToTextParsing(token, TokenizerMode.RAWTEXT);
1795
1854
  }
1796
- //NOTE: here we assume that we always act as an user agent with enabled plugins, so we parse
1797
- //<noembed> as rawtext.
1798
- function noembedStartTagInBody(p, token) {
1855
+ //NOTE: here we assume that we always act as a user agent with enabled plugins/frames, so we parse
1856
+ //<noembed>/<noframes> as rawtext.
1857
+ function rawTextStartTagInBody(p, token) {
1799
1858
  p._switchToTextParsing(token, TokenizerMode.RAWTEXT);
1800
1859
  }
1801
1860
  function selectStartTagInBody(p, token) {
@@ -1907,6 +1966,7 @@ function startTagInBody(p, token) {
1907
1966
  case $.DETAILS:
1908
1967
  case $.ADDRESS:
1909
1968
  case $.ARTICLE:
1969
+ case $.SEARCH:
1910
1970
  case $.SECTION:
1911
1971
  case $.SUMMARY:
1912
1972
  case $.FIELDSET:
@@ -2030,8 +2090,9 @@ function startTagInBody(p, token) {
2030
2090
  optgroupStartTagInBody(p, token);
2031
2091
  break;
2032
2092
  }
2033
- case $.NOEMBED: {
2034
- noembedStartTagInBody(p, token);
2093
+ case $.NOEMBED:
2094
+ case $.NOFRAMES: {
2095
+ rawTextStartTagInBody(p, token);
2035
2096
  break;
2036
2097
  }
2037
2098
  case $.FRAMESET: {
@@ -2044,7 +2105,7 @@ function startTagInBody(p, token) {
2044
2105
  }
2045
2106
  case $.NOSCRIPT: {
2046
2107
  if (p.options.scriptingEnabled) {
2047
- noembedStartTagInBody(p, token);
2108
+ rawTextStartTagInBody(p, token);
2048
2109
  }
2049
2110
  else {
2050
2111
  genericStartTagInBody(p, token);
@@ -2216,6 +2277,7 @@ function endTagInBody(p, token) {
2216
2277
  case $.ADDRESS:
2217
2278
  case $.ARTICLE:
2218
2279
  case $.DETAILS:
2280
+ case $.SEARCH:
2219
2281
  case $.SECTION:
2220
2282
  case $.SUMMARY:
2221
2283
  case $.LISTING:
@@ -2816,6 +2878,17 @@ function startTagInSelect(p, token) {
2816
2878
  p._insertElement(token, NS.HTML);
2817
2879
  break;
2818
2880
  }
2881
+ case $.HR: {
2882
+ if (p.openElements.currentTagId === $.OPTION) {
2883
+ p.openElements.pop();
2884
+ }
2885
+ if (p.openElements.currentTagId === $.OPTGROUP) {
2886
+ p.openElements.pop();
2887
+ }
2888
+ p._appendElement(token, NS.HTML);
2889
+ token.ackSelfClosing = true;
2890
+ break;
2891
+ }
2819
2892
  case $.INPUT:
2820
2893
  case $.KEYGEN:
2821
2894
  case $.TEXTAREA:
@@ -3165,4 +3238,3 @@ function endTagInForeignContent(p, token) {
3165
3238
  }
3166
3239
  }
3167
3240
  }
3168
- //# sourceMappingURL=index.js.map
@@ -39,10 +39,11 @@ export declare class OpenElementStack<T extends TreeAdapterTypeMap> {
39
39
  contains(element: T['element']): boolean;
40
40
  getCommonAncestor(element: T['element']): T['element'] | null;
41
41
  isRootHtmlElementCurrent(): boolean;
42
+ private hasInDynamicScope;
42
43
  hasInScope(tagName: $): boolean;
43
- hasNumberedHeaderInScope(): boolean;
44
44
  hasInListItemScope(tagName: $): boolean;
45
45
  hasInButtonScope(tagName: $): boolean;
46
+ hasNumberedHeaderInScope(): boolean;
46
47
  hasInTableScope(tagName: $): boolean;
47
48
  hasTableBodyContextInTableScope(): boolean;
48
49
  hasInSelectScope(tagName: $): boolean;
@@ -50,4 +51,3 @@ export declare class OpenElementStack<T extends TreeAdapterTypeMap> {
50
51
  generateImpliedEndTagsThoroughly(): void;
51
52
  generateImpliedEndTagsWithExclusion(exclusionId: $): void;
52
53
  }
53
- //# sourceMappingURL=open-element-stack.d.ts.map
@@ -1,4 +1,4 @@
1
- import { TAG_ID as $, NS, isNumberedHeader } from '../common/html.js';
1
+ import { TAG_ID as $, NS, NUMBERED_HEADERS } from '../common/html.js';
2
2
  //Element utils
3
3
  const IMPLICIT_END_TAG_REQUIRED = new Set([$.DD, $.DT, $.LI, $.OPTGROUP, $.OPTION, $.P, $.RB, $.RP, $.RT, $.RTC]);
4
4
  const IMPLICIT_END_TAG_REQUIRED_THOROUGHLY = new Set([
@@ -12,31 +12,25 @@ const IMPLICIT_END_TAG_REQUIRED_THOROUGHLY = new Set([
12
12
  $.THEAD,
13
13
  $.TR,
14
14
  ]);
15
- const SCOPING_ELEMENT_NS = new Map([
16
- [$.APPLET, NS.HTML],
17
- [$.CAPTION, NS.HTML],
18
- [$.HTML, NS.HTML],
19
- [$.MARQUEE, NS.HTML],
20
- [$.OBJECT, NS.HTML],
21
- [$.TABLE, NS.HTML],
22
- [$.TD, NS.HTML],
23
- [$.TEMPLATE, NS.HTML],
24
- [$.TH, NS.HTML],
25
- [$.ANNOTATION_XML, NS.MATHML],
26
- [$.MI, NS.MATHML],
27
- [$.MN, NS.MATHML],
28
- [$.MO, NS.MATHML],
29
- [$.MS, NS.MATHML],
30
- [$.MTEXT, NS.MATHML],
31
- [$.DESC, NS.SVG],
32
- [$.FOREIGN_OBJECT, NS.SVG],
33
- [$.TITLE, NS.SVG],
15
+ const SCOPING_ELEMENTS_HTML = new Set([
16
+ $.APPLET,
17
+ $.CAPTION,
18
+ $.HTML,
19
+ $.MARQUEE,
20
+ $.OBJECT,
21
+ $.TABLE,
22
+ $.TD,
23
+ $.TEMPLATE,
24
+ $.TH,
34
25
  ]);
35
- const NAMED_HEADERS = [$.H1, $.H2, $.H3, $.H4, $.H5, $.H6];
36
- const TABLE_ROW_CONTEXT = [$.TR, $.TEMPLATE, $.HTML];
37
- const TABLE_BODY_CONTEXT = [$.TBODY, $.TFOOT, $.THEAD, $.TEMPLATE, $.HTML];
38
- const TABLE_CONTEXT = [$.TABLE, $.TEMPLATE, $.HTML];
39
- const TABLE_CELLS = [$.TD, $.TH];
26
+ const SCOPING_ELEMENTS_HTML_LIST = new Set([...SCOPING_ELEMENTS_HTML, $.OL, $.UL]);
27
+ const SCOPING_ELEMENTS_HTML_BUTTON = new Set([...SCOPING_ELEMENTS_HTML, $.BUTTON]);
28
+ const SCOPING_ELEMENTS_MATHML = new Set([$.ANNOTATION_XML, $.MI, $.MN, $.MO, $.MS, $.MTEXT]);
29
+ const SCOPING_ELEMENTS_SVG = new Set([$.DESC, $.FOREIGN_OBJECT, $.TITLE]);
30
+ const TABLE_ROW_CONTEXT = new Set([$.TR, $.TEMPLATE, $.HTML]);
31
+ const TABLE_BODY_CONTEXT = new Set([$.TBODY, $.TFOOT, $.THEAD, $.TEMPLATE, $.HTML]);
32
+ const TABLE_CONTEXT = new Set([$.TABLE, $.TEMPLATE, $.HTML]);
33
+ const TABLE_CELLS = new Set([$.TD, $.TH]);
40
34
  //Stack of open elements
41
35
  export class OpenElementStack {
42
36
  get currentTmplContentOrNode() {
@@ -129,7 +123,7 @@ export class OpenElementStack {
129
123
  this.shortenToLength(idx < 0 ? 0 : idx);
130
124
  }
131
125
  popUntilNumberedHeaderPopped() {
132
- this.popUntilPopped(NAMED_HEADERS, NS.HTML);
126
+ this.popUntilPopped(NUMBERED_HEADERS, NS.HTML);
133
127
  }
134
128
  popUntilTableCellPopped() {
135
129
  this.popUntilPopped(TABLE_CELLS, NS.HTML);
@@ -142,7 +136,7 @@ export class OpenElementStack {
142
136
  }
143
137
  _indexOfTagNames(tagNames, namespace) {
144
138
  for (let i = this.stackTop; i >= 0; i--) {
145
- if (tagNames.includes(this.tagIDs[i]) && this.treeAdapter.getNamespaceURI(this.items[i]) === namespace) {
139
+ if (tagNames.has(this.tagIDs[i]) && this.treeAdapter.getNamespaceURI(this.items[i]) === namespace) {
146
140
  return i;
147
141
  }
148
142
  }
@@ -192,102 +186,117 @@ export class OpenElementStack {
192
186
  return this.stackTop === 0 && this.tagIDs[0] === $.HTML;
193
187
  }
194
188
  //Element in scope
195
- hasInScope(tagName) {
189
+ hasInDynamicScope(tagName, htmlScope) {
196
190
  for (let i = this.stackTop; i >= 0; i--) {
197
191
  const tn = this.tagIDs[i];
198
- const ns = this.treeAdapter.getNamespaceURI(this.items[i]);
199
- if (tn === tagName && ns === NS.HTML) {
200
- return true;
201
- }
202
- if (SCOPING_ELEMENT_NS.get(tn) === ns) {
203
- return false;
192
+ switch (this.treeAdapter.getNamespaceURI(this.items[i])) {
193
+ case NS.HTML: {
194
+ if (tn === tagName)
195
+ return true;
196
+ if (htmlScope.has(tn))
197
+ return false;
198
+ break;
199
+ }
200
+ case NS.SVG: {
201
+ if (SCOPING_ELEMENTS_SVG.has(tn))
202
+ return false;
203
+ break;
204
+ }
205
+ case NS.MATHML: {
206
+ if (SCOPING_ELEMENTS_MATHML.has(tn))
207
+ return false;
208
+ break;
209
+ }
204
210
  }
205
211
  }
206
212
  return true;
207
213
  }
208
- hasNumberedHeaderInScope() {
209
- for (let i = this.stackTop; i >= 0; i--) {
210
- const tn = this.tagIDs[i];
211
- const ns = this.treeAdapter.getNamespaceURI(this.items[i]);
212
- if (isNumberedHeader(tn) && ns === NS.HTML) {
213
- return true;
214
- }
215
- if (SCOPING_ELEMENT_NS.get(tn) === ns) {
216
- return false;
217
- }
218
- }
219
- return true;
214
+ hasInScope(tagName) {
215
+ return this.hasInDynamicScope(tagName, SCOPING_ELEMENTS_HTML);
220
216
  }
221
217
  hasInListItemScope(tagName) {
222
- for (let i = this.stackTop; i >= 0; i--) {
223
- const tn = this.tagIDs[i];
224
- const ns = this.treeAdapter.getNamespaceURI(this.items[i]);
225
- if (tn === tagName && ns === NS.HTML) {
226
- return true;
227
- }
228
- if (((tn === $.UL || tn === $.OL) && ns === NS.HTML) || SCOPING_ELEMENT_NS.get(tn) === ns) {
229
- return false;
230
- }
231
- }
232
- return true;
218
+ return this.hasInDynamicScope(tagName, SCOPING_ELEMENTS_HTML_LIST);
233
219
  }
234
220
  hasInButtonScope(tagName) {
221
+ return this.hasInDynamicScope(tagName, SCOPING_ELEMENTS_HTML_BUTTON);
222
+ }
223
+ hasNumberedHeaderInScope() {
235
224
  for (let i = this.stackTop; i >= 0; i--) {
236
225
  const tn = this.tagIDs[i];
237
- const ns = this.treeAdapter.getNamespaceURI(this.items[i]);
238
- if (tn === tagName && ns === NS.HTML) {
239
- return true;
240
- }
241
- if ((tn === $.BUTTON && ns === NS.HTML) || SCOPING_ELEMENT_NS.get(tn) === ns) {
242
- return false;
226
+ switch (this.treeAdapter.getNamespaceURI(this.items[i])) {
227
+ case NS.HTML: {
228
+ if (NUMBERED_HEADERS.has(tn))
229
+ return true;
230
+ if (SCOPING_ELEMENTS_HTML.has(tn))
231
+ return false;
232
+ break;
233
+ }
234
+ case NS.SVG: {
235
+ if (SCOPING_ELEMENTS_SVG.has(tn))
236
+ return false;
237
+ break;
238
+ }
239
+ case NS.MATHML: {
240
+ if (SCOPING_ELEMENTS_MATHML.has(tn))
241
+ return false;
242
+ break;
243
+ }
243
244
  }
244
245
  }
245
246
  return true;
246
247
  }
247
248
  hasInTableScope(tagName) {
248
249
  for (let i = this.stackTop; i >= 0; i--) {
249
- const tn = this.tagIDs[i];
250
- const ns = this.treeAdapter.getNamespaceURI(this.items[i]);
251
- if (ns !== NS.HTML) {
250
+ if (this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) {
252
251
  continue;
253
252
  }
254
- if (tn === tagName) {
255
- return true;
256
- }
257
- if (tn === $.TABLE || tn === $.TEMPLATE || tn === $.HTML) {
258
- return false;
253
+ switch (this.tagIDs[i]) {
254
+ case tagName: {
255
+ return true;
256
+ }
257
+ case $.TABLE:
258
+ case $.HTML: {
259
+ return false;
260
+ }
259
261
  }
260
262
  }
261
263
  return true;
262
264
  }
263
265
  hasTableBodyContextInTableScope() {
264
266
  for (let i = this.stackTop; i >= 0; i--) {
265
- const tn = this.tagIDs[i];
266
- const ns = this.treeAdapter.getNamespaceURI(this.items[i]);
267
- if (ns !== NS.HTML) {
267
+ if (this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) {
268
268
  continue;
269
269
  }
270
- if (tn === $.TBODY || tn === $.THEAD || tn === $.TFOOT) {
271
- return true;
272
- }
273
- if (tn === $.TABLE || tn === $.HTML) {
274
- return false;
270
+ switch (this.tagIDs[i]) {
271
+ case $.TBODY:
272
+ case $.THEAD:
273
+ case $.TFOOT: {
274
+ return true;
275
+ }
276
+ case $.TABLE:
277
+ case $.HTML: {
278
+ return false;
279
+ }
275
280
  }
276
281
  }
277
282
  return true;
278
283
  }
279
284
  hasInSelectScope(tagName) {
280
285
  for (let i = this.stackTop; i >= 0; i--) {
281
- const tn = this.tagIDs[i];
282
- const ns = this.treeAdapter.getNamespaceURI(this.items[i]);
283
- if (ns !== NS.HTML) {
286
+ if (this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) {
284
287
  continue;
285
288
  }
286
- if (tn === tagName) {
287
- return true;
288
- }
289
- if (tn !== $.OPTION && tn !== $.OPTGROUP) {
290
- return false;
289
+ switch (this.tagIDs[i]) {
290
+ case tagName: {
291
+ return true;
292
+ }
293
+ case $.OPTION:
294
+ case $.OPTGROUP: {
295
+ break;
296
+ }
297
+ default: {
298
+ return false;
299
+ }
291
300
  }
292
301
  }
293
302
  return true;
@@ -309,4 +318,3 @@ export class OpenElementStack {
309
318
  }
310
319
  }
311
320
  }
312
- //# sourceMappingURL=open-element-stack.js.map