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.
- package/README.md +2 -2
- package/lib/cookie/CookieJar.js +1 -1
- package/lib/cookie/CookieJar.js.map +1 -1
- package/lib/dom-token-list/DOMTokenList.js +24 -20
- package/lib/dom-token-list/DOMTokenList.js.map +1 -1
- package/lib/event/EventTarget.js +6 -3
- package/lib/event/EventTarget.js.map +1 -1
- package/lib/exception/DOMExceptionNameEnum.d.ts +5 -1
- package/lib/exception/DOMExceptionNameEnum.js +4 -0
- package/lib/exception/DOMExceptionNameEnum.js.map +1 -1
- package/lib/fetch/AbortController.d.ts +19 -0
- package/lib/fetch/AbortController.js +30 -0
- package/lib/fetch/AbortController.js.map +1 -0
- package/lib/fetch/AbortSignal.d.ts +25 -0
- package/lib/fetch/AbortSignal.js +51 -0
- package/lib/fetch/AbortSignal.js.map +1 -0
- package/lib/fetch/Fetch.d.ts +117 -0
- package/lib/fetch/Fetch.js +530 -0
- package/lib/fetch/Fetch.js.map +1 -0
- package/lib/fetch/Headers.d.ts +81 -3
- package/lib/fetch/Headers.js +139 -24
- package/lib/fetch/Headers.js.map +1 -1
- package/lib/fetch/Request.d.ts +56 -32
- package/lib/fetch/Request.js +165 -110
- package/lib/fetch/Request.js.map +1 -1
- package/lib/fetch/{ResourceFetchHandler.d.ts → ResourceFetch.d.ts} +1 -1
- package/lib/fetch/{ResourceFetchHandler.js → ResourceFetch.js} +5 -5
- package/lib/fetch/ResourceFetch.js.map +1 -0
- package/lib/fetch/Response.d.ts +60 -26
- package/lib/fetch/Response.js +196 -104
- package/lib/fetch/Response.js.map +1 -1
- package/lib/fetch/data-uri/DataURIParser.d.ts +20 -0
- package/lib/fetch/data-uri/DataURIParser.js +60 -0
- package/lib/fetch/data-uri/DataURIParser.js.map +1 -0
- package/lib/fetch/multipart/MultipartFormDataParser.d.ts +40 -0
- package/lib/fetch/multipart/MultipartFormDataParser.js +81 -0
- package/lib/fetch/multipart/MultipartFormDataParser.js.map +1 -0
- package/lib/fetch/multipart/MultipartReader.d.ts +49 -0
- package/lib/fetch/multipart/MultipartReader.js +178 -0
- package/lib/fetch/multipart/MultipartReader.js.map +1 -0
- package/lib/fetch/types/IHeaders.d.ts +71 -0
- package/lib/fetch/{IHeaders.js.map → types/IHeaders.js.map} +1 -1
- package/lib/fetch/types/IHeadersInit.js.map +1 -0
- package/lib/fetch/types/IRequest.d.ts +60 -0
- package/lib/fetch/{IRequest.js.map → types/IRequest.js.map} +1 -1
- package/lib/fetch/types/IRequestBody.d.ts +7 -0
- package/lib/fetch/{IBody.js → types/IRequestBody.js} +1 -1
- package/lib/fetch/types/IRequestBody.js.map +1 -0
- package/lib/fetch/types/IRequestCredentials.d.ts +2 -0
- package/lib/fetch/types/IRequestCredentials.js +3 -0
- package/lib/fetch/types/IRequestCredentials.js.map +1 -0
- package/lib/fetch/{RequestInfo.d.ts → types/IRequestInfo.d.ts} +2 -2
- package/lib/fetch/types/IRequestInfo.js +3 -0
- package/lib/fetch/types/IRequestInfo.js.map +1 -0
- package/lib/fetch/types/IRequestInit.d.ts +21 -0
- package/lib/fetch/types/IRequestInit.js.map +1 -0
- package/lib/fetch/types/IRequestRedirect.d.ts +2 -0
- package/lib/fetch/types/IRequestRedirect.js +3 -0
- package/lib/fetch/types/IRequestRedirect.js.map +1 -0
- package/lib/fetch/types/IRequestReferrerPolicy.d.ts +2 -0
- package/lib/fetch/types/IRequestReferrerPolicy.js +3 -0
- package/lib/fetch/types/IRequestReferrerPolicy.js.map +1 -0
- package/lib/fetch/types/IResponse.d.ts +27 -0
- package/lib/fetch/{IResponse.js.map → types/IResponse.js.map} +1 -1
- package/lib/fetch/types/IResponseBody.d.ts +7 -0
- package/lib/fetch/types/IResponseBody.js +3 -0
- package/lib/fetch/types/IResponseBody.js.map +1 -0
- package/lib/fetch/types/IResponseInit.d.ts +9 -0
- package/lib/fetch/types/IResponseInit.js.map +1 -0
- package/lib/fetch/utilities/FetchBodyUtility.d.ts +44 -0
- package/lib/fetch/utilities/FetchBodyUtility.js +156 -0
- package/lib/fetch/utilities/FetchBodyUtility.js.map +1 -0
- package/lib/fetch/utilities/FetchCORSUtility.d.ts +12 -0
- package/lib/fetch/utilities/FetchCORSUtility.js +20 -0
- package/lib/fetch/utilities/FetchCORSUtility.js.map +1 -0
- package/lib/fetch/utilities/FetchRequestHeaderUtility.d.ts +12 -0
- package/lib/fetch/utilities/FetchRequestHeaderUtility.js +45 -0
- package/lib/fetch/utilities/FetchRequestHeaderUtility.js.map +1 -0
- package/lib/fetch/utilities/FetchRequestReferrerUtility.d.ts +55 -0
- package/lib/fetch/utilities/FetchRequestReferrerUtility.js +194 -0
- package/lib/fetch/utilities/FetchRequestReferrerUtility.js.map +1 -0
- package/lib/fetch/utilities/FetchRequestValidationUtility.d.ts +38 -0
- package/lib/fetch/utilities/FetchRequestValidationUtility.js +70 -0
- package/lib/fetch/utilities/FetchRequestValidationUtility.js.map +1 -0
- package/lib/file/Blob.d.ts +2 -2
- package/lib/file/Blob.js +1 -1
- package/lib/file/Blob.js.map +1 -1
- package/lib/file/File.d.ts +2 -1
- package/lib/file/File.js.map +1 -1
- package/lib/form-data/FormData.d.ts +98 -0
- package/lib/form-data/FormData.js +212 -0
- package/lib/form-data/FormData.js.map +1 -0
- package/lib/index.d.ts +14 -1
- package/lib/index.js +20 -2
- package/lib/index.js.map +1 -1
- package/lib/nodes/document/Document.d.ts +5 -17
- package/lib/nodes/document/Document.js +11 -54
- package/lib/nodes/document/Document.js.map +1 -1
- package/lib/nodes/document/IDocument.d.ts +1 -1
- package/lib/nodes/document-fragment/DocumentFragment.d.ts +3 -14
- package/lib/nodes/document-fragment/DocumentFragment.js +7 -51
- package/lib/nodes/document-fragment/DocumentFragment.js.map +1 -1
- package/lib/nodes/document-fragment/IDocumentFragment.d.ts +2 -1
- package/lib/nodes/element/Element.d.ts +8 -8
- package/lib/nodes/element/Element.js +28 -45
- package/lib/nodes/element/Element.js.map +1 -1
- package/lib/nodes/element/ElementUtility.d.ts +32 -0
- package/lib/nodes/element/ElementUtility.js +105 -0
- package/lib/nodes/element/ElementUtility.js.map +1 -0
- package/lib/nodes/element/HTMLCollection.d.ts +26 -3
- package/lib/nodes/element/HTMLCollection.js +51 -0
- package/lib/nodes/element/HTMLCollection.js.map +1 -1
- package/lib/nodes/element/IHTMLCollection.d.ts +9 -2
- package/lib/nodes/html-anchor-element/HTMLAnchorElement.js +24 -24
- package/lib/nodes/html-anchor-element/HTMLAnchorElement.js.map +1 -1
- package/lib/nodes/html-audio-element/Audio.d.ts +15 -0
- package/lib/nodes/html-audio-element/Audio.js +27 -0
- package/lib/nodes/html-audio-element/Audio.js.map +1 -0
- package/lib/nodes/html-base-element/HTMLBaseElement.js +4 -4
- package/lib/nodes/html-base-element/HTMLBaseElement.js.map +1 -1
- package/lib/nodes/html-button-element/HTMLButtonElement.d.ts +79 -3
- package/lib/nodes/html-button-element/HTMLButtonElement.js +158 -10
- package/lib/nodes/html-button-element/HTMLButtonElement.js.map +1 -1
- package/lib/nodes/html-button-element/IHTMLButtonElement.d.ts +28 -2
- package/lib/nodes/html-dialog-element/HTMLDialogElement.js +3 -3
- package/lib/nodes/html-dialog-element/HTMLDialogElement.js.map +1 -1
- package/lib/nodes/html-element/HTMLElement.js +12 -12
- package/lib/nodes/html-element/HTMLElement.js.map +1 -1
- package/lib/nodes/html-form-element/HTMLFormControlsCollection.d.ts +32 -0
- package/lib/nodes/html-form-element/HTMLFormControlsCollection.js +58 -0
- package/lib/nodes/html-form-element/HTMLFormControlsCollection.js.map +1 -0
- package/lib/nodes/html-form-element/HTMLFormElement.d.ts +37 -17
- package/lib/nodes/html-form-element/HTMLFormElement.js +128 -37
- package/lib/nodes/html-form-element/HTMLFormElement.js.map +1 -1
- package/lib/nodes/html-form-element/IHTMLFormControlsCollection.d.ts +25 -0
- package/lib/nodes/html-form-element/IHTMLFormControlsCollection.js +3 -0
- package/lib/nodes/html-form-element/IHTMLFormControlsCollection.js.map +1 -0
- package/lib/nodes/html-form-element/IHTMLFormElement.d.ts +16 -6
- package/lib/nodes/html-form-element/IRadioNodeList.d.ts +15 -0
- package/lib/nodes/html-form-element/IRadioNodeList.js +3 -0
- package/lib/nodes/html-form-element/IRadioNodeList.js.map +1 -0
- package/lib/nodes/html-form-element/RadioNodeList.d.ts +16 -0
- package/lib/nodes/html-form-element/RadioNodeList.js +28 -0
- package/lib/nodes/html-form-element/RadioNodeList.js.map +1 -0
- package/lib/nodes/html-image-element/HTMLImageElement.js +19 -19
- package/lib/nodes/html-image-element/HTMLImageElement.js.map +1 -1
- package/lib/nodes/html-input-element/HTMLInputElement.d.ts +43 -19
- package/lib/nodes/html-input-element/HTMLInputElement.js +206 -111
- package/lib/nodes/html-input-element/HTMLInputElement.js.map +1 -1
- package/lib/nodes/html-input-element/IHTMLInputElement.d.ts +14 -1
- package/lib/nodes/html-label-element/HTMLLabelElement.js +3 -7
- package/lib/nodes/html-label-element/HTMLLabelElement.js.map +1 -1
- package/lib/nodes/html-link-element/HTMLLinkElement.js +21 -21
- package/lib/nodes/html-link-element/HTMLLinkElement.js.map +1 -1
- package/lib/nodes/html-media-element/HTMLMediaElement.js +21 -21
- package/lib/nodes/html-media-element/HTMLMediaElement.js.map +1 -1
- package/lib/nodes/html-meta-element/HTMLMetaElement.js +8 -8
- package/lib/nodes/html-meta-element/HTMLMetaElement.js.map +1 -1
- package/lib/nodes/html-opt-group-element/HTMLOptGroupElement.js +6 -6
- package/lib/nodes/html-opt-group-element/HTMLOptGroupElement.js.map +1 -1
- package/lib/nodes/html-option-element/HTMLOptionElement.d.ts +3 -4
- package/lib/nodes/html-option-element/HTMLOptionElement.js +26 -29
- package/lib/nodes/html-option-element/HTMLOptionElement.js.map +1 -1
- package/lib/nodes/html-script-element/HTMLScriptElement.js +16 -16
- package/lib/nodes/html-script-element/HTMLScriptElement.js.map +1 -1
- package/lib/nodes/html-script-element/ScriptUtility.js +5 -5
- package/lib/nodes/html-script-element/ScriptUtility.js.map +1 -1
- package/lib/nodes/{html-option-element → html-select-element}/HTMLOptionsCollection.d.ts +5 -6
- package/lib/nodes/{html-option-element → html-select-element}/HTMLOptionsCollection.js.map +1 -1
- package/lib/nodes/html-select-element/HTMLSelectElement.d.ts +42 -41
- package/lib/nodes/html-select-element/HTMLSelectElement.js +134 -138
- package/lib/nodes/html-select-element/HTMLSelectElement.js.map +1 -1
- package/lib/nodes/{html-option-element → html-select-element}/IHTMLOptionsCollection.d.ts +4 -5
- package/lib/nodes/html-select-element/IHTMLOptionsCollection.js.map +1 -0
- package/lib/nodes/html-select-element/IHTMLSelectElement.d.ts +22 -2
- package/lib/nodes/html-slot-element/HTMLSlotElement.js +2 -2
- package/lib/nodes/html-slot-element/HTMLSlotElement.js.map +1 -1
- package/lib/nodes/html-style-element/HTMLStyleElement.js +7 -7
- package/lib/nodes/html-style-element/HTMLStyleElement.js.map +1 -1
- package/lib/nodes/html-text-area-element/HTMLTextAreaElement.d.ts +55 -2
- package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js +150 -40
- package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js.map +1 -1
- package/lib/nodes/html-text-area-element/IHTMLTextAreaElement.d.ts +16 -0
- package/lib/nodes/node/Node.d.ts +12 -1
- package/lib/nodes/node/Node.js +50 -4
- package/lib/nodes/node/Node.js.map +1 -1
- package/lib/nodes/node/NodeList.d.ts +2 -3
- package/lib/nodes/node/NodeList.js.map +1 -1
- package/lib/nodes/parent-node/IParentNode.d.ts +4 -4
- package/lib/nodes/parent-node/ParentNodeUtility.d.ts +3 -3
- package/lib/nodes/parent-node/ParentNodeUtility.js +13 -11
- package/lib/nodes/parent-node/ParentNodeUtility.js.map +1 -1
- package/lib/nodes/text/Text.d.ts +13 -0
- package/lib/nodes/text/Text.js +30 -0
- package/lib/nodes/text/Text.js.map +1 -1
- package/lib/query-selector/QuerySelector.js +2 -2
- package/lib/query-selector/QuerySelector.js.map +1 -1
- package/lib/query-selector/SelectorItem.js +2 -0
- package/lib/query-selector/SelectorItem.js.map +1 -1
- package/lib/validity-state/ValidityState.d.ts +87 -0
- package/lib/validity-state/ValidityState.js +171 -0
- package/lib/validity-state/ValidityState.js.map +1 -0
- package/lib/window/GlobalWindow.d.ts +0 -8
- package/lib/window/GlobalWindow.js +0 -2
- package/lib/window/GlobalWindow.js.map +1 -1
- package/lib/window/INodeJSGlobal.d.ts +71 -0
- package/lib/window/INodeJSGlobal.js +2 -0
- package/lib/window/INodeJSGlobal.js.map +1 -0
- package/lib/window/IWindow.d.ts +30 -10
- package/lib/window/Window.d.ts +37 -20
- package/lib/window/Window.js +22 -10
- package/lib/window/Window.js.map +1 -1
- package/lib/xml-http-request/XMLHttpRequest.js +20 -12
- package/lib/xml-http-request/XMLHttpRequest.js.map +1 -1
- package/lib/xml-parser/XMLParser.js +1 -1
- package/lib/xml-parser/XMLParser.js.map +1 -1
- package/package.json +2 -3
- package/src/cookie/CookieJar.ts +1 -1
- package/src/dom-token-list/DOMTokenList.ts +24 -20
- package/src/event/EventTarget.ts +7 -3
- package/src/exception/DOMExceptionNameEnum.ts +5 -1
- package/src/fetch/AbortController.ts +26 -0
- package/src/fetch/AbortSignal.ts +44 -0
- package/src/fetch/Fetch.ts +666 -0
- package/src/fetch/Headers.ts +151 -3
- package/src/fetch/Request.ts +226 -94
- package/src/fetch/{ResourceFetchHandler.ts → ResourceFetch.ts} +3 -3
- package/src/fetch/Response.ts +252 -89
- package/src/fetch/data-uri/DataURIParser.ts +66 -0
- package/src/fetch/multipart/MultipartFormDataParser.ts +113 -0
- package/src/fetch/multipart/MultipartReader.ts +217 -0
- package/src/fetch/types/IHeaders.ts +80 -0
- package/src/fetch/types/IRequest.ts +65 -0
- package/src/fetch/types/IRequestBody.ts +15 -0
- package/src/fetch/types/IRequestCredentials.ts +2 -0
- package/src/fetch/types/IRequestInfo.ts +6 -0
- package/src/fetch/types/IRequestInit.ts +21 -0
- package/src/fetch/types/IRequestRedirect.ts +3 -0
- package/src/fetch/types/IRequestReferrerPolicy.ts +11 -0
- package/src/fetch/types/IResponse.ts +27 -0
- package/src/fetch/types/IResponseBody.ts +15 -0
- package/src/fetch/types/IResponseInit.ts +10 -0
- package/src/fetch/utilities/FetchBodyUtility.ts +175 -0
- package/src/fetch/utilities/FetchCORSUtility.ts +18 -0
- package/src/fetch/utilities/FetchRequestHeaderUtility.ts +47 -0
- package/src/fetch/utilities/FetchRequestReferrerUtility.ts +241 -0
- package/src/fetch/utilities/FetchRequestValidationUtility.ts +82 -0
- package/src/file/Blob.ts +2 -2
- package/src/file/File.ts +5 -1
- package/src/form-data/FormData.ts +237 -0
- package/src/index.ts +27 -1
- package/src/nodes/document/Document.ts +23 -64
- package/src/nodes/document/IDocument.ts +1 -1
- package/src/nodes/document-fragment/DocumentFragment.ts +9 -59
- package/src/nodes/document-fragment/IDocumentFragment.ts +2 -1
- package/src/nodes/element/Element.ts +43 -56
- package/src/nodes/element/ElementUtility.ts +137 -0
- package/src/nodes/element/HTMLCollection.ts +60 -3
- package/src/nodes/element/IHTMLCollection.ts +10 -2
- package/src/nodes/html-anchor-element/HTMLAnchorElement.ts +24 -24
- package/src/nodes/html-audio-element/Audio.ts +22 -0
- package/src/nodes/html-base-element/HTMLBaseElement.ts +4 -4
- package/src/nodes/html-button-element/HTMLButtonElement.ts +184 -10
- package/src/nodes/html-button-element/IHTMLButtonElement.ts +31 -2
- package/src/nodes/html-dialog-element/HTMLDialogElement.ts +3 -3
- package/src/nodes/html-element/HTMLElement.ts +12 -12
- package/src/nodes/html-form-element/HTMLFormControlsCollection.ts +76 -0
- package/src/nodes/html-form-element/HTMLFormElement.ts +147 -41
- package/src/nodes/html-form-element/IHTMLFormControlsCollection.ts +45 -0
- package/src/nodes/html-form-element/IHTMLFormElement.ts +17 -6
- package/src/nodes/html-form-element/IRadioNodeList.ts +16 -0
- package/src/nodes/html-form-element/RadioNodeList.ts +24 -0
- package/src/nodes/html-image-element/HTMLImageElement.ts +19 -19
- package/src/nodes/html-input-element/HTMLInputElement.ts +232 -113
- package/src/nodes/html-input-element/IHTMLInputElement.ts +20 -1
- package/src/nodes/html-label-element/HTMLLabelElement.ts +3 -7
- package/src/nodes/html-link-element/HTMLLinkElement.ts +21 -21
- package/src/nodes/html-media-element/HTMLMediaElement.ts +21 -21
- package/src/nodes/html-meta-element/HTMLMetaElement.ts +8 -8
- package/src/nodes/html-opt-group-element/HTMLOptGroupElement.ts +6 -6
- package/src/nodes/html-option-element/HTMLOptionElement.ts +29 -30
- package/src/nodes/html-script-element/HTMLScriptElement.ts +16 -16
- package/src/nodes/html-script-element/ScriptUtility.ts +5 -5
- package/src/nodes/{html-option-element → html-select-element}/HTMLOptionsCollection.ts +5 -9
- package/src/nodes/html-select-element/HTMLSelectElement.ts +159 -170
- package/src/nodes/{html-option-element → html-select-element}/IHTMLOptionsCollection.ts +4 -8
- package/src/nodes/html-select-element/IHTMLSelectElement.ts +25 -2
- package/src/nodes/html-slot-element/HTMLSlotElement.ts +2 -2
- package/src/nodes/html-style-element/HTMLStyleElement.ts +7 -7
- package/src/nodes/html-text-area-element/HTMLTextAreaElement.ts +174 -41
- package/src/nodes/html-text-area-element/IHTMLTextAreaElement.ts +18 -0
- package/src/nodes/node/Node.ts +61 -6
- package/src/nodes/node/NodeList.ts +2 -3
- package/src/nodes/parent-node/IParentNode.ts +7 -4
- package/src/nodes/parent-node/ParentNodeUtility.ts +25 -15
- package/src/nodes/text/Text.ts +38 -0
- package/src/query-selector/QuerySelector.ts +2 -2
- package/src/query-selector/SelectorItem.ts +3 -0
- package/src/validity-state/ValidityState.ts +211 -0
- package/src/window/GlobalWindow.ts +0 -2
- package/src/window/INodeJSGlobal.ts +70 -0
- package/src/window/IWindow.ts +32 -10
- package/src/window/Window.ts +43 -21
- package/src/xml-http-request/XMLHttpRequest.ts +27 -26
- package/src/xml-parser/XMLParser.ts +1 -1
- package/lib/fetch/FetchHandler.d.ts +0 -18
- package/lib/fetch/FetchHandler.js +0 -83
- package/lib/fetch/FetchHandler.js.map +0 -1
- package/lib/fetch/IAbortSignal.d.ts +0 -16
- package/lib/fetch/IAbortSignal.js +0 -4
- package/lib/fetch/IAbortSignal.js.map +0 -1
- package/lib/fetch/IBody.d.ts +0 -17
- package/lib/fetch/IBody.js.map +0 -1
- package/lib/fetch/IHeaders.d.ts +0 -18
- package/lib/fetch/IHeadersInit.js.map +0 -1
- package/lib/fetch/IRequest.d.ts +0 -18
- package/lib/fetch/IRequestInit.d.ts +0 -16
- package/lib/fetch/IRequestInit.js.map +0 -1
- package/lib/fetch/IResponse.d.ts +0 -20
- package/lib/fetch/IResponseInit.d.ts +0 -9
- package/lib/fetch/IResponseInit.js.map +0 -1
- package/lib/fetch/RequestInfo.js +0 -3
- package/lib/fetch/RequestInfo.js.map +0 -1
- package/lib/fetch/ResourceFetchHandler.js.map +0 -1
- package/lib/form-data/IFormData.d.ts +0 -32
- package/lib/form-data/IFormData.js +0 -3
- package/lib/form-data/IFormData.js.map +0 -1
- package/lib/location/RelativeURL.d.ts +0 -15
- package/lib/location/RelativeURL.js +0 -19
- package/lib/location/RelativeURL.js.map +0 -1
- package/lib/nodes/element/HTMLCollectionFactory.d.ts +0 -21
- package/lib/nodes/element/HTMLCollectionFactory.js +0 -31
- package/lib/nodes/element/HTMLCollectionFactory.js.map +0 -1
- package/lib/nodes/html-option-element/IHTMLOptionsCollection.js.map +0 -1
- package/lib/nodes/node/NodeListFactory.d.ts +0 -21
- package/lib/nodes/node/NodeListFactory.js +0 -31
- package/lib/nodes/node/NodeListFactory.js.map +0 -1
- package/lib/nodes/validity-state/ValidityState.d.ts +0 -52
- package/lib/nodes/validity-state/ValidityState.js +0 -81
- package/lib/nodes/validity-state/ValidityState.js.map +0 -1
- package/src/fetch/FetchHandler.ts +0 -90
- package/src/fetch/IAbortSignal.ts +0 -34
- package/src/fetch/IBody.ts +0 -18
- package/src/fetch/IHeaders.ts +0 -18
- package/src/fetch/IRequest.ts +0 -59
- package/src/fetch/IRequestInit.ts +0 -41
- package/src/fetch/IResponse.ts +0 -22
- package/src/fetch/IResponseInit.ts +0 -10
- package/src/fetch/RequestInfo.ts +0 -6
- package/src/form-data/IFormData.ts +0 -33
- package/src/location/RelativeURL.ts +0 -17
- package/src/nodes/element/HTMLCollectionFactory.ts +0 -31
- package/src/nodes/node/NodeListFactory.ts +0 -31
- package/src/nodes/validity-state/ValidityState.ts +0 -84
- /package/lib/fetch/{IHeaders.js → types/IHeaders.js} +0 -0
- /package/lib/fetch/{IHeadersInit.d.ts → types/IHeadersInit.d.ts} +0 -0
- /package/lib/fetch/{IHeadersInit.js → types/IHeadersInit.js} +0 -0
- /package/lib/fetch/{IRequest.js → types/IRequest.js} +0 -0
- /package/lib/fetch/{IRequestInit.js → types/IRequestInit.js} +0 -0
- /package/lib/fetch/{IResponse.js → types/IResponse.js} +0 -0
- /package/lib/fetch/{IResponseInit.js → types/IResponseInit.js} +0 -0
- /package/lib/nodes/{html-option-element → html-select-element}/HTMLOptionsCollection.js +0 -0
- /package/lib/nodes/{html-option-element → html-select-element}/IHTMLOptionsCollection.js +0 -0
- /package/src/fetch/{IHeadersInit.ts → types/IHeadersInit.ts} +0 -0
@@ -31,14 +31,14 @@ export default class DOMTokenList implements IDOMTokenList {
|
|
31
31
|
* @param value Value.
|
32
32
|
*/
|
33
33
|
public set value(value: string) {
|
34
|
-
this._ownerElement.
|
34
|
+
this._ownerElement.setAttribute(this._attributeName, value);
|
35
35
|
}
|
36
36
|
|
37
37
|
/**
|
38
38
|
* Get value.
|
39
39
|
*/
|
40
40
|
public get value(): string {
|
41
|
-
return this._ownerElement.
|
41
|
+
return this._ownerElement.getAttribute(this._attributeName);
|
42
42
|
}
|
43
43
|
|
44
44
|
/**
|
@@ -58,14 +58,14 @@ export default class DOMTokenList implements IDOMTokenList {
|
|
58
58
|
* @param newToken NewToken.
|
59
59
|
*/
|
60
60
|
public replace(token: string, newToken: string): boolean {
|
61
|
-
const attr = this._ownerElement.
|
62
|
-
const list = attr ? attr.split(' ') : [];
|
61
|
+
const attr = this._ownerElement.getAttribute(this._attributeName);
|
62
|
+
const list = attr ? Array.from(new Set(attr.split(' '))) : [];
|
63
63
|
const index = list.indexOf(token);
|
64
64
|
if (index === -1) {
|
65
65
|
return false;
|
66
66
|
}
|
67
67
|
list[index] = newToken;
|
68
|
-
this._ownerElement.
|
68
|
+
this._ownerElement.setAttribute(this._attributeName, list.join(' '));
|
69
69
|
return true;
|
70
70
|
}
|
71
71
|
|
@@ -86,16 +86,18 @@ export default class DOMTokenList implements IDOMTokenList {
|
|
86
86
|
* Returns an iterator, allowing you to go through all values of the key/value pairs contained in this object.
|
87
87
|
*/
|
88
88
|
public values(): IterableIterator<string> {
|
89
|
-
const attr = this._ownerElement.
|
90
|
-
|
89
|
+
const attr = this._ownerElement.getAttribute(this._attributeName);
|
90
|
+
const list = attr ? Array.from(new Set(attr.split(' '))) : [];
|
91
|
+
return list.values();
|
91
92
|
}
|
92
93
|
|
93
94
|
/**
|
94
95
|
* Returns an iterator, allowing you to go through all key/value pairs contained in this object.
|
95
96
|
*/
|
96
97
|
public entries(): IterableIterator<[number, string]> {
|
97
|
-
const attr = this._ownerElement.
|
98
|
-
|
98
|
+
const attr = this._ownerElement.getAttribute(this._attributeName);
|
99
|
+
const list = attr ? Array.from(new Set(attr.split(' '))) : [];
|
100
|
+
return list.entries();
|
99
101
|
}
|
100
102
|
|
101
103
|
/**
|
@@ -105,8 +107,9 @@ export default class DOMTokenList implements IDOMTokenList {
|
|
105
107
|
* @param thisArg
|
106
108
|
*/
|
107
109
|
public forEach(callback: (currentValue, currentIndex, listObj) => void, thisArg?: this): void {
|
108
|
-
const attr = this._ownerElement.
|
109
|
-
|
110
|
+
const attr = this._ownerElement.getAttribute(this._attributeName);
|
111
|
+
const list = attr ? Array.from(new Set(attr.split(' '))) : [];
|
112
|
+
return list.forEach(callback, thisArg);
|
110
113
|
}
|
111
114
|
|
112
115
|
/**
|
@@ -114,8 +117,9 @@ export default class DOMTokenList implements IDOMTokenList {
|
|
114
117
|
*
|
115
118
|
*/
|
116
119
|
public keys(): IterableIterator<number> {
|
117
|
-
const attr = this._ownerElement.
|
118
|
-
|
120
|
+
const attr = this._ownerElement.getAttribute(this._attributeName);
|
121
|
+
const list = attr ? Array.from(new Set(attr.split(' '))) : [];
|
122
|
+
return list.keys();
|
119
123
|
}
|
120
124
|
|
121
125
|
/**
|
@@ -124,8 +128,8 @@ export default class DOMTokenList implements IDOMTokenList {
|
|
124
128
|
* @param tokens Tokens.
|
125
129
|
*/
|
126
130
|
public add(...tokens: string[]): void {
|
127
|
-
const attr = this._ownerElement.
|
128
|
-
const list = attr ? attr.split(' ') : [];
|
131
|
+
const attr = this._ownerElement.getAttribute(this._attributeName);
|
132
|
+
const list = attr ? Array.from(new Set(attr.split(' '))) : [];
|
129
133
|
|
130
134
|
for (const token of tokens) {
|
131
135
|
const index = list.indexOf(token);
|
@@ -136,7 +140,7 @@ export default class DOMTokenList implements IDOMTokenList {
|
|
136
140
|
}
|
137
141
|
}
|
138
142
|
|
139
|
-
this._ownerElement.
|
143
|
+
this._ownerElement.setAttribute(this._attributeName, list.join(' '));
|
140
144
|
}
|
141
145
|
|
142
146
|
/**
|
@@ -145,8 +149,8 @@ export default class DOMTokenList implements IDOMTokenList {
|
|
145
149
|
* @param tokens Tokens.
|
146
150
|
*/
|
147
151
|
public remove(...tokens: string[]): void {
|
148
|
-
const attr = this._ownerElement.
|
149
|
-
const list = attr ? attr.split(' ') : [];
|
152
|
+
const attr = this._ownerElement.getAttribute(this._attributeName);
|
153
|
+
const list = attr ? Array.from(new Set(attr.split(' '))) : [];
|
150
154
|
|
151
155
|
for (const token of tokens) {
|
152
156
|
const index = list.indexOf(token);
|
@@ -155,7 +159,7 @@ export default class DOMTokenList implements IDOMTokenList {
|
|
155
159
|
}
|
156
160
|
}
|
157
161
|
|
158
|
-
this._ownerElement.
|
162
|
+
this._ownerElement.setAttribute(this._attributeName, list.join(' '));
|
159
163
|
}
|
160
164
|
|
161
165
|
/**
|
@@ -165,7 +169,7 @@ export default class DOMTokenList implements IDOMTokenList {
|
|
165
169
|
* @returns TRUE if it contains.
|
166
170
|
*/
|
167
171
|
public contains(className: string): boolean {
|
168
|
-
const attr = this._ownerElement.
|
172
|
+
const attr = this._ownerElement.getAttribute(this._attributeName);
|
169
173
|
return (attr ? attr.split(' ') : []).includes(className);
|
170
174
|
}
|
171
175
|
|
package/src/event/EventTarget.ts
CHANGED
@@ -73,9 +73,13 @@ export default abstract class EventTarget implements IEventTarget {
|
|
73
73
|
}
|
74
74
|
|
75
75
|
if (this._listeners[event.type]) {
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
// We need to clone the arrays because the listeners may remove themselves while we are iterating.
|
77
|
+
const listeners = this._listeners[event.type].slice();
|
78
|
+
const listenerOptions = this._listenerOptions[event.type].slice();
|
79
|
+
|
80
|
+
for (let i = 0, max = listeners.length; i < max; i++) {
|
81
|
+
const listener = listeners[i];
|
82
|
+
const options = listenerOptions[i];
|
79
83
|
|
80
84
|
if ((<IEventListener>listener).handleEvent) {
|
81
85
|
(<IEventListener>listener).handleEvent(event);
|
@@ -11,6 +11,10 @@ enum DOMExceptionNameEnum {
|
|
11
11
|
securityError = 'SecurityError',
|
12
12
|
networkError = 'NetworkError',
|
13
13
|
domException = 'DOMException',
|
14
|
-
invalidAccessError = 'InvalidAccessError'
|
14
|
+
invalidAccessError = 'InvalidAccessError',
|
15
|
+
unknownError = 'UnknownError',
|
16
|
+
abortError = 'AbortError',
|
17
|
+
encodingError = 'EncodingError',
|
18
|
+
uriMismatchError = 'URIMismatchError'
|
15
19
|
}
|
16
20
|
export default DOMExceptionNameEnum;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import AbortSignal from './AbortSignal';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* AbortController.
|
5
|
+
*
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortController
|
7
|
+
*/
|
8
|
+
export default class AbortController {
|
9
|
+
public readonly signal: AbortSignal = new AbortSignal();
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Constructor.
|
13
|
+
*/
|
14
|
+
constructor() {
|
15
|
+
this.signal = new AbortSignal();
|
16
|
+
}
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Aborts the signal.
|
20
|
+
*
|
21
|
+
* @param [reason] Reason.
|
22
|
+
*/
|
23
|
+
public abort(reason?: string): void {
|
24
|
+
this.signal._abort(reason);
|
25
|
+
}
|
26
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import EventTarget from '../event/EventTarget';
|
2
|
+
import Event from '../event/Event';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* AbortSignal.
|
6
|
+
*
|
7
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
8
|
+
*/
|
9
|
+
export default class AbortSignal extends EventTarget {
|
10
|
+
public readonly aborted: boolean = false;
|
11
|
+
public readonly reason: string | null = null;
|
12
|
+
public onabort: ((this: AbortSignal, event: Event) => void) | null = null;
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Aborts the signal.
|
16
|
+
*
|
17
|
+
* @param [reason] Reason.
|
18
|
+
*/
|
19
|
+
public _abort(reason?: string): void {
|
20
|
+
if (this.aborted) {
|
21
|
+
return;
|
22
|
+
}
|
23
|
+
if (reason) {
|
24
|
+
(<string>this.reason) = reason;
|
25
|
+
}
|
26
|
+
(<boolean>this.aborted) = true;
|
27
|
+
this.dispatchEvent(new Event('abort'));
|
28
|
+
}
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Returns an AbortSignal instance that has been set as aborted.
|
32
|
+
*
|
33
|
+
* @param [reason] Reason.
|
34
|
+
* @returns AbortSignal instance.
|
35
|
+
*/
|
36
|
+
public static abort(reason?: string): AbortSignal {
|
37
|
+
const signal = new AbortSignal();
|
38
|
+
if (reason) {
|
39
|
+
(<string>signal.reason) = reason;
|
40
|
+
}
|
41
|
+
(<boolean>signal.aborted) = true;
|
42
|
+
return signal;
|
43
|
+
}
|
44
|
+
}
|