@depup/jsdom 28.1.0-depup.1
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.
- package/LICENSE.txt +22 -0
- package/README.md +38 -0
- package/changes.json +38 -0
- package/lib/api.js +373 -0
- package/lib/generated/event-sets.js +115 -0
- package/lib/generated/idl/AbortController.js +143 -0
- package/lib/generated/idl/AbortSignal.js +249 -0
- package/lib/generated/idl/AbstractRange.js +171 -0
- package/lib/generated/idl/AddEventListenerOptions.js +53 -0
- package/lib/generated/idl/AssignedNodesOptions.js +28 -0
- package/lib/generated/idl/Attr.js +219 -0
- package/lib/generated/idl/BarProp.js +117 -0
- package/lib/generated/idl/BeforeUnloadEvent.js +139 -0
- package/lib/generated/idl/BinaryType.js +12 -0
- package/lib/generated/idl/Blob.js +253 -0
- package/lib/generated/idl/BlobCallback.js +30 -0
- package/lib/generated/idl/BlobEvent.js +157 -0
- package/lib/generated/idl/BlobEventInit.js +43 -0
- package/lib/generated/idl/BlobPropertyBag.js +42 -0
- package/lib/generated/idl/CDATASection.js +109 -0
- package/lib/generated/idl/CanPlayTypeResult.js +12 -0
- package/lib/generated/idl/CharacterData.js +455 -0
- package/lib/generated/idl/CloseEvent.js +168 -0
- package/lib/generated/idl/CloseEventInit.js +65 -0
- package/lib/generated/idl/Comment.js +120 -0
- package/lib/generated/idl/CompositionEvent.js +219 -0
- package/lib/generated/idl/CompositionEventInit.js +32 -0
- package/lib/generated/idl/Crypto.js +148 -0
- package/lib/generated/idl/CustomElementConstructor.js +34 -0
- package/lib/generated/idl/CustomElementRegistry.js +269 -0
- package/lib/generated/idl/CustomEvent.js +206 -0
- package/lib/generated/idl/CustomEventInit.js +32 -0
- package/lib/generated/idl/DOMException.js +222 -0
- package/lib/generated/idl/DOMImplementation.js +237 -0
- package/lib/generated/idl/DOMParser.js +140 -0
- package/lib/generated/idl/DOMRect.js +276 -0
- package/lib/generated/idl/DOMRectInit.js +76 -0
- package/lib/generated/idl/DOMRectReadOnly.js +285 -0
- package/lib/generated/idl/DOMStringMap.js +299 -0
- package/lib/generated/idl/DOMTokenList.js +539 -0
- package/lib/generated/idl/DeviceMotionEvent.js +183 -0
- package/lib/generated/idl/DeviceMotionEventAcceleration.js +145 -0
- package/lib/generated/idl/DeviceMotionEventAccelerationInit.js +61 -0
- package/lib/generated/idl/DeviceMotionEventInit.js +70 -0
- package/lib/generated/idl/DeviceMotionEventRotationRate.js +145 -0
- package/lib/generated/idl/DeviceMotionEventRotationRateInit.js +61 -0
- package/lib/generated/idl/DeviceOrientationEvent.js +183 -0
- package/lib/generated/idl/DeviceOrientationEventInit.js +80 -0
- package/lib/generated/idl/Document.js +4511 -0
- package/lib/generated/idl/DocumentFragment.js +336 -0
- package/lib/generated/idl/DocumentReadyState.js +12 -0
- package/lib/generated/idl/DocumentType.js +254 -0
- package/lib/generated/idl/Element.js +3720 -0
- package/lib/generated/idl/ElementCreationOptions.js +26 -0
- package/lib/generated/idl/ElementDefinitionOptions.js +29 -0
- package/lib/generated/idl/ElementInternals.js +2152 -0
- package/lib/generated/idl/EndingType.js +12 -0
- package/lib/generated/idl/ErrorEvent.js +192 -0
- package/lib/generated/idl/ErrorEventInit.js +92 -0
- package/lib/generated/idl/Event.js +430 -0
- package/lib/generated/idl/EventHandlerNonNull.js +36 -0
- package/lib/generated/idl/EventInit.js +58 -0
- package/lib/generated/idl/EventListener.js +35 -0
- package/lib/generated/idl/EventListenerOptions.js +28 -0
- package/lib/generated/idl/EventModifierInit.js +221 -0
- package/lib/generated/idl/EventTarget.js +259 -0
- package/lib/generated/idl/External.js +130 -0
- package/lib/generated/idl/File.js +185 -0
- package/lib/generated/idl/FileList.js +298 -0
- package/lib/generated/idl/FilePropertyBag.js +33 -0
- package/lib/generated/idl/FileReader.js +468 -0
- package/lib/generated/idl/FocusEvent.js +144 -0
- package/lib/generated/idl/FocusEventInit.js +36 -0
- package/lib/generated/idl/FormData.js +468 -0
- package/lib/generated/idl/Function.js +42 -0
- package/lib/generated/idl/GetRootNodeOptions.js +31 -0
- package/lib/generated/idl/HTMLAnchorElement.js +1026 -0
- package/lib/generated/idl/HTMLAreaElement.js +825 -0
- package/lib/generated/idl/HTMLAudioElement.js +111 -0
- package/lib/generated/idl/HTMLBRElement.js +156 -0
- package/lib/generated/idl/HTMLBaseElement.js +196 -0
- package/lib/generated/idl/HTMLBodyElement.js +880 -0
- package/lib/generated/idl/HTMLButtonElement.js +525 -0
- package/lib/generated/idl/HTMLCanvasElement.js +307 -0
- package/lib/generated/idl/HTMLCollection.js +352 -0
- package/lib/generated/idl/HTMLDListElement.js +159 -0
- package/lib/generated/idl/HTMLDataElement.js +156 -0
- package/lib/generated/idl/HTMLDataListElement.js +126 -0
- package/lib/generated/idl/HTMLDetailsElement.js +159 -0
- package/lib/generated/idl/HTMLDialogElement.js +159 -0
- package/lib/generated/idl/HTMLDirectoryElement.js +159 -0
- package/lib/generated/idl/HTMLDivElement.js +156 -0
- package/lib/generated/idl/HTMLElement.js +3492 -0
- package/lib/generated/idl/HTMLEmbedElement.js +381 -0
- package/lib/generated/idl/HTMLFieldSetElement.js +332 -0
- package/lib/generated/idl/HTMLFontElement.js +239 -0
- package/lib/generated/idl/HTMLFormControlsCollection.js +318 -0
- package/lib/generated/idl/HTMLFormElement.js +661 -0
- package/lib/generated/idl/HTMLFrameElement.js +513 -0
- package/lib/generated/idl/HTMLFrameSetElement.js +711 -0
- package/lib/generated/idl/HTMLHRElement.js +323 -0
- package/lib/generated/idl/HTMLHeadElement.js +111 -0
- package/lib/generated/idl/HTMLHeadingElement.js +156 -0
- package/lib/generated/idl/HTMLHtmlElement.js +156 -0
- package/lib/generated/idl/HTMLIFrameElement.js +689 -0
- package/lib/generated/idl/HTMLImageElement.js +906 -0
- package/lib/generated/idl/HTMLInputElement.js +1931 -0
- package/lib/generated/idl/HTMLLIElement.js +204 -0
- package/lib/generated/idl/HTMLLabelElement.js +182 -0
- package/lib/generated/idl/HTMLLegendElement.js +169 -0
- package/lib/generated/idl/HTMLLinkElement.js +555 -0
- package/lib/generated/idl/HTMLMapElement.js +171 -0
- package/lib/generated/idl/HTMLMarqueeElement.js +558 -0
- package/lib/generated/idl/HTMLMediaElement.js +900 -0
- package/lib/generated/idl/HTMLMenuElement.js +159 -0
- package/lib/generated/idl/HTMLMetaElement.js +279 -0
- package/lib/generated/idl/HTMLMeterElement.js +368 -0
- package/lib/generated/idl/HTMLModElement.js +217 -0
- package/lib/generated/idl/HTMLOListElement.js +284 -0
- package/lib/generated/idl/HTMLObjectElement.js +945 -0
- package/lib/generated/idl/HTMLOptGroupElement.js +200 -0
- package/lib/generated/idl/HTMLOptionElement.js +379 -0
- package/lib/generated/idl/HTMLOptionsCollection.js +513 -0
- package/lib/generated/idl/HTMLOutputElement.js +395 -0
- package/lib/generated/idl/HTMLParagraphElement.js +156 -0
- package/lib/generated/idl/HTMLParamElement.js +279 -0
- package/lib/generated/idl/HTMLPictureElement.js +111 -0
- package/lib/generated/idl/HTMLPreElement.js +163 -0
- package/lib/generated/idl/HTMLProgressElement.js +232 -0
- package/lib/generated/idl/HTMLQuoteElement.js +176 -0
- package/lib/generated/idl/HTMLScriptElement.js +472 -0
- package/lib/generated/idl/HTMLSelectElement.js +993 -0
- package/lib/generated/idl/HTMLSlotElement.js +195 -0
- package/lib/generated/idl/HTMLSourceElement.js +340 -0
- package/lib/generated/idl/HTMLSpanElement.js +111 -0
- package/lib/generated/idl/HTMLStyleElement.js +210 -0
- package/lib/generated/idl/HTMLTableCaptionElement.js +156 -0
- package/lib/generated/idl/HTMLTableCellElement.js +733 -0
- package/lib/generated/idl/HTMLTableColElement.js +376 -0
- package/lib/generated/idl/HTMLTableElement.js +802 -0
- package/lib/generated/idl/HTMLTableRowElement.js +417 -0
- package/lib/generated/idl/HTMLTableSectionElement.js +349 -0
- package/lib/generated/idl/HTMLTemplateElement.js +124 -0
- package/lib/generated/idl/HTMLTextAreaElement.js +1210 -0
- package/lib/generated/idl/HTMLTimeElement.js +156 -0
- package/lib/generated/idl/HTMLTitleElement.js +155 -0
- package/lib/generated/idl/HTMLTrackElement.js +366 -0
- package/lib/generated/idl/HTMLUListElement.js +200 -0
- package/lib/generated/idl/HTMLUnknownElement.js +109 -0
- package/lib/generated/idl/HTMLVideoElement.js +344 -0
- package/lib/generated/idl/HashChangeEvent.js +157 -0
- package/lib/generated/idl/HashChangeEventInit.js +50 -0
- package/lib/generated/idl/Headers.js +418 -0
- package/lib/generated/idl/History.js +266 -0
- package/lib/generated/idl/InputEvent.js +168 -0
- package/lib/generated/idl/InputEventInit.js +68 -0
- package/lib/generated/idl/KeyboardEvent.js +445 -0
- package/lib/generated/idl/KeyboardEventInit.js +116 -0
- package/lib/generated/idl/Location.js +404 -0
- package/lib/generated/idl/MessageEvent.js +317 -0
- package/lib/generated/idl/MessageEventInit.js +100 -0
- package/lib/generated/idl/MimeType.js +156 -0
- package/lib/generated/idl/MimeTypeArray.js +326 -0
- package/lib/generated/idl/MouseEvent.js +595 -0
- package/lib/generated/idl/MouseEventInit.js +189 -0
- package/lib/generated/idl/MutationCallback.js +34 -0
- package/lib/generated/idl/MutationObserver.js +178 -0
- package/lib/generated/idl/MutationObserverInit.js +121 -0
- package/lib/generated/idl/MutationRecord.js +229 -0
- package/lib/generated/idl/NamedNodeMap.js +529 -0
- package/lib/generated/idl/Navigator.js +326 -0
- package/lib/generated/idl/Node.js +765 -0
- package/lib/generated/idl/NodeFilter.js +75 -0
- package/lib/generated/idl/NodeIterator.js +207 -0
- package/lib/generated/idl/NodeList.js +302 -0
- package/lib/generated/idl/OnBeforeUnloadEventHandlerNonNull.js +42 -0
- package/lib/generated/idl/OnErrorEventHandlerNonNull.js +56 -0
- package/lib/generated/idl/PageTransitionEvent.js +144 -0
- package/lib/generated/idl/PageTransitionEventInit.js +35 -0
- package/lib/generated/idl/Performance.js +142 -0
- package/lib/generated/idl/Plugin.js +359 -0
- package/lib/generated/idl/PluginArray.js +336 -0
- package/lib/generated/idl/PointerEvent.js +324 -0
- package/lib/generated/idl/PointerEventInit.js +241 -0
- package/lib/generated/idl/PopStateEvent.js +144 -0
- package/lib/generated/idl/PopStateEventInit.js +32 -0
- package/lib/generated/idl/ProcessingInstruction.js +122 -0
- package/lib/generated/idl/ProgressEvent.js +170 -0
- package/lib/generated/idl/ProgressEventInit.js +65 -0
- package/lib/generated/idl/PromiseRejectionEvent.js +157 -0
- package/lib/generated/idl/PromiseRejectionEventInit.js +42 -0
- package/lib/generated/idl/RadioNodeList.js +296 -0
- package/lib/generated/idl/Range.js +643 -0
- package/lib/generated/idl/SVGAnimatedPreserveAspectRatio.js +136 -0
- package/lib/generated/idl/SVGAnimatedRect.js +136 -0
- package/lib/generated/idl/SVGAnimatedString.js +149 -0
- package/lib/generated/idl/SVGBoundingBoxOptions.js +64 -0
- package/lib/generated/idl/SVGDefsElement.js +109 -0
- package/lib/generated/idl/SVGDescElement.js +109 -0
- package/lib/generated/idl/SVGElement.js +3157 -0
- package/lib/generated/idl/SVGGElement.js +109 -0
- package/lib/generated/idl/SVGGraphicsElement.js +139 -0
- package/lib/generated/idl/SVGMetadataElement.js +109 -0
- package/lib/generated/idl/SVGNumber.js +132 -0
- package/lib/generated/idl/SVGPreserveAspectRatio.js +196 -0
- package/lib/generated/idl/SVGRect.js +210 -0
- package/lib/generated/idl/SVGSVGElement.js +786 -0
- package/lib/generated/idl/SVGStringList.js +511 -0
- package/lib/generated/idl/SVGSwitchElement.js +109 -0
- package/lib/generated/idl/SVGSymbolElement.js +146 -0
- package/lib/generated/idl/SVGTitleElement.js +109 -0
- package/lib/generated/idl/Screen.js +180 -0
- package/lib/generated/idl/ScrollBehavior.js +12 -0
- package/lib/generated/idl/ScrollIntoViewOptions.js +45 -0
- package/lib/generated/idl/ScrollLogicalPosition.js +14 -0
- package/lib/generated/idl/ScrollOptions.js +30 -0
- package/lib/generated/idl/ScrollRestoration.js +12 -0
- package/lib/generated/idl/Selection.js +571 -0
- package/lib/generated/idl/SelectionMode.js +12 -0
- package/lib/generated/idl/ShadowRoot.js +189 -0
- package/lib/generated/idl/ShadowRootInit.js +30 -0
- package/lib/generated/idl/ShadowRootMode.js +12 -0
- package/lib/generated/idl/StaticRange.js +123 -0
- package/lib/generated/idl/StaticRangeInit.js +72 -0
- package/lib/generated/idl/Storage.js +397 -0
- package/lib/generated/idl/StorageEvent.js +318 -0
- package/lib/generated/idl/StorageEventInit.js +99 -0
- package/lib/generated/idl/StyleSheetList.js +300 -0
- package/lib/generated/idl/SubmitEvent.js +144 -0
- package/lib/generated/idl/SubmitEventInit.js +36 -0
- package/lib/generated/idl/SupportedType.js +18 -0
- package/lib/generated/idl/Text.js +170 -0
- package/lib/generated/idl/TextDecodeOptions.js +28 -0
- package/lib/generated/idl/TextDecoder.js +211 -0
- package/lib/generated/idl/TextDecoderOptions.js +43 -0
- package/lib/generated/idl/TextEncoder.js +176 -0
- package/lib/generated/idl/TextEncoderEncodeIntoResult.js +42 -0
- package/lib/generated/idl/TextTrackKind.js +12 -0
- package/lib/generated/idl/TouchEvent.js +222 -0
- package/lib/generated/idl/TouchEventInit.js +89 -0
- package/lib/generated/idl/TransitionEvent.js +170 -0
- package/lib/generated/idl/TransitionEventInit.js +65 -0
- package/lib/generated/idl/TreeWalker.js +255 -0
- package/lib/generated/idl/UIEvent.js +235 -0
- package/lib/generated/idl/UIEventInit.js +62 -0
- package/lib/generated/idl/ValidityState.js +249 -0
- package/lib/generated/idl/VisibilityState.js +12 -0
- package/lib/generated/idl/VoidFunction.js +26 -0
- package/lib/generated/idl/WebSocket.js +480 -0
- package/lib/generated/idl/WheelEvent.js +191 -0
- package/lib/generated/idl/WheelEventInit.js +71 -0
- package/lib/generated/idl/XMLDocument.js +109 -0
- package/lib/generated/idl/XMLHttpRequest.js +663 -0
- package/lib/generated/idl/XMLHttpRequestEventTarget.js +334 -0
- package/lib/generated/idl/XMLHttpRequestResponseType.js +14 -0
- package/lib/generated/idl/XMLHttpRequestUpload.js +109 -0
- package/lib/generated/idl/XMLSerializer.js +132 -0
- package/lib/generated/idl/utils.js +252 -0
- package/lib/generated/js-globals.json +332 -0
- package/lib/jsdom/browser/Window.js +952 -0
- package/lib/jsdom/browser/default-stylesheet.css +415 -0
- package/lib/jsdom/browser/not-implemented.js +20 -0
- package/lib/jsdom/browser/parser/html.js +208 -0
- package/lib/jsdom/browser/parser/index.js +37 -0
- package/lib/jsdom/browser/parser/xml.js +202 -0
- package/lib/jsdom/browser/resources/async-resource-queue.js +114 -0
- package/lib/jsdom/browser/resources/decompress-interceptor.js +184 -0
- package/lib/jsdom/browser/resources/jsdom-dispatcher.js +756 -0
- package/lib/jsdom/browser/resources/per-document-resource-loader.js +116 -0
- package/lib/jsdom/browser/resources/request-interceptor.js +171 -0
- package/lib/jsdom/browser/resources/request-manager.js +33 -0
- package/lib/jsdom/browser/resources/resource-queue.js +142 -0
- package/lib/jsdom/browser/resources/stream-handler.js +89 -0
- package/lib/jsdom/level2/style.js +65 -0
- package/lib/jsdom/level3/xpath.js +1875 -0
- package/lib/jsdom/living/aborting/AbortController-impl.js +17 -0
- package/lib/jsdom/living/aborting/AbortSignal-impl.js +131 -0
- package/lib/jsdom/living/attributes/Attr-impl.js +60 -0
- package/lib/jsdom/living/attributes/NamedNodeMap-impl.js +78 -0
- package/lib/jsdom/living/attributes.js +312 -0
- package/lib/jsdom/living/constraint-validation/DefaultConstraintValidation-impl.js +75 -0
- package/lib/jsdom/living/constraint-validation/ValidityState-impl.js +66 -0
- package/lib/jsdom/living/crypto/Crypto-impl.js +68 -0
- package/lib/jsdom/living/cssom/StyleSheetList-impl.js +38 -0
- package/lib/jsdom/living/custom-elements/CustomElementRegistry-impl.js +279 -0
- package/lib/jsdom/living/custom-elements/ElementInternals-impl.js +56 -0
- package/lib/jsdom/living/deviceorientation/DeviceMotionEventAcceleration-impl.js +7 -0
- package/lib/jsdom/living/deviceorientation/DeviceMotionEventRotationRate-impl.js +7 -0
- package/lib/jsdom/living/documents.js +15 -0
- package/lib/jsdom/living/domparsing/DOMParser-impl.js +59 -0
- package/lib/jsdom/living/domparsing/InnerHTML-impl.js +30 -0
- package/lib/jsdom/living/domparsing/XMLSerializer-impl.js +18 -0
- package/lib/jsdom/living/domparsing/parse5-adapter-serialization.js +63 -0
- package/lib/jsdom/living/domparsing/serialization.js +36 -0
- package/lib/jsdom/living/encoding/TextDecoder-impl.js +25 -0
- package/lib/jsdom/living/encoding/TextEncoder-impl.js +26 -0
- package/lib/jsdom/living/events/BeforeUnloadEvent-impl.js +12 -0
- package/lib/jsdom/living/events/BlobEvent-impl.js +14 -0
- package/lib/jsdom/living/events/CloseEvent-impl.js +10 -0
- package/lib/jsdom/living/events/CompositionEvent-impl.js +20 -0
- package/lib/jsdom/living/events/CustomEvent-impl.js +21 -0
- package/lib/jsdom/living/events/DeviceMotionEvent-impl.js +49 -0
- package/lib/jsdom/living/events/DeviceOrientationEvent-impl.js +10 -0
- package/lib/jsdom/living/events/ErrorEvent-impl.js +14 -0
- package/lib/jsdom/living/events/Event-impl.js +195 -0
- package/lib/jsdom/living/events/EventModifierMixin-impl.js +24 -0
- package/lib/jsdom/living/events/EventTarget-impl.js +438 -0
- package/lib/jsdom/living/events/FocusEvent-impl.js +9 -0
- package/lib/jsdom/living/events/HashChangeEvent-impl.js +14 -0
- package/lib/jsdom/living/events/InputEvent-impl.js +11 -0
- package/lib/jsdom/living/events/KeyboardEvent-impl.js +29 -0
- package/lib/jsdom/living/events/MessageEvent-impl.js +25 -0
- package/lib/jsdom/living/events/MouseEvent-impl.js +72 -0
- package/lib/jsdom/living/events/PageTransitionEvent-impl.js +20 -0
- package/lib/jsdom/living/events/PointerEvent-impl.js +21 -0
- package/lib/jsdom/living/events/PopStateEvent-impl.js +9 -0
- package/lib/jsdom/living/events/ProgressEvent-impl.js +14 -0
- package/lib/jsdom/living/events/PromiseRejectionEvent-impl.js +14 -0
- package/lib/jsdom/living/events/StorageEvent-impl.js +26 -0
- package/lib/jsdom/living/events/SubmitEvent-impl.js +13 -0
- package/lib/jsdom/living/events/TouchEvent-impl.js +14 -0
- package/lib/jsdom/living/events/TransitionEvent-impl.js +10 -0
- package/lib/jsdom/living/events/UIEvent-impl.js +43 -0
- package/lib/jsdom/living/events/WheelEvent-impl.js +12 -0
- package/lib/jsdom/living/fetch/Headers-impl.js +173 -0
- package/lib/jsdom/living/fetch/header-list.js +158 -0
- package/lib/jsdom/living/fetch/header-types.js +205 -0
- package/lib/jsdom/living/fetch/header-utils.js +26 -0
- package/lib/jsdom/living/file-api/Blob-impl.js +125 -0
- package/lib/jsdom/living/file-api/File-impl.js +12 -0
- package/lib/jsdom/living/file-api/FileList-impl.js +15 -0
- package/lib/jsdom/living/file-api/FileReader-impl.js +148 -0
- package/lib/jsdom/living/geometry/DOMRect-impl.js +39 -0
- package/lib/jsdom/living/geometry/DOMRectReadOnly-impl.js +72 -0
- package/lib/jsdom/living/helpers/binary-data.js +63 -0
- package/lib/jsdom/living/helpers/by-id-cache.js +67 -0
- package/lib/jsdom/living/helpers/colors.js +245 -0
- package/lib/jsdom/living/helpers/create-element.js +329 -0
- package/lib/jsdom/living/helpers/create-event-accessor.js +209 -0
- package/lib/jsdom/living/helpers/custom-elements.js +272 -0
- package/lib/jsdom/living/helpers/dates-and-times.js +270 -0
- package/lib/jsdom/living/helpers/details.js +15 -0
- package/lib/jsdom/living/helpers/encoding.js +60 -0
- package/lib/jsdom/living/helpers/events.js +24 -0
- package/lib/jsdom/living/helpers/focusing.js +104 -0
- package/lib/jsdom/living/helpers/form-controls.js +309 -0
- package/lib/jsdom/living/helpers/html-constructor.js +78 -0
- package/lib/jsdom/living/helpers/internal-constants.js +12 -0
- package/lib/jsdom/living/helpers/is-window.js +18 -0
- package/lib/jsdom/living/helpers/iterable-weak-set.js +48 -0
- package/lib/jsdom/living/helpers/json.js +7 -0
- package/lib/jsdom/living/helpers/mutation-observers.js +198 -0
- package/lib/jsdom/living/helpers/namespaces.js +16 -0
- package/lib/jsdom/living/helpers/node.js +108 -0
- package/lib/jsdom/living/helpers/number-and-date-inputs.js +195 -0
- package/lib/jsdom/living/helpers/ordered-set.js +104 -0
- package/lib/jsdom/living/helpers/page-transition-event.js +9 -0
- package/lib/jsdom/living/helpers/runtime-script-errors.js +75 -0
- package/lib/jsdom/living/helpers/shadow-dom.js +285 -0
- package/lib/jsdom/living/helpers/strings.js +168 -0
- package/lib/jsdom/living/helpers/style-rules.js +404 -0
- package/lib/jsdom/living/helpers/stylesheets.js +148 -0
- package/lib/jsdom/living/helpers/svg/basic-types.js +41 -0
- package/lib/jsdom/living/helpers/svg/render.js +46 -0
- package/lib/jsdom/living/helpers/system-colors.js +147 -0
- package/lib/jsdom/living/helpers/text.js +19 -0
- package/lib/jsdom/living/helpers/traversal.js +72 -0
- package/lib/jsdom/living/helpers/validate-names.js +65 -0
- package/lib/jsdom/living/hr-time/Performance-impl.js +22 -0
- package/lib/jsdom/living/interfaces.js +252 -0
- package/lib/jsdom/living/mutation-observer/MutationObserver-impl.js +95 -0
- package/lib/jsdom/living/mutation-observer/MutationRecord-impl.js +37 -0
- package/lib/jsdom/living/navigator/MimeType-impl.js +3 -0
- package/lib/jsdom/living/navigator/MimeTypeArray-impl.js +21 -0
- package/lib/jsdom/living/navigator/Navigator-impl.js +29 -0
- package/lib/jsdom/living/navigator/NavigatorConcurrentHardware-impl.js +8 -0
- package/lib/jsdom/living/navigator/NavigatorCookies-impl.js +7 -0
- package/lib/jsdom/living/navigator/NavigatorID-impl.js +37 -0
- package/lib/jsdom/living/navigator/NavigatorLanguage-impl.js +9 -0
- package/lib/jsdom/living/navigator/NavigatorOnLine-impl.js +7 -0
- package/lib/jsdom/living/navigator/NavigatorPlugins-impl.js +8 -0
- package/lib/jsdom/living/navigator/Plugin-impl.js +3 -0
- package/lib/jsdom/living/navigator/PluginArray-impl.js +23 -0
- package/lib/jsdom/living/node-document-position.js +10 -0
- package/lib/jsdom/living/node-type.js +16 -0
- package/lib/jsdom/living/node.js +331 -0
- package/lib/jsdom/living/nodes/CDATASection-impl.js +16 -0
- package/lib/jsdom/living/nodes/CharacterData-impl.js +118 -0
- package/lib/jsdom/living/nodes/ChildNode-impl.js +80 -0
- package/lib/jsdom/living/nodes/Comment-impl.js +20 -0
- package/lib/jsdom/living/nodes/DOMImplementation-impl.js +120 -0
- package/lib/jsdom/living/nodes/DOMStringMap-impl.js +64 -0
- package/lib/jsdom/living/nodes/DOMTokenList-impl.js +171 -0
- package/lib/jsdom/living/nodes/Document-impl.js +1000 -0
- package/lib/jsdom/living/nodes/DocumentFragment-impl.js +44 -0
- package/lib/jsdom/living/nodes/DocumentOrShadowRoot-impl.js +28 -0
- package/lib/jsdom/living/nodes/DocumentType-impl.js +24 -0
- package/lib/jsdom/living/nodes/Element-impl.js +584 -0
- package/lib/jsdom/living/nodes/ElementCSSInlineStyle-impl.js +22 -0
- package/lib/jsdom/living/nodes/ElementContentEditable-impl.js +7 -0
- package/lib/jsdom/living/nodes/GlobalEventHandlers-impl.js +81 -0
- package/lib/jsdom/living/nodes/HTMLAnchorElement-impl.js +50 -0
- package/lib/jsdom/living/nodes/HTMLAreaElement-impl.js +43 -0
- package/lib/jsdom/living/nodes/HTMLAudioElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLBRElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLBaseElement-impl.js +44 -0
- package/lib/jsdom/living/nodes/HTMLBodyElement-impl.js +12 -0
- package/lib/jsdom/living/nodes/HTMLButtonElement-impl.js +79 -0
- package/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js +136 -0
- package/lib/jsdom/living/nodes/HTMLCollection-impl.js +96 -0
- package/lib/jsdom/living/nodes/HTMLDListElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLDataElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLDataListElement-impl.js +20 -0
- package/lib/jsdom/living/nodes/HTMLDetailsElement-impl.js +35 -0
- package/lib/jsdom/living/nodes/HTMLDialogElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLDirectoryElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLDivElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLElement-impl.js +211 -0
- package/lib/jsdom/living/nodes/HTMLEmbedElement-impl.js +8 -0
- package/lib/jsdom/living/nodes/HTMLFieldSetElement-impl.js +43 -0
- package/lib/jsdom/living/nodes/HTMLFontElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLFormControlsCollection-impl.js +33 -0
- package/lib/jsdom/living/nodes/HTMLFormElement-impl.js +248 -0
- package/lib/jsdom/living/nodes/HTMLFrameElement-impl.js +266 -0
- package/lib/jsdom/living/nodes/HTMLFrameSetElement-impl.js +12 -0
- package/lib/jsdom/living/nodes/HTMLHRElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLHeadElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLHeadingElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLHtmlElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLHyperlinkElementUtils-impl.js +368 -0
- package/lib/jsdom/living/nodes/HTMLIFrameElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLImageElement-impl.js +127 -0
- package/lib/jsdom/living/nodes/HTMLInputElement-impl.js +1097 -0
- package/lib/jsdom/living/nodes/HTMLLIElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLLabelElement-impl.js +94 -0
- package/lib/jsdom/living/nodes/HTMLLegendElement-impl.js +18 -0
- package/lib/jsdom/living/nodes/HTMLLinkElement-impl.js +107 -0
- package/lib/jsdom/living/nodes/HTMLMapElement-impl.js +13 -0
- package/lib/jsdom/living/nodes/HTMLMarqueeElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLMediaElement-impl.js +138 -0
- package/lib/jsdom/living/nodes/HTMLMenuElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLMetaElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLMeterElement-impl.js +180 -0
- package/lib/jsdom/living/nodes/HTMLModElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLOListElement-impl.js +22 -0
- package/lib/jsdom/living/nodes/HTMLObjectElement-impl.js +26 -0
- package/lib/jsdom/living/nodes/HTMLOptGroupElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLOptionElement-impl.js +146 -0
- package/lib/jsdom/living/nodes/HTMLOptionsCollection-impl.js +110 -0
- package/lib/jsdom/living/nodes/HTMLOrSVGElement-impl.js +88 -0
- package/lib/jsdom/living/nodes/HTMLOutputElement-impl.js +88 -0
- package/lib/jsdom/living/nodes/HTMLParagraphElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLParamElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLPictureElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLPreElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLProgressElement-impl.js +72 -0
- package/lib/jsdom/living/nodes/HTMLQuoteElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLScriptElement-impl.js +255 -0
- package/lib/jsdom/living/nodes/HTMLSelectElement-impl.js +283 -0
- package/lib/jsdom/living/nodes/HTMLSlotElement-impl.js +59 -0
- package/lib/jsdom/living/nodes/HTMLSourceElement-impl.js +8 -0
- package/lib/jsdom/living/nodes/HTMLSpanElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLStyleElement-impl.js +76 -0
- package/lib/jsdom/living/nodes/HTMLTableCaptionElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLTableCellElement-impl.js +73 -0
- package/lib/jsdom/living/nodes/HTMLTableColElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLTableElement-impl.js +236 -0
- package/lib/jsdom/living/nodes/HTMLTableRowElement-impl.js +88 -0
- package/lib/jsdom/living/nodes/HTMLTableSectionElement-impl.js +61 -0
- package/lib/jsdom/living/nodes/HTMLTemplateElement-impl.js +67 -0
- package/lib/jsdom/living/nodes/HTMLTextAreaElement-impl.js +244 -0
- package/lib/jsdom/living/nodes/HTMLTimeElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLTitleElement-impl.js +18 -0
- package/lib/jsdom/living/nodes/HTMLTrackElement-impl.js +13 -0
- package/lib/jsdom/living/nodes/HTMLUListElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLUnknownElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/HTMLVideoElement-impl.js +17 -0
- package/lib/jsdom/living/nodes/LinkStyle-impl.js +2 -0
- package/lib/jsdom/living/nodes/Node-impl.js +1179 -0
- package/lib/jsdom/living/nodes/NodeList-impl.js +43 -0
- package/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl.js +28 -0
- package/lib/jsdom/living/nodes/NonElementParentNode-impl.js +11 -0
- package/lib/jsdom/living/nodes/ParentNode-impl.js +90 -0
- package/lib/jsdom/living/nodes/ProcessingInstruction-impl.js +22 -0
- package/lib/jsdom/living/nodes/RadioNodeList-impl.js +49 -0
- package/lib/jsdom/living/nodes/SVGDefsElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/SVGDescElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/SVGElement-impl.js +64 -0
- package/lib/jsdom/living/nodes/SVGGElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/SVGGraphicsElement-impl.js +16 -0
- package/lib/jsdom/living/nodes/SVGMetadataElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/SVGSVGElement-impl.js +40 -0
- package/lib/jsdom/living/nodes/SVGSwitchElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/SVGSymbolElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/SVGTests-impl.js +42 -0
- package/lib/jsdom/living/nodes/SVGTitleElement-impl.js +9 -0
- package/lib/jsdom/living/nodes/ShadowRoot-impl.js +41 -0
- package/lib/jsdom/living/nodes/Slotable-impl.js +48 -0
- package/lib/jsdom/living/nodes/Text-impl.js +96 -0
- package/lib/jsdom/living/nodes/WindowEventHandlers-impl.js +14 -0
- package/lib/jsdom/living/nodes/XMLDocument-impl.js +4 -0
- package/lib/jsdom/living/range/AbstractRange-impl.js +43 -0
- package/lib/jsdom/living/range/Range-impl.js +902 -0
- package/lib/jsdom/living/range/StaticRange-impl.js +39 -0
- package/lib/jsdom/living/range/boundary-point.js +47 -0
- package/lib/jsdom/living/selection/Selection-impl.js +358 -0
- package/lib/jsdom/living/svg/SVGAnimatedPreserveAspectRatio-impl.js +24 -0
- package/lib/jsdom/living/svg/SVGAnimatedRect-impl.js +122 -0
- package/lib/jsdom/living/svg/SVGAnimatedString-impl.js +42 -0
- package/lib/jsdom/living/svg/SVGListBase.js +195 -0
- package/lib/jsdom/living/svg/SVGNumber-impl.js +48 -0
- package/lib/jsdom/living/svg/SVGPreserveAspectRatio-impl.js +100 -0
- package/lib/jsdom/living/svg/SVGRect-impl.js +143 -0
- package/lib/jsdom/living/svg/SVGStringList-impl.js +16 -0
- package/lib/jsdom/living/traversal/NodeIterator-impl.js +107 -0
- package/lib/jsdom/living/traversal/TreeWalker-impl.js +217 -0
- package/lib/jsdom/living/traversal/helpers.js +44 -0
- package/lib/jsdom/living/webidl/DOMException-impl.js +46 -0
- package/lib/jsdom/living/websockets/WebSocket-impl.js +211 -0
- package/lib/jsdom/living/webstorage/Storage-impl.js +102 -0
- package/lib/jsdom/living/window/BarProp-impl.js +10 -0
- package/lib/jsdom/living/window/External-impl.js +9 -0
- package/lib/jsdom/living/window/History-impl.js +148 -0
- package/lib/jsdom/living/window/Location-impl.js +227 -0
- package/lib/jsdom/living/window/Screen-impl.js +13 -0
- package/lib/jsdom/living/window/SessionHistory.js +163 -0
- package/lib/jsdom/living/window/navigation.js +87 -0
- package/lib/jsdom/living/window-properties.js +241 -0
- package/lib/jsdom/living/xhr/FormData-impl.js +191 -0
- package/lib/jsdom/living/xhr/XMLHttpRequest-impl.js +1057 -0
- package/lib/jsdom/living/xhr/XMLHttpRequestEventTarget-impl.js +17 -0
- package/lib/jsdom/living/xhr/XMLHttpRequestUpload-impl.js +4 -0
- package/lib/jsdom/living/xhr/multipart-form-data.js +99 -0
- package/lib/jsdom/living/xhr/xhr-sync-worker.js +51 -0
- package/lib/jsdom/living/xhr/xhr-utils.js +206 -0
- package/lib/jsdom/utils.js +105 -0
- package/lib/jsdom/virtual-console.js +46 -0
- package/package.json +143 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const conversions = require("webidl-conversions");
|
|
4
|
+
const utils = require("./utils.js");
|
|
5
|
+
|
|
6
|
+
const Blob = require("./Blob.js");
|
|
7
|
+
const EventHandlerNonNull = require("./EventHandlerNonNull.js");
|
|
8
|
+
const implSymbol = utils.implSymbol;
|
|
9
|
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
|
10
|
+
const EventTarget = require("./EventTarget.js");
|
|
11
|
+
|
|
12
|
+
const interfaceName = "FileReader";
|
|
13
|
+
|
|
14
|
+
exports.is = value => {
|
|
15
|
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
|
16
|
+
};
|
|
17
|
+
exports.isImpl = value => {
|
|
18
|
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
|
19
|
+
};
|
|
20
|
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
|
21
|
+
if (exports.is(value)) {
|
|
22
|
+
return utils.implForWrapper(value);
|
|
23
|
+
}
|
|
24
|
+
throw new globalObject.TypeError(`${context} is not of type 'FileReader'.`);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function makeWrapper(globalObject, newTarget) {
|
|
28
|
+
let proto;
|
|
29
|
+
if (newTarget !== undefined) {
|
|
30
|
+
proto = newTarget.prototype;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (!utils.isObject(proto)) {
|
|
34
|
+
proto = globalObject[ctorRegistrySymbol]["FileReader"].prototype;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return Object.create(proto);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
|
41
|
+
const wrapper = makeWrapper(globalObject);
|
|
42
|
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
|
46
|
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
|
47
|
+
return utils.implForWrapper(wrapper);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports._internalSetup = (wrapper, globalObject) => {
|
|
51
|
+
EventTarget._internalSetup(wrapper, globalObject);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
|
55
|
+
privateData.wrapper = wrapper;
|
|
56
|
+
|
|
57
|
+
exports._internalSetup(wrapper, globalObject);
|
|
58
|
+
Object.defineProperty(wrapper, implSymbol, {
|
|
59
|
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
|
60
|
+
configurable: true
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
|
64
|
+
if (Impl.init) {
|
|
65
|
+
Impl.init(wrapper[implSymbol]);
|
|
66
|
+
}
|
|
67
|
+
return wrapper;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
exports.new = (globalObject, newTarget) => {
|
|
71
|
+
const wrapper = makeWrapper(globalObject, newTarget);
|
|
72
|
+
|
|
73
|
+
exports._internalSetup(wrapper, globalObject);
|
|
74
|
+
Object.defineProperty(wrapper, implSymbol, {
|
|
75
|
+
value: Object.create(Impl.implementation.prototype),
|
|
76
|
+
configurable: true
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
|
80
|
+
if (Impl.init) {
|
|
81
|
+
Impl.init(wrapper[implSymbol]);
|
|
82
|
+
}
|
|
83
|
+
return wrapper[implSymbol];
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const exposed = new Set(["Window", "Worker"]);
|
|
87
|
+
|
|
88
|
+
exports.install = (globalObject, globalNames) => {
|
|
89
|
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
|
94
|
+
class FileReader extends globalObject.EventTarget {
|
|
95
|
+
constructor() {
|
|
96
|
+
return exports.setup(Object.create(new.target.prototype), globalObject, undefined);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
readAsArrayBuffer(blob) {
|
|
100
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
101
|
+
if (!exports.is(esValue)) {
|
|
102
|
+
throw new globalObject.TypeError(
|
|
103
|
+
"'readAsArrayBuffer' called on an object that is not a valid instance of FileReader."
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (arguments.length < 1) {
|
|
108
|
+
throw new globalObject.TypeError(
|
|
109
|
+
`Failed to execute 'readAsArrayBuffer' on 'FileReader': 1 argument required, but only ${arguments.length} present.`
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
const args = [];
|
|
113
|
+
{
|
|
114
|
+
let curArg = arguments[0];
|
|
115
|
+
curArg = Blob.convert(globalObject, curArg, {
|
|
116
|
+
context: "Failed to execute 'readAsArrayBuffer' on 'FileReader': parameter 1"
|
|
117
|
+
});
|
|
118
|
+
args.push(curArg);
|
|
119
|
+
}
|
|
120
|
+
return esValue[implSymbol].readAsArrayBuffer(...args);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
readAsBinaryString(blob) {
|
|
124
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
125
|
+
if (!exports.is(esValue)) {
|
|
126
|
+
throw new globalObject.TypeError(
|
|
127
|
+
"'readAsBinaryString' called on an object that is not a valid instance of FileReader."
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (arguments.length < 1) {
|
|
132
|
+
throw new globalObject.TypeError(
|
|
133
|
+
`Failed to execute 'readAsBinaryString' on 'FileReader': 1 argument required, but only ${arguments.length} present.`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
const args = [];
|
|
137
|
+
{
|
|
138
|
+
let curArg = arguments[0];
|
|
139
|
+
curArg = Blob.convert(globalObject, curArg, {
|
|
140
|
+
context: "Failed to execute 'readAsBinaryString' on 'FileReader': parameter 1"
|
|
141
|
+
});
|
|
142
|
+
args.push(curArg);
|
|
143
|
+
}
|
|
144
|
+
return esValue[implSymbol].readAsBinaryString(...args);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
readAsText(blob) {
|
|
148
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
149
|
+
if (!exports.is(esValue)) {
|
|
150
|
+
throw new globalObject.TypeError(
|
|
151
|
+
"'readAsText' called on an object that is not a valid instance of FileReader."
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (arguments.length < 1) {
|
|
156
|
+
throw new globalObject.TypeError(
|
|
157
|
+
`Failed to execute 'readAsText' on 'FileReader': 1 argument required, but only ${arguments.length} present.`
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
const args = [];
|
|
161
|
+
{
|
|
162
|
+
let curArg = arguments[0];
|
|
163
|
+
curArg = Blob.convert(globalObject, curArg, {
|
|
164
|
+
context: "Failed to execute 'readAsText' on 'FileReader': parameter 1"
|
|
165
|
+
});
|
|
166
|
+
args.push(curArg);
|
|
167
|
+
}
|
|
168
|
+
{
|
|
169
|
+
let curArg = arguments[1];
|
|
170
|
+
if (curArg !== undefined) {
|
|
171
|
+
curArg = conversions["DOMString"](curArg, {
|
|
172
|
+
context: "Failed to execute 'readAsText' on 'FileReader': parameter 2",
|
|
173
|
+
globals: globalObject
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
args.push(curArg);
|
|
177
|
+
}
|
|
178
|
+
return esValue[implSymbol].readAsText(...args);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
readAsDataURL(blob) {
|
|
182
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
183
|
+
if (!exports.is(esValue)) {
|
|
184
|
+
throw new globalObject.TypeError(
|
|
185
|
+
"'readAsDataURL' called on an object that is not a valid instance of FileReader."
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (arguments.length < 1) {
|
|
190
|
+
throw new globalObject.TypeError(
|
|
191
|
+
`Failed to execute 'readAsDataURL' on 'FileReader': 1 argument required, but only ${arguments.length} present.`
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
const args = [];
|
|
195
|
+
{
|
|
196
|
+
let curArg = arguments[0];
|
|
197
|
+
curArg = Blob.convert(globalObject, curArg, {
|
|
198
|
+
context: "Failed to execute 'readAsDataURL' on 'FileReader': parameter 1"
|
|
199
|
+
});
|
|
200
|
+
args.push(curArg);
|
|
201
|
+
}
|
|
202
|
+
return esValue[implSymbol].readAsDataURL(...args);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
abort() {
|
|
206
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
207
|
+
if (!exports.is(esValue)) {
|
|
208
|
+
throw new globalObject.TypeError("'abort' called on an object that is not a valid instance of FileReader.");
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return esValue[implSymbol].abort();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
get readyState() {
|
|
215
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
216
|
+
|
|
217
|
+
if (!exports.is(esValue)) {
|
|
218
|
+
throw new globalObject.TypeError(
|
|
219
|
+
"'get readyState' called on an object that is not a valid instance of FileReader."
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return esValue[implSymbol]["readyState"];
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
get result() {
|
|
227
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
228
|
+
|
|
229
|
+
if (!exports.is(esValue)) {
|
|
230
|
+
throw new globalObject.TypeError(
|
|
231
|
+
"'get result' called on an object that is not a valid instance of FileReader."
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["result"]);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
get error() {
|
|
239
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
240
|
+
|
|
241
|
+
if (!exports.is(esValue)) {
|
|
242
|
+
throw new globalObject.TypeError("'get error' called on an object that is not a valid instance of FileReader.");
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["error"]);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
get onloadstart() {
|
|
249
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
250
|
+
|
|
251
|
+
if (!exports.is(esValue)) {
|
|
252
|
+
throw new globalObject.TypeError(
|
|
253
|
+
"'get onloadstart' called on an object that is not a valid instance of FileReader."
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onloadstart"]);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
set onloadstart(V) {
|
|
261
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
262
|
+
|
|
263
|
+
if (!exports.is(esValue)) {
|
|
264
|
+
throw new globalObject.TypeError(
|
|
265
|
+
"'set onloadstart' called on an object that is not a valid instance of FileReader."
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (!utils.isObject(V)) {
|
|
270
|
+
V = null;
|
|
271
|
+
} else {
|
|
272
|
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
|
273
|
+
context: "Failed to set the 'onloadstart' property on 'FileReader': The provided value"
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
esValue[implSymbol]["onloadstart"] = V;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
get onprogress() {
|
|
280
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
281
|
+
|
|
282
|
+
if (!exports.is(esValue)) {
|
|
283
|
+
throw new globalObject.TypeError(
|
|
284
|
+
"'get onprogress' called on an object that is not a valid instance of FileReader."
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onprogress"]);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
set onprogress(V) {
|
|
292
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
293
|
+
|
|
294
|
+
if (!exports.is(esValue)) {
|
|
295
|
+
throw new globalObject.TypeError(
|
|
296
|
+
"'set onprogress' called on an object that is not a valid instance of FileReader."
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if (!utils.isObject(V)) {
|
|
301
|
+
V = null;
|
|
302
|
+
} else {
|
|
303
|
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
|
304
|
+
context: "Failed to set the 'onprogress' property on 'FileReader': The provided value"
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
esValue[implSymbol]["onprogress"] = V;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
get onload() {
|
|
311
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
312
|
+
|
|
313
|
+
if (!exports.is(esValue)) {
|
|
314
|
+
throw new globalObject.TypeError(
|
|
315
|
+
"'get onload' called on an object that is not a valid instance of FileReader."
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onload"]);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
set onload(V) {
|
|
323
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
324
|
+
|
|
325
|
+
if (!exports.is(esValue)) {
|
|
326
|
+
throw new globalObject.TypeError(
|
|
327
|
+
"'set onload' called on an object that is not a valid instance of FileReader."
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (!utils.isObject(V)) {
|
|
332
|
+
V = null;
|
|
333
|
+
} else {
|
|
334
|
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
|
335
|
+
context: "Failed to set the 'onload' property on 'FileReader': The provided value"
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
esValue[implSymbol]["onload"] = V;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
get onabort() {
|
|
342
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
343
|
+
|
|
344
|
+
if (!exports.is(esValue)) {
|
|
345
|
+
throw new globalObject.TypeError(
|
|
346
|
+
"'get onabort' called on an object that is not a valid instance of FileReader."
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onabort"]);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
set onabort(V) {
|
|
354
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
355
|
+
|
|
356
|
+
if (!exports.is(esValue)) {
|
|
357
|
+
throw new globalObject.TypeError(
|
|
358
|
+
"'set onabort' called on an object that is not a valid instance of FileReader."
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
if (!utils.isObject(V)) {
|
|
363
|
+
V = null;
|
|
364
|
+
} else {
|
|
365
|
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
|
366
|
+
context: "Failed to set the 'onabort' property on 'FileReader': The provided value"
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
esValue[implSymbol]["onabort"] = V;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
get onerror() {
|
|
373
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
374
|
+
|
|
375
|
+
if (!exports.is(esValue)) {
|
|
376
|
+
throw new globalObject.TypeError(
|
|
377
|
+
"'get onerror' called on an object that is not a valid instance of FileReader."
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onerror"]);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
set onerror(V) {
|
|
385
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
386
|
+
|
|
387
|
+
if (!exports.is(esValue)) {
|
|
388
|
+
throw new globalObject.TypeError(
|
|
389
|
+
"'set onerror' called on an object that is not a valid instance of FileReader."
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (!utils.isObject(V)) {
|
|
394
|
+
V = null;
|
|
395
|
+
} else {
|
|
396
|
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
|
397
|
+
context: "Failed to set the 'onerror' property on 'FileReader': The provided value"
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
esValue[implSymbol]["onerror"] = V;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
get onloadend() {
|
|
404
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
405
|
+
|
|
406
|
+
if (!exports.is(esValue)) {
|
|
407
|
+
throw new globalObject.TypeError(
|
|
408
|
+
"'get onloadend' called on an object that is not a valid instance of FileReader."
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onloadend"]);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
set onloadend(V) {
|
|
416
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
417
|
+
|
|
418
|
+
if (!exports.is(esValue)) {
|
|
419
|
+
throw new globalObject.TypeError(
|
|
420
|
+
"'set onloadend' called on an object that is not a valid instance of FileReader."
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if (!utils.isObject(V)) {
|
|
425
|
+
V = null;
|
|
426
|
+
} else {
|
|
427
|
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
|
428
|
+
context: "Failed to set the 'onloadend' property on 'FileReader': The provided value"
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
esValue[implSymbol]["onloadend"] = V;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
Object.defineProperties(FileReader.prototype, {
|
|
435
|
+
readAsArrayBuffer: { enumerable: true },
|
|
436
|
+
readAsBinaryString: { enumerable: true },
|
|
437
|
+
readAsText: { enumerable: true },
|
|
438
|
+
readAsDataURL: { enumerable: true },
|
|
439
|
+
abort: { enumerable: true },
|
|
440
|
+
readyState: { enumerable: true },
|
|
441
|
+
result: { enumerable: true },
|
|
442
|
+
error: { enumerable: true },
|
|
443
|
+
onloadstart: { enumerable: true },
|
|
444
|
+
onprogress: { enumerable: true },
|
|
445
|
+
onload: { enumerable: true },
|
|
446
|
+
onabort: { enumerable: true },
|
|
447
|
+
onerror: { enumerable: true },
|
|
448
|
+
onloadend: { enumerable: true },
|
|
449
|
+
[Symbol.toStringTag]: { value: "FileReader", configurable: true },
|
|
450
|
+
EMPTY: { value: 0, enumerable: true },
|
|
451
|
+
LOADING: { value: 1, enumerable: true },
|
|
452
|
+
DONE: { value: 2, enumerable: true }
|
|
453
|
+
});
|
|
454
|
+
Object.defineProperties(FileReader, {
|
|
455
|
+
EMPTY: { value: 0, enumerable: true },
|
|
456
|
+
LOADING: { value: 1, enumerable: true },
|
|
457
|
+
DONE: { value: 2, enumerable: true }
|
|
458
|
+
});
|
|
459
|
+
ctorRegistry[interfaceName] = FileReader;
|
|
460
|
+
|
|
461
|
+
Object.defineProperty(globalObject, interfaceName, {
|
|
462
|
+
configurable: true,
|
|
463
|
+
writable: true,
|
|
464
|
+
value: FileReader
|
|
465
|
+
});
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
const Impl = require("../../jsdom/living/file-api/FileReader-impl.js");
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const conversions = require("webidl-conversions");
|
|
4
|
+
const utils = require("./utils.js");
|
|
5
|
+
|
|
6
|
+
const FocusEventInit = require("./FocusEventInit.js");
|
|
7
|
+
const implSymbol = utils.implSymbol;
|
|
8
|
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
|
9
|
+
const UIEvent = require("./UIEvent.js");
|
|
10
|
+
|
|
11
|
+
const interfaceName = "FocusEvent";
|
|
12
|
+
|
|
13
|
+
exports.is = value => {
|
|
14
|
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
|
15
|
+
};
|
|
16
|
+
exports.isImpl = value => {
|
|
17
|
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
|
18
|
+
};
|
|
19
|
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
|
20
|
+
if (exports.is(value)) {
|
|
21
|
+
return utils.implForWrapper(value);
|
|
22
|
+
}
|
|
23
|
+
throw new globalObject.TypeError(`${context} is not of type 'FocusEvent'.`);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function makeWrapper(globalObject, newTarget) {
|
|
27
|
+
let proto;
|
|
28
|
+
if (newTarget !== undefined) {
|
|
29
|
+
proto = newTarget.prototype;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (!utils.isObject(proto)) {
|
|
33
|
+
proto = globalObject[ctorRegistrySymbol]["FocusEvent"].prototype;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return Object.create(proto);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
|
40
|
+
const wrapper = makeWrapper(globalObject);
|
|
41
|
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
|
45
|
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
|
46
|
+
return utils.implForWrapper(wrapper);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
exports._internalSetup = (wrapper, globalObject) => {
|
|
50
|
+
UIEvent._internalSetup(wrapper, globalObject);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
|
54
|
+
privateData.wrapper = wrapper;
|
|
55
|
+
|
|
56
|
+
exports._internalSetup(wrapper, globalObject);
|
|
57
|
+
Object.defineProperty(wrapper, implSymbol, {
|
|
58
|
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
|
59
|
+
configurable: true
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
|
63
|
+
if (Impl.init) {
|
|
64
|
+
Impl.init(wrapper[implSymbol]);
|
|
65
|
+
}
|
|
66
|
+
return wrapper;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
exports.new = (globalObject, newTarget) => {
|
|
70
|
+
const wrapper = makeWrapper(globalObject, newTarget);
|
|
71
|
+
|
|
72
|
+
exports._internalSetup(wrapper, globalObject);
|
|
73
|
+
Object.defineProperty(wrapper, implSymbol, {
|
|
74
|
+
value: Object.create(Impl.implementation.prototype),
|
|
75
|
+
configurable: true
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
|
79
|
+
if (Impl.init) {
|
|
80
|
+
Impl.init(wrapper[implSymbol]);
|
|
81
|
+
}
|
|
82
|
+
return wrapper[implSymbol];
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const exposed = new Set(["Window"]);
|
|
86
|
+
|
|
87
|
+
exports.install = (globalObject, globalNames) => {
|
|
88
|
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
|
93
|
+
class FocusEvent extends globalObject.UIEvent {
|
|
94
|
+
constructor(type) {
|
|
95
|
+
if (arguments.length < 1) {
|
|
96
|
+
throw new globalObject.TypeError(
|
|
97
|
+
`Failed to construct 'FocusEvent': 1 argument required, but only ${arguments.length} present.`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
const args = [];
|
|
101
|
+
{
|
|
102
|
+
let curArg = arguments[0];
|
|
103
|
+
curArg = conversions["DOMString"](curArg, {
|
|
104
|
+
context: "Failed to construct 'FocusEvent': parameter 1",
|
|
105
|
+
globals: globalObject
|
|
106
|
+
});
|
|
107
|
+
args.push(curArg);
|
|
108
|
+
}
|
|
109
|
+
{
|
|
110
|
+
let curArg = arguments[1];
|
|
111
|
+
curArg = FocusEventInit.convert(globalObject, curArg, {
|
|
112
|
+
context: "Failed to construct 'FocusEvent': parameter 2"
|
|
113
|
+
});
|
|
114
|
+
args.push(curArg);
|
|
115
|
+
}
|
|
116
|
+
return exports.setup(Object.create(new.target.prototype), globalObject, args);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
get relatedTarget() {
|
|
120
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
121
|
+
|
|
122
|
+
if (!exports.is(esValue)) {
|
|
123
|
+
throw new globalObject.TypeError(
|
|
124
|
+
"'get relatedTarget' called on an object that is not a valid instance of FocusEvent."
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["relatedTarget"]);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
Object.defineProperties(FocusEvent.prototype, {
|
|
132
|
+
relatedTarget: { enumerable: true },
|
|
133
|
+
[Symbol.toStringTag]: { value: "FocusEvent", configurable: true }
|
|
134
|
+
});
|
|
135
|
+
ctorRegistry[interfaceName] = FocusEvent;
|
|
136
|
+
|
|
137
|
+
Object.defineProperty(globalObject, interfaceName, {
|
|
138
|
+
configurable: true,
|
|
139
|
+
writable: true,
|
|
140
|
+
value: FocusEvent
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const Impl = require("../../jsdom/living/events/FocusEvent-impl.js");
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const conversions = require("webidl-conversions");
|
|
4
|
+
const utils = require("./utils.js");
|
|
5
|
+
|
|
6
|
+
const EventTarget = require("./EventTarget.js");
|
|
7
|
+
const UIEventInit = require("./UIEventInit.js");
|
|
8
|
+
|
|
9
|
+
exports._convertInherit = (globalObject, obj, ret, { context = "The provided value" } = {}) => {
|
|
10
|
+
UIEventInit._convertInherit(globalObject, obj, ret, { context });
|
|
11
|
+
|
|
12
|
+
{
|
|
13
|
+
const key = "relatedTarget";
|
|
14
|
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
|
15
|
+
if (value !== undefined) {
|
|
16
|
+
if (value === null || value === undefined) {
|
|
17
|
+
value = null;
|
|
18
|
+
} else {
|
|
19
|
+
value = EventTarget.convert(globalObject, value, { context: context + " has member 'relatedTarget' that" });
|
|
20
|
+
}
|
|
21
|
+
ret[key] = value;
|
|
22
|
+
} else {
|
|
23
|
+
ret[key] = null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.convert = (globalObject, obj, { context = "The provided value" } = {}) => {
|
|
29
|
+
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
|
|
30
|
+
throw new globalObject.TypeError(`${context} is not an object.`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const ret = Object.create(null);
|
|
34
|
+
exports._convertInherit(globalObject, obj, ret, { context });
|
|
35
|
+
return ret;
|
|
36
|
+
};
|