happy-dom 8.8.0 → 9.0.0

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.

Potentially problematic release.


This version of happy-dom might be problematic. Click here for more details.

Files changed (364) hide show
  1. package/README.md +2 -2
  2. package/lib/cookie/CookieJar.js +1 -1
  3. package/lib/cookie/CookieJar.js.map +1 -1
  4. package/lib/dom-token-list/DOMTokenList.js +24 -20
  5. package/lib/dom-token-list/DOMTokenList.js.map +1 -1
  6. package/lib/event/EventTarget.js +6 -3
  7. package/lib/event/EventTarget.js.map +1 -1
  8. package/lib/exception/DOMExceptionNameEnum.d.ts +5 -1
  9. package/lib/exception/DOMExceptionNameEnum.js +4 -0
  10. package/lib/exception/DOMExceptionNameEnum.js.map +1 -1
  11. package/lib/fetch/AbortController.d.ts +19 -0
  12. package/lib/fetch/AbortController.js +30 -0
  13. package/lib/fetch/AbortController.js.map +1 -0
  14. package/lib/fetch/AbortSignal.d.ts +25 -0
  15. package/lib/fetch/AbortSignal.js +51 -0
  16. package/lib/fetch/AbortSignal.js.map +1 -0
  17. package/lib/fetch/Fetch.d.ts +117 -0
  18. package/lib/fetch/Fetch.js +530 -0
  19. package/lib/fetch/Fetch.js.map +1 -0
  20. package/lib/fetch/Headers.d.ts +81 -3
  21. package/lib/fetch/Headers.js +139 -24
  22. package/lib/fetch/Headers.js.map +1 -1
  23. package/lib/fetch/Request.d.ts +56 -32
  24. package/lib/fetch/Request.js +165 -110
  25. package/lib/fetch/Request.js.map +1 -1
  26. package/lib/fetch/{ResourceFetchHandler.d.ts → ResourceFetch.d.ts} +1 -1
  27. package/lib/fetch/{ResourceFetchHandler.js → ResourceFetch.js} +5 -5
  28. package/lib/fetch/ResourceFetch.js.map +1 -0
  29. package/lib/fetch/Response.d.ts +60 -26
  30. package/lib/fetch/Response.js +196 -104
  31. package/lib/fetch/Response.js.map +1 -1
  32. package/lib/fetch/data-uri/DataURIParser.d.ts +20 -0
  33. package/lib/fetch/data-uri/DataURIParser.js +60 -0
  34. package/lib/fetch/data-uri/DataURIParser.js.map +1 -0
  35. package/lib/fetch/multipart/MultipartFormDataParser.d.ts +40 -0
  36. package/lib/fetch/multipart/MultipartFormDataParser.js +81 -0
  37. package/lib/fetch/multipart/MultipartFormDataParser.js.map +1 -0
  38. package/lib/fetch/multipart/MultipartReader.d.ts +49 -0
  39. package/lib/fetch/multipart/MultipartReader.js +178 -0
  40. package/lib/fetch/multipart/MultipartReader.js.map +1 -0
  41. package/lib/fetch/types/IHeaders.d.ts +71 -0
  42. package/lib/fetch/{IHeaders.js.map → types/IHeaders.js.map} +1 -1
  43. package/lib/fetch/types/IHeadersInit.js.map +1 -0
  44. package/lib/fetch/types/IRequest.d.ts +60 -0
  45. package/lib/fetch/{IRequest.js.map → types/IRequest.js.map} +1 -1
  46. package/lib/fetch/types/IRequestBody.d.ts +7 -0
  47. package/lib/fetch/{IBody.js → types/IRequestBody.js} +1 -1
  48. package/lib/fetch/types/IRequestBody.js.map +1 -0
  49. package/lib/fetch/types/IRequestCredentials.d.ts +2 -0
  50. package/lib/fetch/types/IRequestCredentials.js +3 -0
  51. package/lib/fetch/types/IRequestCredentials.js.map +1 -0
  52. package/lib/fetch/{RequestInfo.d.ts → types/IRequestInfo.d.ts} +2 -2
  53. package/lib/fetch/types/IRequestInfo.js +3 -0
  54. package/lib/fetch/types/IRequestInfo.js.map +1 -0
  55. package/lib/fetch/types/IRequestInit.d.ts +21 -0
  56. package/lib/fetch/types/IRequestInit.js.map +1 -0
  57. package/lib/fetch/types/IRequestRedirect.d.ts +2 -0
  58. package/lib/fetch/types/IRequestRedirect.js +3 -0
  59. package/lib/fetch/types/IRequestRedirect.js.map +1 -0
  60. package/lib/fetch/types/IRequestReferrerPolicy.d.ts +2 -0
  61. package/lib/fetch/types/IRequestReferrerPolicy.js +3 -0
  62. package/lib/fetch/types/IRequestReferrerPolicy.js.map +1 -0
  63. package/lib/fetch/types/IResponse.d.ts +27 -0
  64. package/lib/fetch/{IResponse.js.map → types/IResponse.js.map} +1 -1
  65. package/lib/fetch/types/IResponseBody.d.ts +7 -0
  66. package/lib/fetch/types/IResponseBody.js +3 -0
  67. package/lib/fetch/types/IResponseBody.js.map +1 -0
  68. package/lib/fetch/types/IResponseInit.d.ts +9 -0
  69. package/lib/fetch/types/IResponseInit.js.map +1 -0
  70. package/lib/fetch/utilities/FetchBodyUtility.d.ts +44 -0
  71. package/lib/fetch/utilities/FetchBodyUtility.js +156 -0
  72. package/lib/fetch/utilities/FetchBodyUtility.js.map +1 -0
  73. package/lib/fetch/utilities/FetchCORSUtility.d.ts +12 -0
  74. package/lib/fetch/utilities/FetchCORSUtility.js +20 -0
  75. package/lib/fetch/utilities/FetchCORSUtility.js.map +1 -0
  76. package/lib/fetch/utilities/FetchRequestHeaderUtility.d.ts +12 -0
  77. package/lib/fetch/utilities/FetchRequestHeaderUtility.js +45 -0
  78. package/lib/fetch/utilities/FetchRequestHeaderUtility.js.map +1 -0
  79. package/lib/fetch/utilities/FetchRequestReferrerUtility.d.ts +55 -0
  80. package/lib/fetch/utilities/FetchRequestReferrerUtility.js +194 -0
  81. package/lib/fetch/utilities/FetchRequestReferrerUtility.js.map +1 -0
  82. package/lib/fetch/utilities/FetchRequestValidationUtility.d.ts +38 -0
  83. package/lib/fetch/utilities/FetchRequestValidationUtility.js +70 -0
  84. package/lib/fetch/utilities/FetchRequestValidationUtility.js.map +1 -0
  85. package/lib/file/Blob.d.ts +2 -2
  86. package/lib/file/Blob.js +1 -1
  87. package/lib/file/Blob.js.map +1 -1
  88. package/lib/file/File.d.ts +2 -1
  89. package/lib/file/File.js.map +1 -1
  90. package/lib/form-data/FormData.d.ts +98 -0
  91. package/lib/form-data/FormData.js +212 -0
  92. package/lib/form-data/FormData.js.map +1 -0
  93. package/lib/index.d.ts +14 -1
  94. package/lib/index.js +20 -2
  95. package/lib/index.js.map +1 -1
  96. package/lib/nodes/document/Document.d.ts +5 -17
  97. package/lib/nodes/document/Document.js +11 -54
  98. package/lib/nodes/document/Document.js.map +1 -1
  99. package/lib/nodes/document/IDocument.d.ts +1 -1
  100. package/lib/nodes/document-fragment/DocumentFragment.d.ts +3 -14
  101. package/lib/nodes/document-fragment/DocumentFragment.js +7 -51
  102. package/lib/nodes/document-fragment/DocumentFragment.js.map +1 -1
  103. package/lib/nodes/document-fragment/IDocumentFragment.d.ts +2 -1
  104. package/lib/nodes/element/Element.d.ts +8 -8
  105. package/lib/nodes/element/Element.js +28 -45
  106. package/lib/nodes/element/Element.js.map +1 -1
  107. package/lib/nodes/element/ElementUtility.d.ts +32 -0
  108. package/lib/nodes/element/ElementUtility.js +105 -0
  109. package/lib/nodes/element/ElementUtility.js.map +1 -0
  110. package/lib/nodes/element/HTMLCollection.d.ts +26 -3
  111. package/lib/nodes/element/HTMLCollection.js +51 -0
  112. package/lib/nodes/element/HTMLCollection.js.map +1 -1
  113. package/lib/nodes/element/IHTMLCollection.d.ts +9 -2
  114. package/lib/nodes/html-anchor-element/HTMLAnchorElement.js +24 -24
  115. package/lib/nodes/html-anchor-element/HTMLAnchorElement.js.map +1 -1
  116. package/lib/nodes/html-audio-element/Audio.d.ts +15 -0
  117. package/lib/nodes/html-audio-element/Audio.js +27 -0
  118. package/lib/nodes/html-audio-element/Audio.js.map +1 -0
  119. package/lib/nodes/html-base-element/HTMLBaseElement.js +4 -4
  120. package/lib/nodes/html-base-element/HTMLBaseElement.js.map +1 -1
  121. package/lib/nodes/html-button-element/HTMLButtonElement.d.ts +79 -3
  122. package/lib/nodes/html-button-element/HTMLButtonElement.js +158 -10
  123. package/lib/nodes/html-button-element/HTMLButtonElement.js.map +1 -1
  124. package/lib/nodes/html-button-element/IHTMLButtonElement.d.ts +28 -2
  125. package/lib/nodes/html-dialog-element/HTMLDialogElement.js +3 -3
  126. package/lib/nodes/html-dialog-element/HTMLDialogElement.js.map +1 -1
  127. package/lib/nodes/html-element/HTMLElement.js +12 -12
  128. package/lib/nodes/html-element/HTMLElement.js.map +1 -1
  129. package/lib/nodes/html-form-element/HTMLFormControlsCollection.d.ts +32 -0
  130. package/lib/nodes/html-form-element/HTMLFormControlsCollection.js +58 -0
  131. package/lib/nodes/html-form-element/HTMLFormControlsCollection.js.map +1 -0
  132. package/lib/nodes/html-form-element/HTMLFormElement.d.ts +37 -17
  133. package/lib/nodes/html-form-element/HTMLFormElement.js +128 -37
  134. package/lib/nodes/html-form-element/HTMLFormElement.js.map +1 -1
  135. package/lib/nodes/html-form-element/IHTMLFormControlsCollection.d.ts +25 -0
  136. package/lib/nodes/html-form-element/IHTMLFormControlsCollection.js +3 -0
  137. package/lib/nodes/html-form-element/IHTMLFormControlsCollection.js.map +1 -0
  138. package/lib/nodes/html-form-element/IHTMLFormElement.d.ts +16 -6
  139. package/lib/nodes/html-form-element/IRadioNodeList.d.ts +15 -0
  140. package/lib/nodes/html-form-element/IRadioNodeList.js +3 -0
  141. package/lib/nodes/html-form-element/IRadioNodeList.js.map +1 -0
  142. package/lib/nodes/html-form-element/RadioNodeList.d.ts +16 -0
  143. package/lib/nodes/html-form-element/RadioNodeList.js +28 -0
  144. package/lib/nodes/html-form-element/RadioNodeList.js.map +1 -0
  145. package/lib/nodes/html-image-element/HTMLImageElement.js +19 -19
  146. package/lib/nodes/html-image-element/HTMLImageElement.js.map +1 -1
  147. package/lib/nodes/html-input-element/HTMLInputElement.d.ts +43 -19
  148. package/lib/nodes/html-input-element/HTMLInputElement.js +206 -111
  149. package/lib/nodes/html-input-element/HTMLInputElement.js.map +1 -1
  150. package/lib/nodes/html-input-element/IHTMLInputElement.d.ts +14 -1
  151. package/lib/nodes/html-label-element/HTMLLabelElement.js +3 -7
  152. package/lib/nodes/html-label-element/HTMLLabelElement.js.map +1 -1
  153. package/lib/nodes/html-link-element/HTMLLinkElement.js +21 -21
  154. package/lib/nodes/html-link-element/HTMLLinkElement.js.map +1 -1
  155. package/lib/nodes/html-media-element/HTMLMediaElement.js +21 -21
  156. package/lib/nodes/html-media-element/HTMLMediaElement.js.map +1 -1
  157. package/lib/nodes/html-meta-element/HTMLMetaElement.js +8 -8
  158. package/lib/nodes/html-meta-element/HTMLMetaElement.js.map +1 -1
  159. package/lib/nodes/html-opt-group-element/HTMLOptGroupElement.js +6 -6
  160. package/lib/nodes/html-opt-group-element/HTMLOptGroupElement.js.map +1 -1
  161. package/lib/nodes/html-option-element/HTMLOptionElement.d.ts +3 -4
  162. package/lib/nodes/html-option-element/HTMLOptionElement.js +26 -29
  163. package/lib/nodes/html-option-element/HTMLOptionElement.js.map +1 -1
  164. package/lib/nodes/html-script-element/HTMLScriptElement.js +16 -16
  165. package/lib/nodes/html-script-element/HTMLScriptElement.js.map +1 -1
  166. package/lib/nodes/html-script-element/ScriptUtility.js +5 -5
  167. package/lib/nodes/html-script-element/ScriptUtility.js.map +1 -1
  168. package/lib/nodes/{html-option-element → html-select-element}/HTMLOptionsCollection.d.ts +5 -6
  169. package/lib/nodes/{html-option-element → html-select-element}/HTMLOptionsCollection.js.map +1 -1
  170. package/lib/nodes/html-select-element/HTMLSelectElement.d.ts +42 -41
  171. package/lib/nodes/html-select-element/HTMLSelectElement.js +134 -138
  172. package/lib/nodes/html-select-element/HTMLSelectElement.js.map +1 -1
  173. package/lib/nodes/{html-option-element → html-select-element}/IHTMLOptionsCollection.d.ts +4 -5
  174. package/lib/nodes/html-select-element/IHTMLOptionsCollection.js.map +1 -0
  175. package/lib/nodes/html-select-element/IHTMLSelectElement.d.ts +22 -2
  176. package/lib/nodes/html-slot-element/HTMLSlotElement.js +2 -2
  177. package/lib/nodes/html-slot-element/HTMLSlotElement.js.map +1 -1
  178. package/lib/nodes/html-style-element/HTMLStyleElement.js +7 -7
  179. package/lib/nodes/html-style-element/HTMLStyleElement.js.map +1 -1
  180. package/lib/nodes/html-text-area-element/HTMLTextAreaElement.d.ts +55 -2
  181. package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js +150 -40
  182. package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js.map +1 -1
  183. package/lib/nodes/html-text-area-element/IHTMLTextAreaElement.d.ts +16 -0
  184. package/lib/nodes/node/Node.d.ts +12 -1
  185. package/lib/nodes/node/Node.js +50 -4
  186. package/lib/nodes/node/Node.js.map +1 -1
  187. package/lib/nodes/node/NodeList.d.ts +2 -3
  188. package/lib/nodes/node/NodeList.js.map +1 -1
  189. package/lib/nodes/parent-node/IParentNode.d.ts +4 -4
  190. package/lib/nodes/parent-node/ParentNodeUtility.d.ts +3 -3
  191. package/lib/nodes/parent-node/ParentNodeUtility.js +13 -11
  192. package/lib/nodes/parent-node/ParentNodeUtility.js.map +1 -1
  193. package/lib/nodes/text/Text.d.ts +13 -0
  194. package/lib/nodes/text/Text.js +30 -0
  195. package/lib/nodes/text/Text.js.map +1 -1
  196. package/lib/query-selector/QuerySelector.js +2 -2
  197. package/lib/query-selector/QuerySelector.js.map +1 -1
  198. package/lib/query-selector/SelectorItem.js +2 -0
  199. package/lib/query-selector/SelectorItem.js.map +1 -1
  200. package/lib/validity-state/ValidityState.d.ts +87 -0
  201. package/lib/validity-state/ValidityState.js +171 -0
  202. package/lib/validity-state/ValidityState.js.map +1 -0
  203. package/lib/window/GlobalWindow.d.ts +0 -8
  204. package/lib/window/GlobalWindow.js +0 -2
  205. package/lib/window/GlobalWindow.js.map +1 -1
  206. package/lib/window/INodeJSGlobal.d.ts +71 -0
  207. package/lib/window/INodeJSGlobal.js +2 -0
  208. package/lib/window/INodeJSGlobal.js.map +1 -0
  209. package/lib/window/IWindow.d.ts +30 -10
  210. package/lib/window/Window.d.ts +37 -20
  211. package/lib/window/Window.js +22 -10
  212. package/lib/window/Window.js.map +1 -1
  213. package/lib/xml-http-request/XMLHttpRequest.js +20 -12
  214. package/lib/xml-http-request/XMLHttpRequest.js.map +1 -1
  215. package/lib/xml-parser/XMLParser.js +1 -1
  216. package/lib/xml-parser/XMLParser.js.map +1 -1
  217. package/package.json +2 -3
  218. package/src/cookie/CookieJar.ts +1 -1
  219. package/src/dom-token-list/DOMTokenList.ts +24 -20
  220. package/src/event/EventTarget.ts +7 -3
  221. package/src/exception/DOMExceptionNameEnum.ts +5 -1
  222. package/src/fetch/AbortController.ts +26 -0
  223. package/src/fetch/AbortSignal.ts +44 -0
  224. package/src/fetch/Fetch.ts +666 -0
  225. package/src/fetch/Headers.ts +151 -3
  226. package/src/fetch/Request.ts +226 -94
  227. package/src/fetch/{ResourceFetchHandler.ts → ResourceFetch.ts} +3 -3
  228. package/src/fetch/Response.ts +252 -89
  229. package/src/fetch/data-uri/DataURIParser.ts +66 -0
  230. package/src/fetch/multipart/MultipartFormDataParser.ts +113 -0
  231. package/src/fetch/multipart/MultipartReader.ts +217 -0
  232. package/src/fetch/types/IHeaders.ts +80 -0
  233. package/src/fetch/types/IRequest.ts +65 -0
  234. package/src/fetch/types/IRequestBody.ts +15 -0
  235. package/src/fetch/types/IRequestCredentials.ts +2 -0
  236. package/src/fetch/types/IRequestInfo.ts +6 -0
  237. package/src/fetch/types/IRequestInit.ts +21 -0
  238. package/src/fetch/types/IRequestRedirect.ts +3 -0
  239. package/src/fetch/types/IRequestReferrerPolicy.ts +11 -0
  240. package/src/fetch/types/IResponse.ts +27 -0
  241. package/src/fetch/types/IResponseBody.ts +15 -0
  242. package/src/fetch/types/IResponseInit.ts +10 -0
  243. package/src/fetch/utilities/FetchBodyUtility.ts +175 -0
  244. package/src/fetch/utilities/FetchCORSUtility.ts +18 -0
  245. package/src/fetch/utilities/FetchRequestHeaderUtility.ts +47 -0
  246. package/src/fetch/utilities/FetchRequestReferrerUtility.ts +241 -0
  247. package/src/fetch/utilities/FetchRequestValidationUtility.ts +82 -0
  248. package/src/file/Blob.ts +2 -2
  249. package/src/file/File.ts +5 -1
  250. package/src/form-data/FormData.ts +237 -0
  251. package/src/index.ts +27 -1
  252. package/src/nodes/document/Document.ts +23 -64
  253. package/src/nodes/document/IDocument.ts +1 -1
  254. package/src/nodes/document-fragment/DocumentFragment.ts +9 -59
  255. package/src/nodes/document-fragment/IDocumentFragment.ts +2 -1
  256. package/src/nodes/element/Element.ts +43 -56
  257. package/src/nodes/element/ElementUtility.ts +137 -0
  258. package/src/nodes/element/HTMLCollection.ts +60 -3
  259. package/src/nodes/element/IHTMLCollection.ts +10 -2
  260. package/src/nodes/html-anchor-element/HTMLAnchorElement.ts +24 -24
  261. package/src/nodes/html-audio-element/Audio.ts +22 -0
  262. package/src/nodes/html-base-element/HTMLBaseElement.ts +4 -4
  263. package/src/nodes/html-button-element/HTMLButtonElement.ts +184 -10
  264. package/src/nodes/html-button-element/IHTMLButtonElement.ts +31 -2
  265. package/src/nodes/html-dialog-element/HTMLDialogElement.ts +3 -3
  266. package/src/nodes/html-element/HTMLElement.ts +12 -12
  267. package/src/nodes/html-form-element/HTMLFormControlsCollection.ts +76 -0
  268. package/src/nodes/html-form-element/HTMLFormElement.ts +147 -41
  269. package/src/nodes/html-form-element/IHTMLFormControlsCollection.ts +45 -0
  270. package/src/nodes/html-form-element/IHTMLFormElement.ts +17 -6
  271. package/src/nodes/html-form-element/IRadioNodeList.ts +16 -0
  272. package/src/nodes/html-form-element/RadioNodeList.ts +24 -0
  273. package/src/nodes/html-image-element/HTMLImageElement.ts +19 -19
  274. package/src/nodes/html-input-element/HTMLInputElement.ts +232 -113
  275. package/src/nodes/html-input-element/IHTMLInputElement.ts +20 -1
  276. package/src/nodes/html-label-element/HTMLLabelElement.ts +3 -7
  277. package/src/nodes/html-link-element/HTMLLinkElement.ts +21 -21
  278. package/src/nodes/html-media-element/HTMLMediaElement.ts +21 -21
  279. package/src/nodes/html-meta-element/HTMLMetaElement.ts +8 -8
  280. package/src/nodes/html-opt-group-element/HTMLOptGroupElement.ts +6 -6
  281. package/src/nodes/html-option-element/HTMLOptionElement.ts +29 -30
  282. package/src/nodes/html-script-element/HTMLScriptElement.ts +16 -16
  283. package/src/nodes/html-script-element/ScriptUtility.ts +5 -5
  284. package/src/nodes/{html-option-element → html-select-element}/HTMLOptionsCollection.ts +5 -9
  285. package/src/nodes/html-select-element/HTMLSelectElement.ts +159 -170
  286. package/src/nodes/{html-option-element → html-select-element}/IHTMLOptionsCollection.ts +4 -8
  287. package/src/nodes/html-select-element/IHTMLSelectElement.ts +25 -2
  288. package/src/nodes/html-slot-element/HTMLSlotElement.ts +2 -2
  289. package/src/nodes/html-style-element/HTMLStyleElement.ts +7 -7
  290. package/src/nodes/html-text-area-element/HTMLTextAreaElement.ts +174 -41
  291. package/src/nodes/html-text-area-element/IHTMLTextAreaElement.ts +18 -0
  292. package/src/nodes/node/Node.ts +61 -6
  293. package/src/nodes/node/NodeList.ts +2 -3
  294. package/src/nodes/parent-node/IParentNode.ts +7 -4
  295. package/src/nodes/parent-node/ParentNodeUtility.ts +25 -15
  296. package/src/nodes/text/Text.ts +38 -0
  297. package/src/query-selector/QuerySelector.ts +2 -2
  298. package/src/query-selector/SelectorItem.ts +3 -0
  299. package/src/validity-state/ValidityState.ts +211 -0
  300. package/src/window/GlobalWindow.ts +0 -2
  301. package/src/window/INodeJSGlobal.ts +70 -0
  302. package/src/window/IWindow.ts +32 -10
  303. package/src/window/Window.ts +43 -21
  304. package/src/xml-http-request/XMLHttpRequest.ts +27 -26
  305. package/src/xml-parser/XMLParser.ts +1 -1
  306. package/lib/fetch/FetchHandler.d.ts +0 -18
  307. package/lib/fetch/FetchHandler.js +0 -83
  308. package/lib/fetch/FetchHandler.js.map +0 -1
  309. package/lib/fetch/IAbortSignal.d.ts +0 -16
  310. package/lib/fetch/IAbortSignal.js +0 -4
  311. package/lib/fetch/IAbortSignal.js.map +0 -1
  312. package/lib/fetch/IBody.d.ts +0 -17
  313. package/lib/fetch/IBody.js.map +0 -1
  314. package/lib/fetch/IHeaders.d.ts +0 -18
  315. package/lib/fetch/IHeadersInit.js.map +0 -1
  316. package/lib/fetch/IRequest.d.ts +0 -18
  317. package/lib/fetch/IRequestInit.d.ts +0 -16
  318. package/lib/fetch/IRequestInit.js.map +0 -1
  319. package/lib/fetch/IResponse.d.ts +0 -20
  320. package/lib/fetch/IResponseInit.d.ts +0 -9
  321. package/lib/fetch/IResponseInit.js.map +0 -1
  322. package/lib/fetch/RequestInfo.js +0 -3
  323. package/lib/fetch/RequestInfo.js.map +0 -1
  324. package/lib/fetch/ResourceFetchHandler.js.map +0 -1
  325. package/lib/form-data/IFormData.d.ts +0 -32
  326. package/lib/form-data/IFormData.js +0 -3
  327. package/lib/form-data/IFormData.js.map +0 -1
  328. package/lib/location/RelativeURL.d.ts +0 -15
  329. package/lib/location/RelativeURL.js +0 -19
  330. package/lib/location/RelativeURL.js.map +0 -1
  331. package/lib/nodes/element/HTMLCollectionFactory.d.ts +0 -21
  332. package/lib/nodes/element/HTMLCollectionFactory.js +0 -31
  333. package/lib/nodes/element/HTMLCollectionFactory.js.map +0 -1
  334. package/lib/nodes/html-option-element/IHTMLOptionsCollection.js.map +0 -1
  335. package/lib/nodes/node/NodeListFactory.d.ts +0 -21
  336. package/lib/nodes/node/NodeListFactory.js +0 -31
  337. package/lib/nodes/node/NodeListFactory.js.map +0 -1
  338. package/lib/nodes/validity-state/ValidityState.d.ts +0 -52
  339. package/lib/nodes/validity-state/ValidityState.js +0 -81
  340. package/lib/nodes/validity-state/ValidityState.js.map +0 -1
  341. package/src/fetch/FetchHandler.ts +0 -90
  342. package/src/fetch/IAbortSignal.ts +0 -34
  343. package/src/fetch/IBody.ts +0 -18
  344. package/src/fetch/IHeaders.ts +0 -18
  345. package/src/fetch/IRequest.ts +0 -59
  346. package/src/fetch/IRequestInit.ts +0 -41
  347. package/src/fetch/IResponse.ts +0 -22
  348. package/src/fetch/IResponseInit.ts +0 -10
  349. package/src/fetch/RequestInfo.ts +0 -6
  350. package/src/form-data/IFormData.ts +0 -33
  351. package/src/location/RelativeURL.ts +0 -17
  352. package/src/nodes/element/HTMLCollectionFactory.ts +0 -31
  353. package/src/nodes/node/NodeListFactory.ts +0 -31
  354. package/src/nodes/validity-state/ValidityState.ts +0 -84
  355. /package/lib/fetch/{IHeaders.js → types/IHeaders.js} +0 -0
  356. /package/lib/fetch/{IHeadersInit.d.ts → types/IHeadersInit.d.ts} +0 -0
  357. /package/lib/fetch/{IHeadersInit.js → types/IHeadersInit.js} +0 -0
  358. /package/lib/fetch/{IRequest.js → types/IRequest.js} +0 -0
  359. /package/lib/fetch/{IRequestInit.js → types/IRequestInit.js} +0 -0
  360. /package/lib/fetch/{IResponse.js → types/IResponse.js} +0 -0
  361. /package/lib/fetch/{IResponseInit.js → types/IResponseInit.js} +0 -0
  362. /package/lib/nodes/{html-option-element → html-select-element}/HTMLOptionsCollection.js +0 -0
  363. /package/lib/nodes/{html-option-element → html-select-element}/IHTMLOptionsCollection.js +0 -0
  364. /package/src/fetch/{IHeadersInit.ts → types/IHeadersInit.ts} +0 -0
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const HTMLElement_1 = __importDefault(require("../html-element/HTMLElement"));
7
- const ValidityState_1 = __importDefault(require("../validity-state/ValidityState"));
7
+ const ValidityState_1 = __importDefault(require("../../validity-state/ValidityState"));
8
8
  const DOMException_1 = __importDefault(require("../../exception/DOMException"));
