NodeWrapperFactory.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. /*
  2. * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2020, Luke Wilde <luke.wilde@live.co.uk>
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright notice, this
  10. * list of conditions and the following disclaimer.
  11. *
  12. * 2. Redistributions in binary form must reproduce the above copyright notice,
  13. * this list of conditions and the following disclaimer in the documentation
  14. * and/or other materials provided with the distribution.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  17. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  20. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  21. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  22. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  23. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  24. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  25. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. #include <LibWeb/Bindings/CharacterDataWrapper.h>
  28. #include <LibWeb/Bindings/CommentWrapper.h>
  29. #include <LibWeb/Bindings/DocumentFragmentWrapper.h>
  30. #include <LibWeb/Bindings/DocumentTypeWrapper.h>
  31. #include <LibWeb/Bindings/DocumentWrapper.h>
  32. #include <LibWeb/Bindings/HTMLAnchorElementWrapper.h>
  33. #include <LibWeb/Bindings/HTMLAreaElementWrapper.h>
  34. #include <LibWeb/Bindings/HTMLAudioElementWrapper.h>
  35. #include <LibWeb/Bindings/HTMLBRElementWrapper.h>
  36. #include <LibWeb/Bindings/HTMLBaseElementWrapper.h>
  37. #include <LibWeb/Bindings/HTMLBodyElementWrapper.h>
  38. #include <LibWeb/Bindings/HTMLButtonElementWrapper.h>
  39. #include <LibWeb/Bindings/HTMLCanvasElementWrapper.h>
  40. #include <LibWeb/Bindings/HTMLDListElementWrapper.h>
  41. #include <LibWeb/Bindings/HTMLDataElementWrapper.h>
  42. #include <LibWeb/Bindings/HTMLDataListElementWrapper.h>
  43. #include <LibWeb/Bindings/HTMLDetailsElementWrapper.h>
  44. #include <LibWeb/Bindings/HTMLDialogElementWrapper.h>
  45. #include <LibWeb/Bindings/HTMLDirectoryElementWrapper.h>
  46. #include <LibWeb/Bindings/HTMLDivElementWrapper.h>
  47. #include <LibWeb/Bindings/HTMLElementWrapper.h>
  48. #include <LibWeb/Bindings/HTMLEmbedElementWrapper.h>
  49. #include <LibWeb/Bindings/HTMLFieldSetElementWrapper.h>
  50. #include <LibWeb/Bindings/HTMLFontElementWrapper.h>
  51. #include <LibWeb/Bindings/HTMLFormElementWrapper.h>
  52. #include <LibWeb/Bindings/HTMLFrameElementWrapper.h>
  53. #include <LibWeb/Bindings/HTMLFrameSetElementWrapper.h>
  54. #include <LibWeb/Bindings/HTMLHRElementWrapper.h>
  55. #include <LibWeb/Bindings/HTMLHeadElementWrapper.h>
  56. #include <LibWeb/Bindings/HTMLHeadingElementWrapper.h>
  57. #include <LibWeb/Bindings/HTMLHtmlElementWrapper.h>
  58. #include <LibWeb/Bindings/HTMLIFrameElementWrapper.h>
  59. #include <LibWeb/Bindings/HTMLImageElementWrapper.h>
  60. #include <LibWeb/Bindings/HTMLInputElementWrapper.h>
  61. #include <LibWeb/Bindings/HTMLLIElementWrapper.h>
  62. #include <LibWeb/Bindings/HTMLLabelElementWrapper.h>
  63. #include <LibWeb/Bindings/HTMLLegendElementWrapper.h>
  64. #include <LibWeb/Bindings/HTMLLinkElementWrapper.h>
  65. #include <LibWeb/Bindings/HTMLMapElementWrapper.h>
  66. #include <LibWeb/Bindings/HTMLMarqueeElementWrapper.h>
  67. #include <LibWeb/Bindings/HTMLMenuElementWrapper.h>
  68. #include <LibWeb/Bindings/HTMLMetaElementWrapper.h>
  69. #include <LibWeb/Bindings/HTMLMeterElementWrapper.h>
  70. #include <LibWeb/Bindings/HTMLModElementWrapper.h>
  71. #include <LibWeb/Bindings/HTMLOListElementWrapper.h>
  72. #include <LibWeb/Bindings/HTMLObjectElementWrapper.h>
  73. #include <LibWeb/Bindings/HTMLOptGroupElementWrapper.h>
  74. #include <LibWeb/Bindings/HTMLOptionElementWrapper.h>
  75. #include <LibWeb/Bindings/HTMLOutputElementWrapper.h>
  76. #include <LibWeb/Bindings/HTMLParagraphElementWrapper.h>
  77. #include <LibWeb/Bindings/HTMLParamElementWrapper.h>
  78. #include <LibWeb/Bindings/HTMLPictureElementWrapper.h>
  79. #include <LibWeb/Bindings/HTMLPreElementWrapper.h>
  80. #include <LibWeb/Bindings/HTMLProgressElementWrapper.h>
  81. #include <LibWeb/Bindings/HTMLQuoteElementWrapper.h>
  82. #include <LibWeb/Bindings/HTMLScriptElementWrapper.h>
  83. #include <LibWeb/Bindings/HTMLSelectElementWrapper.h>
  84. #include <LibWeb/Bindings/HTMLSlotElementWrapper.h>
  85. #include <LibWeb/Bindings/HTMLSourceElementWrapper.h>
  86. #include <LibWeb/Bindings/HTMLSpanElementWrapper.h>
  87. #include <LibWeb/Bindings/HTMLStyleElementWrapper.h>
  88. #include <LibWeb/Bindings/HTMLTableCaptionElementWrapper.h>
  89. #include <LibWeb/Bindings/HTMLTableCellElementWrapper.h>
  90. #include <LibWeb/Bindings/HTMLTableColElementWrapper.h>
  91. #include <LibWeb/Bindings/HTMLTableElementWrapper.h>
  92. #include <LibWeb/Bindings/HTMLTableRowElementWrapper.h>
  93. #include <LibWeb/Bindings/HTMLTableSectionElementWrapper.h>
  94. #include <LibWeb/Bindings/HTMLTemplateElementWrapper.h>
  95. #include <LibWeb/Bindings/HTMLTextAreaElementWrapper.h>
  96. #include <LibWeb/Bindings/HTMLTimeElementWrapper.h>
  97. #include <LibWeb/Bindings/HTMLTitleElementWrapper.h>
  98. #include <LibWeb/Bindings/HTMLTrackElementWrapper.h>
  99. #include <LibWeb/Bindings/HTMLUListElementWrapper.h>
  100. #include <LibWeb/Bindings/HTMLUnknownElementWrapper.h>
  101. #include <LibWeb/Bindings/HTMLVideoElementWrapper.h>
  102. #include <LibWeb/Bindings/NodeWrapper.h>
  103. #include <LibWeb/Bindings/NodeWrapperFactory.h>
  104. #include <LibWeb/Bindings/SVGPathElementWrapper.h>
  105. #include <LibWeb/Bindings/SVGSVGElementWrapper.h>
  106. #include <LibWeb/Bindings/TextWrapper.h>
  107. #include <LibWeb/DOM/Document.h>
  108. #include <LibWeb/DOM/Node.h>
  109. #include <LibWeb/HTML/HTMLAnchorElement.h>
  110. #include <LibWeb/HTML/HTMLAreaElement.h>
  111. #include <LibWeb/HTML/HTMLAudioElement.h>
  112. #include <LibWeb/HTML/HTMLBRElement.h>
  113. #include <LibWeb/HTML/HTMLBaseElement.h>
  114. #include <LibWeb/HTML/HTMLBodyElement.h>
  115. #include <LibWeb/HTML/HTMLButtonElement.h>
  116. #include <LibWeb/HTML/HTMLCanvasElement.h>
  117. #include <LibWeb/HTML/HTMLDListElement.h>
  118. #include <LibWeb/HTML/HTMLDataElement.h>
  119. #include <LibWeb/HTML/HTMLDataListElement.h>
  120. #include <LibWeb/HTML/HTMLDetailsElement.h>
  121. #include <LibWeb/HTML/HTMLDialogElement.h>
  122. #include <LibWeb/HTML/HTMLDirectoryElement.h>
  123. #include <LibWeb/HTML/HTMLDivElement.h>
  124. #include <LibWeb/HTML/HTMLEmbedElement.h>
  125. #include <LibWeb/HTML/HTMLFieldSetElement.h>
  126. #include <LibWeb/HTML/HTMLFontElement.h>
  127. #include <LibWeb/HTML/HTMLFormElement.h>
  128. #include <LibWeb/HTML/HTMLFrameElement.h>
  129. #include <LibWeb/HTML/HTMLFrameSetElement.h>
  130. #include <LibWeb/HTML/HTMLHRElement.h>
  131. #include <LibWeb/HTML/HTMLHeadElement.h>
  132. #include <LibWeb/HTML/HTMLHeadingElement.h>
  133. #include <LibWeb/HTML/HTMLHtmlElement.h>
  134. #include <LibWeb/HTML/HTMLIFrameElement.h>
  135. #include <LibWeb/HTML/HTMLImageElement.h>
  136. #include <LibWeb/HTML/HTMLInputElement.h>
  137. #include <LibWeb/HTML/HTMLLIElement.h>
  138. #include <LibWeb/HTML/HTMLLabelElement.h>
  139. #include <LibWeb/HTML/HTMLLegendElement.h>
  140. #include <LibWeb/HTML/HTMLLinkElement.h>
  141. #include <LibWeb/HTML/HTMLMapElement.h>
  142. #include <LibWeb/HTML/HTMLMarqueeElement.h>
  143. #include <LibWeb/HTML/HTMLMenuElement.h>
  144. #include <LibWeb/HTML/HTMLMetaElement.h>
  145. #include <LibWeb/HTML/HTMLMeterElement.h>
  146. #include <LibWeb/HTML/HTMLModElement.h>
  147. #include <LibWeb/HTML/HTMLOListElement.h>
  148. #include <LibWeb/HTML/HTMLObjectElement.h>
  149. #include <LibWeb/HTML/HTMLOptGroupElement.h>
  150. #include <LibWeb/HTML/HTMLOptionElement.h>
  151. #include <LibWeb/HTML/HTMLOutputElement.h>
  152. #include <LibWeb/HTML/HTMLParagraphElement.h>
  153. #include <LibWeb/HTML/HTMLParamElement.h>
  154. #include <LibWeb/HTML/HTMLPictureElement.h>
  155. #include <LibWeb/HTML/HTMLPreElement.h>
  156. #include <LibWeb/HTML/HTMLProgressElement.h>
  157. #include <LibWeb/HTML/HTMLQuoteElement.h>
  158. #include <LibWeb/HTML/HTMLScriptElement.h>
  159. #include <LibWeb/HTML/HTMLSelectElement.h>
  160. #include <LibWeb/HTML/HTMLSlotElement.h>
  161. #include <LibWeb/HTML/HTMLSourceElement.h>
  162. #include <LibWeb/HTML/HTMLSpanElement.h>
  163. #include <LibWeb/HTML/HTMLStyleElement.h>
  164. #include <LibWeb/HTML/HTMLTableCaptionElement.h>
  165. #include <LibWeb/HTML/HTMLTableCellElement.h>
  166. #include <LibWeb/HTML/HTMLTableColElement.h>
  167. #include <LibWeb/HTML/HTMLTableElement.h>
  168. #include <LibWeb/HTML/HTMLTableRowElement.h>
  169. #include <LibWeb/HTML/HTMLTableSectionElement.h>
  170. #include <LibWeb/HTML/HTMLTemplateElement.h>
  171. #include <LibWeb/HTML/HTMLTextAreaElement.h>
  172. #include <LibWeb/HTML/HTMLTimeElement.h>
  173. #include <LibWeb/HTML/HTMLTitleElement.h>
  174. #include <LibWeb/HTML/HTMLTrackElement.h>
  175. #include <LibWeb/HTML/HTMLUListElement.h>
  176. #include <LibWeb/HTML/HTMLUnknownElement.h>
  177. #include <LibWeb/HTML/HTMLVideoElement.h>
  178. #include <LibWeb/SVG/SVGPathElement.h>
  179. #include <LibWeb/SVG/SVGSVGElement.h>
  180. namespace Web::Bindings {
  181. NodeWrapper* wrap(JS::GlobalObject& global_object, DOM::Node& node)
  182. {
  183. if (is<DOM::Document>(node))
  184. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::Document>(node)));
  185. if (is<DOM::DocumentType>(node))
  186. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::DocumentType>(node)));
  187. if (is<HTML::HTMLAnchorElement>(node))
  188. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLAnchorElement>(node)));
  189. if (is<HTML::HTMLAreaElement>(node))
  190. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLAreaElement>(node)));
  191. if (is<HTML::HTMLAudioElement>(node))
  192. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLAudioElement>(node)));
  193. if (is<HTML::HTMLBaseElement>(node))
  194. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLBaseElement>(node)));
  195. if (is<HTML::HTMLBodyElement>(node))
  196. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLBodyElement>(node)));
  197. if (is<HTML::HTMLBRElement>(node))
  198. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLBRElement>(node)));
  199. if (is<HTML::HTMLButtonElement>(node))
  200. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLButtonElement>(node)));
  201. if (is<HTML::HTMLCanvasElement>(node))
  202. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLCanvasElement>(node)));
  203. if (is<HTML::HTMLDataElement>(node))
  204. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLDataElement>(node)));
  205. if (is<HTML::HTMLDataListElement>(node))
  206. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLDataListElement>(node)));
  207. if (is<HTML::HTMLDetailsElement>(node))
  208. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLDetailsElement>(node)));
  209. if (is<HTML::HTMLDialogElement>(node))
  210. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLDialogElement>(node)));
  211. if (is<HTML::HTMLDirectoryElement>(node))
  212. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLDirectoryElement>(node)));
  213. if (is<HTML::HTMLDivElement>(node))
  214. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLDivElement>(node)));
  215. if (is<HTML::HTMLDListElement>(node))
  216. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLDListElement>(node)));
  217. if (is<HTML::HTMLEmbedElement>(node))
  218. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLEmbedElement>(node)));
  219. if (is<HTML::HTMLFieldSetElement>(node))
  220. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLFieldSetElement>(node)));
  221. if (is<HTML::HTMLFontElement>(node))
  222. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLFontElement>(node)));
  223. if (is<HTML::HTMLFormElement>(node))
  224. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLFormElement>(node)));
  225. if (is<HTML::HTMLFrameElement>(node))
  226. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLFrameElement>(node)));
  227. if (is<HTML::HTMLFrameSetElement>(node))
  228. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLFrameSetElement>(node)));
  229. if (is<HTML::HTMLHeadElement>(node))
  230. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLHeadElement>(node)));
  231. if (is<HTML::HTMLHeadingElement>(node))
  232. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLHeadingElement>(node)));
  233. if (is<HTML::HTMLHRElement>(node))
  234. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLHRElement>(node)));
  235. if (is<HTML::HTMLHtmlElement>(node))
  236. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLHtmlElement>(node)));
  237. if (is<HTML::HTMLIFrameElement>(node))
  238. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLIFrameElement>(node)));
  239. if (is<HTML::HTMLImageElement>(node))
  240. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLImageElement>(node)));
  241. if (is<HTML::HTMLInputElement>(node))
  242. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLInputElement>(node)));
  243. if (is<HTML::HTMLLabelElement>(node))
  244. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLLabelElement>(node)));
  245. if (is<HTML::HTMLLegendElement>(node))
  246. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLLegendElement>(node)));
  247. if (is<HTML::HTMLLIElement>(node))
  248. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLLIElement>(node)));
  249. if (is<HTML::HTMLLinkElement>(node))
  250. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLLinkElement>(node)));
  251. if (is<HTML::HTMLMapElement>(node))
  252. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLMapElement>(node)));
  253. if (is<HTML::HTMLMarqueeElement>(node))
  254. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLMarqueeElement>(node)));
  255. if (is<HTML::HTMLMenuElement>(node))
  256. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLMenuElement>(node)));
  257. if (is<HTML::HTMLMetaElement>(node))
  258. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLMetaElement>(node)));
  259. if (is<HTML::HTMLMeterElement>(node))
  260. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLMeterElement>(node)));
  261. if (is<HTML::HTMLModElement>(node))
  262. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLModElement>(node)));
  263. if (is<HTML::HTMLObjectElement>(node))
  264. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLObjectElement>(node)));
  265. if (is<HTML::HTMLOListElement>(node))
  266. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLOListElement>(node)));
  267. if (is<HTML::HTMLOptGroupElement>(node))
  268. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLOptGroupElement>(node)));
  269. if (is<HTML::HTMLOptionElement>(node))
  270. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLOptionElement>(node)));
  271. if (is<HTML::HTMLOutputElement>(node))
  272. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLOutputElement>(node)));
  273. if (is<HTML::HTMLParagraphElement>(node))
  274. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLParagraphElement>(node)));
  275. if (is<HTML::HTMLParamElement>(node))
  276. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLParamElement>(node)));
  277. if (is<HTML::HTMLPictureElement>(node))
  278. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLPictureElement>(node)));
  279. if (is<HTML::HTMLPreElement>(node))
  280. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLPreElement>(node)));
  281. if (is<HTML::HTMLProgressElement>(node))
  282. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLProgressElement>(node)));
  283. if (is<HTML::HTMLQuoteElement>(node))
  284. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLQuoteElement>(node)));
  285. if (is<HTML::HTMLScriptElement>(node))
  286. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLScriptElement>(node)));
  287. if (is<HTML::HTMLSelectElement>(node))
  288. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLSelectElement>(node)));
  289. if (is<HTML::HTMLSlotElement>(node))
  290. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLSlotElement>(node)));
  291. if (is<HTML::HTMLSourceElement>(node))
  292. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLSourceElement>(node)));
  293. if (is<HTML::HTMLSpanElement>(node))
  294. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLSpanElement>(node)));
  295. if (is<HTML::HTMLStyleElement>(node))
  296. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLStyleElement>(node)));
  297. if (is<HTML::HTMLTableCaptionElement>(node))
  298. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLTableCaptionElement>(node)));
  299. if (is<HTML::HTMLTableCellElement>(node))
  300. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLTableCellElement>(node)));
  301. if (is<HTML::HTMLTableColElement>(node))
  302. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLTableColElement>(node)));
  303. if (is<HTML::HTMLTableElement>(node))
  304. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLTableElement>(node)));
  305. if (is<HTML::HTMLTableRowElement>(node))
  306. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLTableRowElement>(node)));
  307. if (is<HTML::HTMLTableSectionElement>(node))
  308. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLTableSectionElement>(node)));
  309. if (is<HTML::HTMLTemplateElement>(node))
  310. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLTemplateElement>(node)));
  311. if (is<HTML::HTMLTextAreaElement>(node))
  312. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLTextAreaElement>(node)));
  313. if (is<HTML::HTMLTimeElement>(node))
  314. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLTimeElement>(node)));
  315. if (is<HTML::HTMLTitleElement>(node))
  316. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLTitleElement>(node)));
  317. if (is<HTML::HTMLTrackElement>(node))
  318. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLTrackElement>(node)));
  319. if (is<HTML::HTMLUListElement>(node))
  320. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLUListElement>(node)));
  321. if (is<HTML::HTMLUnknownElement>(node))
  322. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLUnknownElement>(node)));
  323. if (is<HTML::HTMLVideoElement>(node))
  324. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLVideoElement>(node)));
  325. if (is<HTML::HTMLElement>(node))
  326. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<HTML::HTMLElement>(node)));
  327. if (is<SVG::SVGSVGElement>(node))
  328. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<SVG::SVGSVGElement>(node)));
  329. if (is<SVG::SVGPathElement>(node))
  330. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<SVG::SVGPathElement>(node)));
  331. if (is<DOM::Element>(node))
  332. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::Element>(node)));
  333. if (is<DOM::DocumentFragment>(node))
  334. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::DocumentFragment>(node)));
  335. if (is<DOM::Comment>(node))
  336. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::Comment>(node)));
  337. if (is<DOM::Text>(node))
  338. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::Text>(node)));
  339. if (is<DOM::CharacterData>(node))
  340. return static_cast<NodeWrapper*>(wrap_impl(global_object, downcast<DOM::CharacterData>(node)));
  341. return static_cast<NodeWrapper*>(wrap_impl(global_object, node));
  342. }
  343. }