9
9
  const DOMExceptionNameEnum_1 = __importDefault(require("../../exception/DOMExceptionNameEnum"));
10
10
  const Event_1 = __importDefault(require("../../event/Event"));
@@ -13,6 +13,7 @@ const HTMLInputElementSelectionModeEnum_1 = __importDefault(require("./HTMLInput
13
13
  const HTMLInputElementSelectionDirectionEnum_1 = __importDefault(require("./HTMLInputElementSelectionDirectionEnum"));
14
14
  const HTMLInputElementValueStepping_1 = __importDefault(require("./HTMLInputElementValueStepping"));
15
15
  const FileList_1 = __importDefault(require("./FileList"));
16
+ const NodeList_1 = __importDefault(require("../node/NodeList"));
16
17
  /**
17
18
  * HTML Input Element.
18
19
  *
@@ -28,15 +29,18 @@ class HTMLInputElement extends HTMLElement_1.default {
28
29
  // Related to parent form.
29
30
  this.formAction = '';
30
31
  this.formMethod = '';
31
- this.formNoValidate = false;
32
32
  // Any type of input
33
33
  this._value = null;
34
34
  this._height = 0;
35
35
  this._width = 0;
36
36
  // Type specific: checkbox/radio
37
37
  this.defaultChecked = false;
38
+ this._checked = null;
38
39
  // Type specific: file
39
40
  this.files = new FileList_1.default();
41
+ // All fields
42
+ this.validationMessage = '';
43
+ this.validity = new ValidityState_1.default(this);
40
44
  // Events
41
45
  this.oninput = null;
42
46
  this.oninvalid = null;
@@ -45,7 +49,6 @@ class HTMLInputElement extends HTMLElement_1.default {
45
49
  this._selectionStart = null;
46
50
  this._selectionEnd = null;
47
51
  this._selectionDirection = HTMLInputElementSelectionDirectionEnum_1.default.none;
48
- this._validationMessage = '';
49
52
  }
50
53
  /**
51
54
  * Returns height.
@@ -62,7 +65,7 @@ class HTMLInputElement extends HTMLElement_1.default {
62
65
  */
63
66
  set height(height) {
64
67
  this._height = height;
65
- this.setAttributeNS(null, 'height', String(height));
68
+ this.setAttribute('height', String(height));
66
69
  }
67
70
  /**
68
71
  * Returns width.
@@ -79,7 +82,7 @@ class HTMLInputElement extends HTMLElement_1.default {
79
82
  */
80
83
  set width(width) {
81
84
  this._width = width;
82
- this.setAttributeNS(null, 'width', String(width));
85
+ this.setAttribute('width', String(width));
83
86
  }
84
87
  /**
85
88
  * Returns size.
@@ -87,7 +90,7 @@ class HTMLInputElement extends HTMLElement_1.default {
87
90
  * @returns Size.
88
91
  */
89
92
  get size() {
90
- const size = this.getAttributeNS(null, 'size');
93
+ const size = this.getAttribute('size');
91
94
  if (size !== null) {
92
95
  return parseInt(size);
93
96
  }
@@ -99,7 +102,7 @@ class HTMLInputElement extends HTMLElement_1.default {
99
102
  * @param size Size.
100
103
  */
101
104
  set size(size) {
102
- this.setAttributeNS(null, 'size', String(size));
105
+ this.setAttribute('size', String(size));
103
106
  }
104
107
  /**
105
108
  * Returns minlength.
@@ -107,7 +110,7 @@ class HTMLInputElement extends HTMLElement_1.default {
107
110
  * @returns Min length.
108
111
  */
109
112
  get minLength() {
110
- const minLength = this.getAttributeNS(null, 'minlength');
113
+ const minLength = this.getAttribute('minlength');
111
114
  if (minLength !== null) {
112
115
  return parseInt(minLength);
113
116
  }
@@ -119,7 +122,7 @@ class HTMLInputElement extends HTMLElement_1.default {
119
122
  * @param minLength Min length.
120
123
  */
121
124
  set minLength(minlength) {
122
- this.setAttributeNS(null, 'minlength', String(minlength));
125
+ this.setAttribute('minlength', String(minlength));
123
126
  }
124
127
  /**
125
128
  * Returns maxlength.
@@ -127,7 +130,7 @@ class HTMLInputElement extends HTMLElement_1.default {
127
130
  * @returns Max length.
128
131
  */
129
132
  get maxLength() {
130
- const maxLength = this.getAttributeNS(null, 'maxlength');
133
+ const maxLength = this.getAttribute('maxlength');
131
134
  if (maxLength !== null) {
132
135
  return parseInt(maxLength);
133
136
  }
@@ -139,7 +142,7 @@ class HTMLInputElement extends HTMLElement_1.default {
139
142
  * @param maxlength Max length.
140
143
  */
141
144
  set maxLength(maxLength) {
142
- this.setAttributeNS(null, 'maxlength', String(maxLength));
145
+ this.setAttribute('maxlength', String(maxLength));
143
146
  }
144
147
  /**
145
148
  * Returns type.
@@ -147,7 +150,7 @@ class HTMLInputElement extends HTMLElement_1.default {
147
150
  * @returns Type. Defaults to "text".
148
151
  */
149
152
  get type() {
150
- return this.getAttributeNS(null, 'type') || 'text';
153
+ return this.getAttribute('type') || 'text';
151
154
  }
152
155
  /**
153
156
  * Sets type.
@@ -155,7 +158,7 @@ class HTMLInputElement extends HTMLElement_1.default {
155
158
  * @param type Type.
156
159
  */
157
160
  set type(type) {
158
- this.setAttributeNS(null, 'type', type.toLowerCase());
161
+ this.setAttribute('type', type.toLowerCase());
159
162
  }
160
163
  /**
161
164
  * Returns name.
@@ -163,7 +166,7 @@ class HTMLInputElement extends HTMLElement_1.default {
163
166
  * @returns Name.
164
167
  */
165
168
  get name() {
166
- return this.getAttributeNS(null, 'name') || '';
169
+ return this.getAttribute('name') || '';
167
170
  }
168
171
  /**
169
172
  * Sets name.
@@ -171,7 +174,7 @@ class HTMLInputElement extends HTMLElement_1.default {
171
174
  * @param name Name.
172
175
  */
173
176
  set name(name) {
174
- this.setAttributeNS(null, 'name', name);
177
+ this.setAttribute('name', name);
175
178
  }
176
179
  /**
177
180
  * Returns alt.
@@ -179,7 +182,7 @@ class HTMLInputElement extends HTMLElement_1.default {
179
182
  * @returns Alt.
180
183
  */
181
184
  get alt() {
182
- return this.getAttributeNS(null, 'alt') || '';
185
+ return this.getAttribute('alt') || '';
183
186
  }
184
187
  /**
185
188
  * Sets alt.
@@ -187,7 +190,7 @@ class HTMLInputElement extends HTMLElement_1.default {
187
190
  * @param alt Alt.
188
191
  */
189
192
  set alt(alt) {
190
- this.setAttributeNS(null, 'alt', alt);
193
+ this.setAttribute('alt', alt);
191
194
  }
192
195
  /**
193
196
  * Returns min.
@@ -195,7 +198,7 @@ class HTMLInputElement extends HTMLElement_1.default {
195
198
  * @returns Min.
196
199
  */
197
200
  get min() {
198
- return this.getAttributeNS(null, 'min') || '';
201
+ return this.getAttribute('min') || '';
199
202
  }
200
203
  /**
201
204
  * Sets min.
@@ -203,7 +206,7 @@ class HTMLInputElement extends HTMLElement_1.default {
203
206
  * @param min Min.
204
207
  */
205
208
  set min(min) {
206
- this.setAttributeNS(null, 'min', min);
209
+ this.setAttribute('min', min);
207
210
  }
208
211
  /**
209
212
  * Returns max.
@@ -211,7 +214,7 @@ class HTMLInputElement extends HTMLElement_1.default {
211
214
  * @returns Max.
212
215
  */
213
216
  get max() {
214
- return this.getAttributeNS(null, 'max') || '';
217
+ return this.getAttribute('max') || '';
215
218
  }
216
219
  /**
217
220
  * Sets max.
@@ -219,7 +222,7 @@ class HTMLInputElement extends HTMLElement_1.default {
219
222
  * @param max Max.
220
223
  */
221
224
  set max(max) {
222
- this.setAttributeNS(null, 'max', max);
225
+ this.setAttribute('max', max);
223
226
  }
224
227
  /**
225
228
  * Returns pattern.
@@ -227,7 +230,7 @@ class HTMLInputElement extends HTMLElement_1.default {
227
230
  * @returns Pattern.
228
231
  */
229
232
  get pattern() {
230
- return this.getAttributeNS(null, 'pattern') || '';
233
+ return this.getAttribute('pattern') || '';
231
234
  }
232
235
  /**
233
236
  * Sets pattern.
@@ -235,7 +238,7 @@ class HTMLInputElement extends HTMLElement_1.default {
235
238
  * @param pattern Pattern.
236
239
  */
237
240
  set pattern(pattern) {
238
- this.setAttributeNS(null, 'pattern', pattern);
241
+ this.setAttribute('pattern', pattern);
239
242
  }
240
243
  /**
241
244
  * Returns placeholder.
@@ -243,7 +246,7 @@ class HTMLInputElement extends HTMLElement_1.default {
243
246
  * @returns Placeholder.
244
247
  */
245
248
  get placeholder() {
246
- return this.getAttributeNS(null, 'placeholder') || '';
249
+ return this.getAttribute('placeholder') || '';
247
250
  }
248
251
  /**
249
252
  * Sets placeholder.
@@ -251,7 +254,7 @@ class HTMLInputElement extends HTMLElement_1.default {
251
254
  * @param placeholder Placeholder.
252
255
  */
253
256
  set placeholder(placeholder) {
254
- this.setAttributeNS(null, 'placeholder', placeholder);
257
+ this.setAttribute('placeholder', placeholder);
255
258
  }
256
259
  /**
257
260
  * Returns step.
@@ -259,7 +262,7 @@ class HTMLInputElement extends HTMLElement_1.default {
259
262
  * @returns Step.
260
263
  */
261
264
  get step() {
262
- return this.getAttributeNS(null, 'step') || '';
265
+ return this.getAttribute('step') || '';
263
266
  }
264
267
  /**
265
268
  * Sets step.
@@ -267,7 +270,7 @@ class HTMLInputElement extends HTMLElement_1.default {
267
270
  * @param step Step.
268
271
  */
269
272
  set step(step) {
270
- this.setAttributeNS(null, 'step', step);
273
+ this.setAttribute('step', step);
271
274
  }
272
275
  /**
273
276
  * Returns inputmode.
@@ -275,7 +278,7 @@ class HTMLInputElement extends HTMLElement_1.default {
275
278
  * @returns Inputmode.
276
279
  */
277
280
  get inputmode() {
278
- return this.getAttributeNS(null, 'inputmode') || '';
281
+ return this.getAttribute('inputmode') || '';
279
282
  }
280
283
  /**
281
284
  * Sets inputmode.
@@ -283,7 +286,7 @@ class HTMLInputElement extends HTMLElement_1.default {
283
286
  * @param inputmode Inputmode.
284
287
  */
285
288
  set inputmode(inputmode) {
286
- this.setAttributeNS(null, 'inputmode', inputmode);
289
+ this.setAttribute('inputmode', inputmode);
287
290
  }
288
291
  /**
289
292
  * Returns accept.
@@ -291,7 +294,7 @@ class HTMLInputElement extends HTMLElement_1.default {
291
294
  * @returns Accept.
292
295
  */
293
296
  get accept() {
294
- return this.getAttributeNS(null, 'accept') || '';
297
+ return this.getAttribute('accept') || '';
295
298
  }
296
299
  /**
297
300
  * Sets accept.
@@ -299,7 +302,7 @@ class HTMLInputElement extends HTMLElement_1.default {
299
302
  * @param accept Accept.
300
303
  */
301
304
  set accept(accept) {
302
- this.setAttributeNS(null, 'accept', accept);
305
+ this.setAttribute('accept', accept);
303
306
  }
304
307
  /**
305
308
  * Returns allowdirs.
@@ -307,7 +310,7 @@ class HTMLInputElement extends HTMLElement_1.default {
307
310
  * @returns Allowdirs.
308
311
  */
309
312
  get allowdirs() {
310
- return this.getAttributeNS(null, 'allowdirs') || '';
313
+ return this.getAttribute('allowdirs') || '';
311
314
  }
312
315
  /**
313
316
  * Sets allowdirs.
@@ -315,7 +318,7 @@ class HTMLInputElement extends HTMLElement_1.default {
315
318
  * @param allowdirs Allowdirs.
316
319
  */
317
320
  set allowdirs(allowdirs) {
318
- this.setAttributeNS(null, 'allowdirs', allowdirs);
321
+ this.setAttribute('allowdirs', allowdirs);
319
322
  }
320
323
  /**
321
324
  * Returns autocomplete.
@@ -323,7 +326,7 @@ class HTMLInputElement extends HTMLElement_1.default {
323
326
  * @returns Autocomplete.
324
327
  */
325
328
  get autocomplete() {
326
- return this.getAttributeNS(null, 'autocomplete') || '';
329
+ return this.getAttribute('autocomplete') || '';
327
330
  }
328
331
  /**
329
332
  * Sets autocomplete.
@@ -331,7 +334,7 @@ class HTMLInputElement extends HTMLElement_1.default {
331
334
  * @param autocomplete Autocomplete.
332
335
  */
333
336
  set autocomplete(autocomplete) {
334
- this.setAttributeNS(null, 'autocomplete', autocomplete);
337
+ this.setAttribute('autocomplete', autocomplete);
335
338
  }
336
339
  /**
337
340
  * Returns src.
@@ -339,7 +342,7 @@ class HTMLInputElement extends HTMLElement_1.default {
339
342
  * @returns Src.
340
343
  */
341
344
  get src() {
342
- return this.getAttributeNS(null, 'src') || '';
345
+ return this.getAttribute('src') || '';
343
346
  }
344
347
  /**
345
348
  * Sets src.
@@ -347,7 +350,7 @@ class HTMLInputElement extends HTMLElement_1.default {
347
350
  * @param src Src.
348
351
  */
349
352
  set src(src) {
350
- this.setAttributeNS(null, 'src', src);
353
+ this.setAttribute('src', src);
351
354
  }
352
355
  /**
353
356
  * Returns defaultValue.
@@ -355,7 +358,7 @@ class HTMLInputElement extends HTMLElement_1.default {
355
358
  * @returns Defaultvalue.
356
359
  */
357
360
  get defaultValue() {
358
- return this.getAttributeNS(null, 'defaultvalue') || '';
361
+ return this.getAttribute('value') || '';
359
362
  }
360
363
  /**
361
364
  * Sets defaultValue.
@@ -363,7 +366,7 @@ class HTMLInputElement extends HTMLElement_1.default {
363
366
  * @param defaultValue Defaultvalue.
364
367
  */
365
368
  set defaultValue(defaultValue) {
366
- this.setAttributeNS(null, 'defaultvalue', defaultValue);
369
+ this.setAttribute('value', defaultValue);
367
370
  }
368
371
  /**
369
372
  * Returns read only.
@@ -371,7 +374,7 @@ class HTMLInputElement extends HTMLElement_1.default {
371
374
  * @returns Read only.
372
375
  */
373
376
  get readOnly() {
374
- return this.getAttributeNS(null, 'readonly') !== null;
377
+ return this.getAttribute('readonly') !== null;
375
378
  }
376
379
  /**
377
380
  * Sets read only.
@@ -380,10 +383,10 @@ class HTMLInputElement extends HTMLElement_1.default {
380
383
  */
381
384
  set readOnly(readOnly) {
382
385
  if (!readOnly) {
383
- this.removeAttributeNS(null, 'readonly');
386
+ this.removeAttribute('readonly');
384
387
  }
385
388
  else {
386
- this.setAttributeNS(null, 'readonly', '');
389
+ this.setAttribute('readonly', '');
387
390
  }
388
391
  }
389
392
  /**
@@ -392,7 +395,7 @@ class HTMLInputElement extends HTMLElement_1.default {
392
395
  * @returns Disabled.
393
396
  */
394
397
  get disabled() {
395
- return this.getAttributeNS(null, 'disabled') !== null;
398
+ return this.getAttribute('disabled') !== null;
396
399
  }
397
400
  /**
398
401
  * Sets disabled.
@@ -401,10 +404,10 @@ class HTMLInputElement extends HTMLElement_1.default {
401
404
  */
402
405
  set disabled(disabled) {
403
406
  if (!disabled) {
404
- this.removeAttributeNS(null, 'disabled');
407
+ this.removeAttribute('disabled');
405
408
  }
406
409
  else {
407
- this.setAttributeNS(null, 'disabled', '');
410
+ this.setAttribute('disabled', '');
408
411
  }
409
412
  }
410
413
  /**
@@ -413,7 +416,7 @@ class HTMLInputElement extends HTMLElement_1.default {
413
416
  * @returns Autofocus.
414
417
  */
415
418
  get autofocus() {
416
- return this.getAttributeNS(null, 'autofocus') !== null;
419
+ return this.getAttribute('autofocus') !== null;
417
420
  }
418
421
  /**
419
422
  * Sets autofocus.
@@ -422,10 +425,10 @@ class HTMLInputElement extends HTMLElement_1.default {
422
425
  */
423
426
  set autofocus(autofocus) {
424
427
  if (!autofocus) {
425
- this.removeAttributeNS(null, 'autofocus');
428
+ this.removeAttribute('autofocus');
426
429
  }
427
430
  else {
428
- this.setAttributeNS(null, 'autofocus', '');
431
+ this.setAttribute('autofocus', '');
429
432
  }
430
433
  }
431
434
  /**
@@ -434,7 +437,7 @@ class HTMLInputElement extends HTMLElement_1.default {
434
437
  * @returns Required.
435
438
  */
436
439
  get required() {
437
- return this.getAttributeNS(null, 'required') !== null;
440
+ return this.getAttribute('required') !== null;
438
441
  }
439
442
  /**
440
443
  * Sets required.
@@ -443,10 +446,10 @@ class HTMLInputElement extends HTMLElement_1.default {
443
446
  */
444
447
  set required(required) {
445
448
  if (!required) {
446
- this.removeAttributeNS(null, 'required');
449
+ this.removeAttribute('required');
447
450
  }
448
451
  else {
449
- this.setAttributeNS(null, 'required', '');
452
+ this.setAttribute('required', '');
450
453
  }
451
454
  }
452
455
  /**
@@ -455,7 +458,7 @@ class HTMLInputElement extends HTMLElement_1.default {
455
458
  * @returns Indeterminate.
456
459
  */
457
460
  get indeterminate() {
458
- return this.getAttributeNS(null, 'indeterminate') !== null;
461
+ return this.getAttribute('indeterminate') !== null;
459
462
  }
460
463
  /**
461
464
  * Sets indeterminate.
@@ -464,10 +467,10 @@ class HTMLInputElement extends HTMLElement_1.default {
464
467
  */
465
468
  set indeterminate(indeterminate) {
466
469
  if (!indeterminate) {
467
- this.removeAttributeNS(null, 'indeterminate');
470
+ this.removeAttribute('indeterminate');
468
471
  }
469
472
  else {
470
- this.setAttributeNS(null, 'indeterminate', '');
473
+ this.setAttribute('indeterminate', '');
471
474
  }
472
475
  }
473
476
  /**
@@ -476,7 +479,7 @@ class HTMLInputElement extends HTMLElement_1.default {
476
479
  * @returns Multiple.
477
480
  */
478
481
  get multiple() {
479
- return this.getAttributeNS(null, 'multiple') !== null;
482
+ return this.getAttribute('multiple') !== null;
480
483
  }
481
484
  /**
482
485
  * Sets multiple.
@@ -485,10 +488,10 @@ class HTMLInputElement extends HTMLElement_1.default {
485
488
  */
486
489
  set multiple(multiple) {
487
490
  if (!multiple) {
488
- this.removeAttributeNS(null, 'multiple');
491
+ this.removeAttribute('multiple');
489
492
  }
490
493
  else {
491
- this.setAttributeNS(null, 'multiple', '');
494
+ this.setAttribute('multiple', '');
492
495
  }
493
496
  }
494
497
  /**
@@ -497,7 +500,10 @@ class HTMLInputElement extends HTMLElement_1.default {
497
500
  * @returns Checked.
498
501
  */
499
502
  get checked() {
500
- return this.getAttributeNS(null, 'checked') !== null;
503
+ if (this._checked !== null) {
504
+ return this._checked;
505
+ }
506
+ return this.getAttribute('checked') !== null;
501
507
  }
502
508
  /**
503
509
  * Sets checked.
@@ -505,11 +511,15 @@ class HTMLInputElement extends HTMLElement_1.default {
505
511
  * @param checked Checked.
506
512
  */
507
513
  set checked(checked) {
508
- if (!checked) {
509
- this.removeAttributeNS(null, 'checked');
510
- }
511
- else {
512
- this.setAttributeNS(null, 'checked', '');
514
+ this._checked = checked;
515
+ if (checked && this.type === 'radio' && this.name) {
516
+ const root = (this._formNode || this.getRootNode());
517
+ const radioButtons = root.querySelectorAll(`input[type="radio"][name="${this.name}"]`);
518
+ for (const radioButton of radioButtons) {
519
+ if (radioButton !== this) {
520
+ radioButton['_checked'] = false;
521
+ }
522
+ }
513
523
  }
514
524
  }
515
525
  /**
@@ -524,16 +534,16 @@ class HTMLInputElement extends HTMLElement_1.default {
524
534
  case 'image':
525
535
  case 'reset':
526
536
  case 'button':
527
- return this.getAttributeNS(null, 'value') || '';
537
+ return this.getAttribute('value') || '';
528
538
  case 'checkbox':
529
539
  case 'radio':
530
- const attritube = this.getAttributeNS(null, 'value');
540
+ const attritube = this.getAttribute('value');
531
541
  return attritube !== null ? attritube : 'on';
532
542
  case 'file':
533
543
  return this.files.length > 0 ? '/fake/path/' + this.files[0].name : '';
534
544
  }
535
545
  if (this._value === null) {
536
- return this.getAttributeNS(null, 'value') || '';
546
+ return this.getAttribute('value') || '';
537
547
  }
538
548
  return this._value;
539
549
  }
@@ -553,7 +563,7 @@ class HTMLInputElement extends HTMLElement_1.default {
553
563
  case 'button':
554
564
  case 'checkbox':
555
565
  case 'radio':
556
- this.setAttributeNS(null, 'value', value);
566
+ this.setAttribute('value', value);
557
567
  break;
558
568
  case 'file':
559
569
  if (value !== '') {
@@ -644,24 +654,33 @@ class HTMLInputElement extends HTMLElement_1.default {
644
654
  this.setSelectionRange(this._selectionStart, this._selectionEnd, direction);
645
655
  }
646
656
  /**
647
- * Returns the parent form element.
657
+ * Returns no validate.
648
658
  *
649
- * @returns Form.
659
+ * @returns No validate.
650
660
  */
651
- get form() {
652
- let parent = this.parentNode;
653
- while (parent && parent.tagName !== 'FORM') {
654
- parent = parent.parentNode;
661
+ get formNoValidate() {
662
+ return this.getAttribute('formnovalidate') !== null;
663
+ }
664
+ /**
665
+ * Sets no validate.
666
+ *
667
+ * @param formNoValidate No validate.
668
+ */
669
+ set formNoValidate(formNoValidate) {
670
+ if (!formNoValidate) {
671
+ this.removeAttribute('formnovalidate');
672
+ }
673
+ else {
674
+ this.setAttribute('formnovalidate', '');
655
675
  }
656
- return parent;
657
676
  }
658
677
  /**
659
- * Returns validity state.
678
+ * Returns the parent form element.
660
679
  *
661
- * @returns Validity state.
680
+ * @returns Form.
662
681
  */
663
- get validity() {
664
- return new ValidityState_1.default(this);
682
+ get form() {
683
+ return this._formNode;
665
684
  }
666
685
  /**
667
686
  * Returns "true" if it will validate.
@@ -692,12 +711,26 @@ class HTMLInputElement extends HTMLElement_1.default {
692
711
  return this.value ? parseFloat(this.value) : NaN;
693
712
  }
694
713
  /**
695
- * Returns validation message.
714
+ * Returns the associated label elements.
696
715
  *
697
- * @returns Validation message.
716
+ * @returns Label elements.
698
717
  */
699
- get validationMessage() {
700
- return this._validationMessage;
718
+ get labels() {
719
+ const id = this.id;
720
+ if (id) {
721
+ const rootNode = this.getRootNode();
722
+ const labels = rootNode.querySelectorAll(`label[for="${id}"]`);
723
+ let parent = this.parentNode;
724
+ while (parent) {
725
+ if (parent['tagName'] === 'LABEL') {
726
+ labels.push(parent);
727
+ break;
728
+ }
729
+ parent = parent.parentNode;
730
+ }
731
+ return labels;
732
+ }
733
+ return new NodeList_1.default();
701
734
  }
702
735
  /**
703
736
  * Sets validation message.
@@ -705,18 +738,7 @@ class HTMLInputElement extends HTMLElement_1.default {
705
738
  * @param message Message.
706
739
  */
707
740
  setCustomValidity(message) {
708
- this._validationMessage = String(message);
709
- }
710
- /**
711
- * Reports validity by dispatching an "invalid" event.
712
- */
713
- reportValidity() {
714
- if (this._validationMessage) {
715
- this.dispatchEvent(new Event_1.default('invalid', {
716
- bubbles: true,
717
- cancelable: true
718
- }));
719
- }
741
+ this.validationMessage = String(message);
720
742
  }
721
743
  /**
722
744
  * Selects the text.
@@ -813,7 +835,24 @@ class HTMLInputElement extends HTMLElement_1.default {
813
835
  * @returns "true" if the field is valid.
814
836
  */
815
837
  checkValidity() {
816
- return true;
838
+ const valid = this.disabled ||
839
+ this.readOnly ||
840
+ this.type === 'hidden' ||
841
+ this.type === 'reset' ||
842
+ this.type === 'button' ||
843
+ this.validity.valid;
844
+ if (!valid) {
845
+ this.dispatchEvent(new Event_1.default('invalid', { bubbles: true, cancelable: true }));
846
+ }
847
+ return valid;
848
+ }
849
+ /**
850
+ * Reports validity.
851
+ *
852
+ * @returns "true" if the field is valid.
853
+ */
854
+ reportValidity() {
855
+ return this.checkValidity();
817
856
  }
818
857
  /**
819
858
  * Steps up.
@@ -848,7 +887,6 @@ class HTMLInputElement extends HTMLElement_1.default {
848
887
  const clone = super.cloneNode(deep);
849
888
  clone.formAction = this.formAction;
850
889
  clone.formMethod = this.formMethod;
851
- clone.formNoValidate = this.formNoValidate;
852
890
  clone._value = this._value;
853
891
  clone._height = this._height;
854
892
  clone._width = this._width;
@@ -860,22 +898,79 @@ class HTMLInputElement extends HTMLElement_1.default {
860
898
  return clone;
861
899
  }
862
900
  /**
863
- * Checks if private value is supported.
864
- *
865
- * @returns "true" if private value is supported.
901
+ * @override
902
+ */
903
+ dispatchEvent(event) {
904
+ if (event.type === 'click' && this.disabled) {
905
+ return false;
906
+ }
907
+ const returnValue = super.dispatchEvent(event);
908
+ if (event.type === 'click' &&
909
+ this.isConnected &&
910
+ (!this.readOnly || this.type === 'checkbox' || this.type === 'radio')) {
911
+ if (this.type === 'checkbox' || this.type === 'radio') {
912
+ this.checked = this.type === 'checkbox' ? !this.checked : true;
913
+ this.dispatchEvent(new Event_1.default('input', { bubbles: true, cancelable: true }));
914
+ this.dispatchEvent(new Event_1.default('change', { bubbles: true, cancelable: true }));
915
+ }
916
+ else if (this.type === 'submit') {
917
+ const form = this._formNode;
918
+ if (form) {
919
+ form.requestSubmit();
920
+ }
921
+ }
922
+ else if (this.type === 'reset') {
923
+ const form = this._formNode;
924
+ if (form) {
925
+ form.reset();
926
+ }
927
+ }
928
+ }
929
+ return returnValue;
930
+ }
931
+ /**
932
+ * @override
866
933
  */
867
- // Private _isPrivateValueSupported(): boolean {
868
- // Return (
869
- // This.type !== 'hidden' &&
870
- // This.type !== 'submit' &&
871
- // This.type !== 'image' &&
872
- // This.type !== 'reset' &&
873
- // This.type !== 'button' &&
874
- // This.type !== 'checkbox' &&
875
- // This.type !== 'radio' &&
876
- // This.type !== 'file'
877
- // );
878
- // }
934
+ setAttributeNode(attribute) {
935
+ const replacedAttribute = super.setAttributeNode(attribute);
936
+ const oldValue = replacedAttribute ? replacedAttribute.value : null;
937
+ if ((attribute.name === 'id' || attribute.name === 'name') && this._formNode) {
938
+ if (oldValue) {
939
+ this._formNode._removeFormControlItem(this, oldValue);
940
+ }
941
+ if (attribute.value) {
942
+ this._formNode._appendFormControlItem(this, attribute.value);
943
+ }
944
+ }
945
+ return replacedAttribute;
946
+ }
947
+ /**
948
+ * @override
949
+ */
950
+ removeAttributeNode(attribute) {
951
+ super.removeAttributeNode(attribute);
952
+ if ((attribute.name === 'id' || attribute.name === 'name') && this._formNode) {
953
+ this._formNode._removeFormControlItem(this, attribute.value);
954
+ }
955
+ return attribute;
956
+ }
957
+ /**
958
+ * @override
959
+ */
960
+ _connectToNode(parentNode = null) {
961
+ const oldFormNode = this._formNode;
962
+ super._connectToNode(parentNode);
963
+ if (oldFormNode !== this._formNode) {
964
+ if (oldFormNode) {
965
+ oldFormNode._removeFormControlItem(this, this.name);
966
+ oldFormNode._removeFormControlItem(this, this.id);
967
+ }
968
+ if (this._formNode) {
969
+ this._formNode._appendFormControlItem(this, this.name);
970
+ this._formNode._appendFormControlItem(this, this.id);
971
+ }
972
+ }
973
+ }
879
974
  /**
880
975
  * Checks is selection is supported.
881
976
  *