@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,309 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
isValidFloatingPointNumber,
|
|
5
|
+
isValidSimpleColor,
|
|
6
|
+
parseFloatingPointNumber,
|
|
7
|
+
stripLeadingAndTrailingASCIIWhitespace,
|
|
8
|
+
stripNewlines,
|
|
9
|
+
splitOnCommas
|
|
10
|
+
} = require("./strings");
|
|
11
|
+
const {
|
|
12
|
+
isValidDateString,
|
|
13
|
+
isValidMonthString,
|
|
14
|
+
isValidTimeString,
|
|
15
|
+
isValidWeekString,
|
|
16
|
+
parseLocalDateAndTimeString,
|
|
17
|
+
serializeNormalizedDateAndTime
|
|
18
|
+
} = require("./dates-and-times");
|
|
19
|
+
const whatwgURL = require("whatwg-url");
|
|
20
|
+
|
|
21
|
+
const NodeList = require("../../../generated/idl/NodeList");
|
|
22
|
+
const { domSymbolTree } = require("./internal-constants");
|
|
23
|
+
const { closest, firstChildWithLocalName } = require("./traversal");
|
|
24
|
+
const NODE_TYPE = require("../node-type");
|
|
25
|
+
const { HTML_NS } = require("./namespaces");
|
|
26
|
+
|
|
27
|
+
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-disabled
|
|
28
|
+
exports.isDisabled = formControl => {
|
|
29
|
+
if (formControl.localName === "button" || formControl.localName === "input" || formControl.localName === "select" ||
|
|
30
|
+
formControl.localName === "textarea") {
|
|
31
|
+
if (formControl.hasAttributeNS(null, "disabled")) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let e = formControl.parentNode;
|
|
37
|
+
while (e) {
|
|
38
|
+
if (e.localName === "fieldset" && e.hasAttributeNS(null, "disabled")) {
|
|
39
|
+
const firstLegendElementChild = firstChildWithLocalName(e, "legend");
|
|
40
|
+
if (!firstLegendElementChild || !firstLegendElementChild.contains(formControl)) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
e = e.parentNode;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return false;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// https://html.spec.whatwg.org/multipage/forms.html#category-listed
|
|
51
|
+
const listedElements = new Set(["button", "fieldset", "input", "object", "output", "select", "textarea"]);
|
|
52
|
+
exports.isListed = formControl => listedElements.has(formControl._localName) && formControl.namespaceURI === HTML_NS;
|
|
53
|
+
|
|
54
|
+
// https://html.spec.whatwg.org/multipage/forms.html#category-submit
|
|
55
|
+
const submittableElements = new Set(["button", "input", "object", "select", "textarea"]);
|
|
56
|
+
exports.isSubmittable = formControl => {
|
|
57
|
+
return submittableElements.has(formControl._localName) && formControl.namespaceURI === HTML_NS;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// https://html.spec.whatwg.org/multipage/forms.html#concept-submit-button
|
|
61
|
+
const submitButtonInputTypes = new Set(["submit", "image"]);
|
|
62
|
+
exports.isSubmitButton = formControl => {
|
|
63
|
+
return ((formControl._localName === "input" && submitButtonInputTypes.has(formControl.type)) ||
|
|
64
|
+
(formControl._localName === "button" && formControl.type === "submit")) &&
|
|
65
|
+
formControl.namespaceURI === HTML_NS;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// https://html.spec.whatwg.org/multipage/forms.html#concept-button
|
|
69
|
+
const buttonInputTypes = new Set([...submitButtonInputTypes, "reset", "button"]);
|
|
70
|
+
exports.isButton = formControl => {
|
|
71
|
+
return ((formControl._localName === "input" && buttonInputTypes.has(formControl.type)) ||
|
|
72
|
+
formControl._localName === "button") &&
|
|
73
|
+
formControl.namespaceURI === HTML_NS;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// https://html.spec.whatwg.org/multipage/dom.html#interactive-content-2
|
|
77
|
+
exports.isInteractiveContent = node => {
|
|
78
|
+
if (node.nodeType !== NODE_TYPE.ELEMENT_NODE) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (node.namespaceURI !== HTML_NS) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
if (node.hasAttributeNS(null, "tabindex")) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
switch (node.localName) {
|
|
88
|
+
case "a":
|
|
89
|
+
return node.hasAttributeNS(null, "href");
|
|
90
|
+
|
|
91
|
+
case "audio":
|
|
92
|
+
case "video":
|
|
93
|
+
return node.hasAttributeNS(null, "controls");
|
|
94
|
+
|
|
95
|
+
case "img":
|
|
96
|
+
case "object":
|
|
97
|
+
return node.hasAttributeNS(null, "usemap");
|
|
98
|
+
|
|
99
|
+
case "input":
|
|
100
|
+
return node.type !== "hidden";
|
|
101
|
+
|
|
102
|
+
case "button":
|
|
103
|
+
case "details":
|
|
104
|
+
case "embed":
|
|
105
|
+
case "iframe":
|
|
106
|
+
case "label":
|
|
107
|
+
case "select":
|
|
108
|
+
case "textarea":
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return false;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// https://html.spec.whatwg.org/multipage/forms.html#category-label
|
|
116
|
+
exports.isLabelable = node => {
|
|
117
|
+
if (node.nodeType !== NODE_TYPE.ELEMENT_NODE) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if (node.namespaceURI !== HTML_NS) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
switch (node.localName) {
|
|
124
|
+
case "button":
|
|
125
|
+
case "meter":
|
|
126
|
+
case "output":
|
|
127
|
+
case "progress":
|
|
128
|
+
case "select":
|
|
129
|
+
case "textarea":
|
|
130
|
+
return true;
|
|
131
|
+
|
|
132
|
+
case "input":
|
|
133
|
+
return node.type !== "hidden";
|
|
134
|
+
}
|
|
135
|
+
if (node._ceDefinition?.formAssociated) {
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return false;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
exports.getLabelsForLabelable = labelable => {
|
|
143
|
+
if (!exports.isLabelable(labelable)) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
if (!labelable._labels) {
|
|
147
|
+
const root = labelable.getRootNode({});
|
|
148
|
+
labelable._labels = NodeList.createImpl(root._globalObject, [], {
|
|
149
|
+
element: root,
|
|
150
|
+
query: () => {
|
|
151
|
+
const nodes = [];
|
|
152
|
+
for (const descendant of domSymbolTree.treeIterator(root)) {
|
|
153
|
+
if (descendant.control === labelable) {
|
|
154
|
+
nodes.push(descendant);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return nodes;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
return labelable._labels;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address
|
|
165
|
+
exports.isValidEmailAddress = (emailAddress, multiple = false) => {
|
|
166
|
+
const emailAddressRegExp = new RegExp("^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9]" +
|
|
167
|
+
"(?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}" +
|
|
168
|
+
"[a-zA-Z0-9])?)*$");
|
|
169
|
+
// A valid e-mail address list is a set of comma-separated tokens, where each token is itself
|
|
170
|
+
// a valid e - mail address.To obtain the list of tokens from a valid e - mail address list,
|
|
171
|
+
// an implementation must split the string on commas.
|
|
172
|
+
if (multiple) {
|
|
173
|
+
return splitOnCommas(emailAddress).every(value => emailAddressRegExp.test(value));
|
|
174
|
+
}
|
|
175
|
+
return emailAddressRegExp.test(emailAddress);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
exports.isValidAbsoluteURL = url => {
|
|
179
|
+
return whatwgURL.parseURL(url) !== null;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
exports.sanitizeValueByType = (input, val) => {
|
|
183
|
+
switch (input.type.toLowerCase()) {
|
|
184
|
+
case "password":
|
|
185
|
+
case "search":
|
|
186
|
+
case "tel":
|
|
187
|
+
case "text":
|
|
188
|
+
val = stripNewlines(val);
|
|
189
|
+
break;
|
|
190
|
+
|
|
191
|
+
case "color":
|
|
192
|
+
// https://html.spec.whatwg.org/multipage/forms.html#color-state-(type=color):value-sanitization-algorithm
|
|
193
|
+
val = isValidSimpleColor(val) ? val.toLowerCase() : "#000000";
|
|
194
|
+
break;
|
|
195
|
+
|
|
196
|
+
case "date":
|
|
197
|
+
// https://html.spec.whatwg.org/multipage/input.html#date-state-(type=date):value-sanitization-algorithm
|
|
198
|
+
if (!isValidDateString(val)) {
|
|
199
|
+
val = "";
|
|
200
|
+
}
|
|
201
|
+
break;
|
|
202
|
+
|
|
203
|
+
case "datetime-local": {
|
|
204
|
+
// https://html.spec.whatwg.org/multipage/input.html#local-date-and-time-state-(type=datetime-local):value-sanitization-algorithm
|
|
205
|
+
const dateAndTime = parseLocalDateAndTimeString(val);
|
|
206
|
+
val = dateAndTime !== null ? serializeNormalizedDateAndTime(dateAndTime) : "";
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
case "email":
|
|
211
|
+
// https://html.spec.whatwg.org/multipage/forms.html#e-mail-state-(type=email):value-sanitization-algorithm
|
|
212
|
+
// https://html.spec.whatwg.org/multipage/forms.html#e-mail-state-(type=email):value-sanitization-algorithm-2
|
|
213
|
+
if (input.hasAttributeNS(null, "multiple")) {
|
|
214
|
+
val = val.split(",").map(token => stripLeadingAndTrailingASCIIWhitespace(token)).join(",");
|
|
215
|
+
} else {
|
|
216
|
+
val = stripNewlines(val);
|
|
217
|
+
val = stripLeadingAndTrailingASCIIWhitespace(val);
|
|
218
|
+
}
|
|
219
|
+
break;
|
|
220
|
+
|
|
221
|
+
case "month":
|
|
222
|
+
// https://html.spec.whatwg.org/multipage/input.html#month-state-(type=month):value-sanitization-algorithm
|
|
223
|
+
if (!isValidMonthString(val)) {
|
|
224
|
+
val = "";
|
|
225
|
+
}
|
|
226
|
+
break;
|
|
227
|
+
|
|
228
|
+
case "number":
|
|
229
|
+
// https://html.spec.whatwg.org/multipage/input.html#number-state-(type=number):value-sanitization-algorithm
|
|
230
|
+
// TODO: using parseFloatingPointNumber in addition to isValidFloatingPointNumber to pass number.html WPT.
|
|
231
|
+
// Possible spec bug.
|
|
232
|
+
if (!isValidFloatingPointNumber(val) || parseFloatingPointNumber(val) === null) {
|
|
233
|
+
val = "";
|
|
234
|
+
}
|
|
235
|
+
break;
|
|
236
|
+
|
|
237
|
+
case "range":
|
|
238
|
+
// https://html.spec.whatwg.org/multipage/input.html#range-state-(type=range):value-sanitization-algorithm
|
|
239
|
+
// TODO: using parseFloatingPointNumber in addition to isValidFloatingPointNumber to pass number.html WPT.
|
|
240
|
+
// Possible spec bug.
|
|
241
|
+
if (!isValidFloatingPointNumber(val) || parseFloatingPointNumber(val) === null) {
|
|
242
|
+
const minimum = input._minimum;
|
|
243
|
+
const maximum = input._maximum;
|
|
244
|
+
const defaultValue = maximum < minimum ? minimum : (minimum + maximum) / 2;
|
|
245
|
+
val = `${defaultValue}`;
|
|
246
|
+
} else if (val < input._minimum) {
|
|
247
|
+
val = `${input._minimum}`;
|
|
248
|
+
} else if (val > input._maximum) {
|
|
249
|
+
val = `${input._maximum}`;
|
|
250
|
+
}
|
|
251
|
+
break;
|
|
252
|
+
|
|
253
|
+
case "time":
|
|
254
|
+
// https://html.spec.whatwg.org/multipage/input.html#time-state-(type=time):value-sanitization-algorithm
|
|
255
|
+
if (!isValidTimeString(val)) {
|
|
256
|
+
val = "";
|
|
257
|
+
}
|
|
258
|
+
break;
|
|
259
|
+
|
|
260
|
+
case "url":
|
|
261
|
+
// https://html.spec.whatwg.org/multipage/forms.html#url-state-(type=url):value-sanitization-algorithm
|
|
262
|
+
val = stripNewlines(val);
|
|
263
|
+
val = stripLeadingAndTrailingASCIIWhitespace(val);
|
|
264
|
+
break;
|
|
265
|
+
|
|
266
|
+
case "week":
|
|
267
|
+
// https://html.spec.whatwg.org/multipage/input.html#week-state-(type=week):value-sanitization-algorithm
|
|
268
|
+
if (!isValidWeekString(val)) {
|
|
269
|
+
val = "";
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return val;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-owner
|
|
277
|
+
// TODO: The spec describes an imperative process for assigning/resetting an element's form
|
|
278
|
+
// owner based on activities involving form-associated elements. This simpler implementation
|
|
279
|
+
// instead calculates the current form owner only when the property is accessed. This is not
|
|
280
|
+
// sufficient to pass all the web platform tests, but is good enough for most purposes. We
|
|
281
|
+
// should eventually update it to use the correct version, though. See
|
|
282
|
+
// https://github.com/whatwg/html/issues/4050 for some discussion.
|
|
283
|
+
|
|
284
|
+
exports.formOwner = formControl => {
|
|
285
|
+
const formAttr = formControl.getAttributeNS(null, "form");
|
|
286
|
+
if (formAttr === "") {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
if (formAttr === null) {
|
|
290
|
+
return closest(formControl, "form");
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const root = formControl.getRootNode({});
|
|
294
|
+
let firstElementWithId;
|
|
295
|
+
for (const descendant of domSymbolTree.treeIterator(root)) {
|
|
296
|
+
if (descendant.nodeType === NODE_TYPE.ELEMENT_NODE &&
|
|
297
|
+
descendant.getAttributeNS(null, "id") === formAttr) {
|
|
298
|
+
firstElementWithId = descendant;
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (firstElementWithId &&
|
|
304
|
+
firstElementWithId.namespaceURI === HTML_NS &&
|
|
305
|
+
firstElementWithId.localName === "form") {
|
|
306
|
+
return firstElementWithId;
|
|
307
|
+
}
|
|
308
|
+
return null;
|
|
309
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { HTML_NS } = require("./namespaces");
|
|
4
|
+
const { createElement, getValidTagNames } = require("./create-element");
|
|
5
|
+
|
|
6
|
+
const { implForWrapper, wrapperForImpl } = require("../../../generated/idl/utils");
|
|
7
|
+
|
|
8
|
+
// https://html.spec.whatwg.org/multipage/custom-elements.html#concept-already-constructed-marker
|
|
9
|
+
const ALREADY_CONSTRUCTED_MARKER = Symbol("already-constructed-marker");
|
|
10
|
+
|
|
11
|
+
// https://html.spec.whatwg.org/multipage/dom.html#htmlconstructor
|
|
12
|
+
function HTMLConstructor(globalObject, constructorName, newTarget) {
|
|
13
|
+
const registry = implForWrapper(globalObject._customElementRegistry);
|
|
14
|
+
if (newTarget === HTMLConstructor) {
|
|
15
|
+
throw new TypeError("Invalid constructor");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const definition = registry._customElementDefinitions.find(entry => entry.objectReference === newTarget);
|
|
19
|
+
if (definition === undefined) {
|
|
20
|
+
throw new TypeError("Invalid constructor, the constructor is not part of the custom element registry");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let isValue = null;
|
|
24
|
+
|
|
25
|
+
if (definition.localName === definition.name) {
|
|
26
|
+
if (constructorName !== "HTMLElement") {
|
|
27
|
+
throw new TypeError("Invalid constructor, autonomous custom element should extend from HTMLElement");
|
|
28
|
+
}
|
|
29
|
+
} else {
|
|
30
|
+
const validLocalNames = getValidTagNames(HTML_NS, constructorName);
|
|
31
|
+
if (!validLocalNames.includes(definition.localName)) {
|
|
32
|
+
throw new TypeError(`${definition.localName} is not valid local name for ${constructorName}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
isValue = definition.name;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let { prototype } = newTarget;
|
|
39
|
+
|
|
40
|
+
if (prototype === null || typeof prototype !== "object") {
|
|
41
|
+
// The following line deviates from the specification. The HTMLElement prototype should be retrieved from the realm
|
|
42
|
+
// associated with the "new.target". Because it is impossible to get such information in jsdom, we fallback to the
|
|
43
|
+
// HTMLElement prototype associated with the current object.
|
|
44
|
+
prototype = globalObject.HTMLElement.prototype;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (definition.constructionStack.length === 0) {
|
|
48
|
+
const documentImpl = implForWrapper(globalObject.document);
|
|
49
|
+
|
|
50
|
+
const elementImpl = createElement(documentImpl, definition.localName, HTML_NS);
|
|
51
|
+
|
|
52
|
+
const element = wrapperForImpl(elementImpl);
|
|
53
|
+
Object.setPrototypeOf(element, prototype);
|
|
54
|
+
|
|
55
|
+
elementImpl._ceState = "custom";
|
|
56
|
+
elementImpl._ceDefinition = definition;
|
|
57
|
+
elementImpl._isValue = isValue;
|
|
58
|
+
|
|
59
|
+
return element;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const elementImpl = definition.constructionStack[definition.constructionStack.length - 1];
|
|
63
|
+
const element = wrapperForImpl(elementImpl);
|
|
64
|
+
|
|
65
|
+
if (elementImpl === ALREADY_CONSTRUCTED_MARKER) {
|
|
66
|
+
throw new TypeError("This instance is already constructed");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
Object.setPrototypeOf(element, prototype);
|
|
70
|
+
|
|
71
|
+
definition.constructionStack[definition.constructionStack.length - 1] = ALREADY_CONSTRUCTED_MARKER;
|
|
72
|
+
|
|
73
|
+
return element;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
module.exports = {
|
|
77
|
+
HTMLConstructor
|
|
78
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const SymbolTree = require("symbol-tree");
|
|
3
|
+
|
|
4
|
+
exports.cloningSteps = Symbol("cloning steps");
|
|
5
|
+
|
|
6
|
+
// TODO: the many underscore-prefixed hooks should move here
|
|
7
|
+
// E.g. _attrModified (which maybe should be split into its per-spec variants)
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* This SymbolTree is used to build the tree for all Node in a document
|
|
11
|
+
*/
|
|
12
|
+
exports.domSymbolTree = new SymbolTree("DOM SymbolTree");
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const idlUtils = require("../../../generated/idl/utils");
|
|
3
|
+
|
|
4
|
+
// Until webidl2js gains support for checking for Window, this would have to do.
|
|
5
|
+
module.exports = val => {
|
|
6
|
+
if (typeof val !== "object") {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
const wrapper = idlUtils.wrapperForImpl(val);
|
|
10
|
+
if (typeof wrapper === "object") {
|
|
11
|
+
return wrapper === wrapper._globalProxy;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// `val` may be either impl or wrapper currently, because webidl2js currently unwraps Window objects (and their global
|
|
15
|
+
// proxies) to their underlying EventTargetImpl during conversion, which is not what we want. But at the same time,
|
|
16
|
+
// some internal usage call this constructor with the actual global proxy.
|
|
17
|
+
return module.exports(idlUtils.implForWrapper(val));
|
|
18
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// An iterable WeakSet implementation inspired by the iterable WeakMap example code in the WeakRefs specification:
|
|
4
|
+
// https://github.com/tc39/proposal-weakrefs#iterable-weakmaps
|
|
5
|
+
module.exports = class IterableWeakSet {
|
|
6
|
+
constructor() {
|
|
7
|
+
this._refSet = new Set();
|
|
8
|
+
this._refMap = new WeakMap();
|
|
9
|
+
this._finalizationRegistry = new FinalizationRegistry(({ ref, set }) => set.delete(ref));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
add(value) {
|
|
13
|
+
if (!this._refMap.has(value)) {
|
|
14
|
+
const ref = new WeakRef(value);
|
|
15
|
+
this._refMap.set(value, ref);
|
|
16
|
+
this._refSet.add(ref);
|
|
17
|
+
this._finalizationRegistry.register(value, { ref, set: this._refSet }, ref);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
delete(value) {
|
|
24
|
+
const ref = this._refMap.get(value);
|
|
25
|
+
if (!ref) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
this._refMap.delete(value);
|
|
30
|
+
this._refSet.delete(ref);
|
|
31
|
+
this._finalizationRegistry.unregister(ref);
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
has(value) {
|
|
36
|
+
return this._refMap.has(value);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
* [Symbol.iterator]() {
|
|
40
|
+
for (const ref of this._refSet) {
|
|
41
|
+
const value = ref.deref();
|
|
42
|
+
if (value === undefined) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
yield value;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { domSymbolTree } = require("./internal-constants");
|
|
4
|
+
const reportException = require("./runtime-script-errors");
|
|
5
|
+
|
|
6
|
+
const Event = require("../../../generated/idl/Event");
|
|
7
|
+
const idlUtils = require("../../../generated/idl/utils");
|
|
8
|
+
const MutationRecord = require("../../../generated/idl/MutationRecord");
|
|
9
|
+
|
|
10
|
+
const MUTATION_TYPE = {
|
|
11
|
+
ATTRIBUTES: "attributes",
|
|
12
|
+
CHARACTER_DATA: "characterData",
|
|
13
|
+
CHILD_LIST: "childList"
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// Note:
|
|
17
|
+
// Since jsdom doesn't currently implement the concept of "unit of related similar-origin browsing contexts"
|
|
18
|
+
// (https://html.spec.whatwg.org/multipage/browsers.html#unit-of-related-similar-origin-browsing-contexts)
|
|
19
|
+
// we will approximate that the following properties are global for now.
|
|
20
|
+
|
|
21
|
+
// https://dom.spec.whatwg.org/#mutation-observer-compound-microtask-queued-flag
|
|
22
|
+
let mutationObserverMicrotaskQueueFlag = false;
|
|
23
|
+
|
|
24
|
+
// Non-spec compliant: List of all the mutation observers with mutation records enqueued. It's a replacement for
|
|
25
|
+
// mutation observer list (https://dom.spec.whatwg.org/#mutation-observer-list) but without leaking since it's empty
|
|
26
|
+
// before notifying the mutation observers.
|
|
27
|
+
const activeMutationObservers = new Set();
|
|
28
|
+
|
|
29
|
+
// https://dom.spec.whatwg.org/#signal-slot-list
|
|
30
|
+
const signalSlotList = [];
|
|
31
|
+
|
|
32
|
+
// https://dom.spec.whatwg.org/#queue-a-mutation-record
|
|
33
|
+
function queueMutationRecord(
|
|
34
|
+
type,
|
|
35
|
+
target,
|
|
36
|
+
name,
|
|
37
|
+
namespace,
|
|
38
|
+
oldValue,
|
|
39
|
+
addedNodes,
|
|
40
|
+
removedNodes,
|
|
41
|
+
previousSibling,
|
|
42
|
+
nextSibling
|
|
43
|
+
) {
|
|
44
|
+
const interestedObservers = new Map();
|
|
45
|
+
|
|
46
|
+
const nodes = domSymbolTree.ancestorsToArray(target);
|
|
47
|
+
|
|
48
|
+
for (const node of nodes) {
|
|
49
|
+
for (const registered of node._registeredObserverList) {
|
|
50
|
+
const { options, observer: mo } = registered;
|
|
51
|
+
|
|
52
|
+
if (
|
|
53
|
+
!(node !== target && options.subtree === false) &&
|
|
54
|
+
!(type === MUTATION_TYPE.ATTRIBUTES && options.attributes !== true) &&
|
|
55
|
+
!(type === MUTATION_TYPE.ATTRIBUTES && options.attributeFilter &&
|
|
56
|
+
!options.attributeFilter.some(value => value === name || value === namespace)) &&
|
|
57
|
+
!(type === MUTATION_TYPE.CHARACTER_DATA && options.characterData !== true) &&
|
|
58
|
+
!(type === MUTATION_TYPE.CHILD_LIST && options.childList === false)
|
|
59
|
+
) {
|
|
60
|
+
if (!interestedObservers.has(mo)) {
|
|
61
|
+
interestedObservers.set(mo, null);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (
|
|
65
|
+
(type === MUTATION_TYPE.ATTRIBUTES && options.attributeOldValue === true) ||
|
|
66
|
+
(type === MUTATION_TYPE.CHARACTER_DATA && options.characterDataOldValue === true)
|
|
67
|
+
) {
|
|
68
|
+
interestedObservers.set(mo, oldValue);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
for (const [observer, mappedOldValue] of interestedObservers.entries()) {
|
|
75
|
+
const record = MutationRecord.createImpl(target._globalObject, [], {
|
|
76
|
+
type,
|
|
77
|
+
target,
|
|
78
|
+
attributeName: name,
|
|
79
|
+
attributeNamespace: namespace,
|
|
80
|
+
oldValue: mappedOldValue,
|
|
81
|
+
addedNodes,
|
|
82
|
+
removedNodes,
|
|
83
|
+
previousSibling,
|
|
84
|
+
nextSibling
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
observer._recordQueue.push(record);
|
|
88
|
+
activeMutationObservers.add(observer);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
queueMutationObserverMicrotask();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// https://dom.spec.whatwg.org/#queue-a-tree-mutation-record
|
|
95
|
+
function queueTreeMutationRecord(target, addedNodes, removedNodes, previousSibling, nextSibling) {
|
|
96
|
+
queueMutationRecord(
|
|
97
|
+
MUTATION_TYPE.CHILD_LIST,
|
|
98
|
+
target,
|
|
99
|
+
null,
|
|
100
|
+
null,
|
|
101
|
+
null,
|
|
102
|
+
addedNodes,
|
|
103
|
+
removedNodes,
|
|
104
|
+
previousSibling,
|
|
105
|
+
nextSibling
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// https://dom.spec.whatwg.org/#queue-an-attribute-mutation-record
|
|
110
|
+
function queueAttributeMutationRecord(target, name, namespace, oldValue) {
|
|
111
|
+
queueMutationRecord(
|
|
112
|
+
MUTATION_TYPE.ATTRIBUTES,
|
|
113
|
+
target,
|
|
114
|
+
name,
|
|
115
|
+
namespace,
|
|
116
|
+
oldValue,
|
|
117
|
+
[],
|
|
118
|
+
[],
|
|
119
|
+
null,
|
|
120
|
+
null
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// https://dom.spec.whatwg.org/#queue-a-mutation-observer-compound-microtask
|
|
125
|
+
function queueMutationObserverMicrotask() {
|
|
126
|
+
if (mutationObserverMicrotaskQueueFlag) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
mutationObserverMicrotaskQueueFlag = true;
|
|
131
|
+
|
|
132
|
+
Promise.resolve().then(() => {
|
|
133
|
+
notifyMutationObservers();
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// https://dom.spec.whatwg.org/#notify-mutation-observers
|
|
138
|
+
function notifyMutationObservers() {
|
|
139
|
+
mutationObserverMicrotaskQueueFlag = false;
|
|
140
|
+
|
|
141
|
+
const notifyList = [...activeMutationObservers].sort((a, b) => a._id - b._id);
|
|
142
|
+
activeMutationObservers.clear();
|
|
143
|
+
|
|
144
|
+
const signalList = [...signalSlotList];
|
|
145
|
+
signalSlotList.splice(0, signalSlotList.length);
|
|
146
|
+
|
|
147
|
+
for (const mo of notifyList) {
|
|
148
|
+
const records = [...mo._recordQueue];
|
|
149
|
+
mo._recordQueue = [];
|
|
150
|
+
|
|
151
|
+
for (const node of mo._nodeList) {
|
|
152
|
+
node._registeredObserverList = node._registeredObserverList.filter(registeredObserver => {
|
|
153
|
+
return registeredObserver.source !== mo;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (records.length > 0) {
|
|
158
|
+
try {
|
|
159
|
+
const moWrapper = idlUtils.wrapperForImpl(mo);
|
|
160
|
+
mo._callback.call(
|
|
161
|
+
moWrapper,
|
|
162
|
+
records.map(idlUtils.wrapperForImpl),
|
|
163
|
+
moWrapper
|
|
164
|
+
);
|
|
165
|
+
} catch (e) {
|
|
166
|
+
const { target } = records[0];
|
|
167
|
+
const window = target._ownerDocument._defaultView;
|
|
168
|
+
|
|
169
|
+
reportException(window, e);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
for (const slot of signalList) {
|
|
175
|
+
const slotChangeEvent = Event.createImpl(
|
|
176
|
+
slot._globalObject,
|
|
177
|
+
[
|
|
178
|
+
"slotchange",
|
|
179
|
+
{ bubbles: true }
|
|
180
|
+
],
|
|
181
|
+
{ isTrusted: true }
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
slot._dispatch(slotChangeEvent);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
module.exports = {
|
|
189
|
+
MUTATION_TYPE,
|
|
190
|
+
|
|
191
|
+
queueMutationRecord,
|
|
192
|
+
queueTreeMutationRecord,
|
|
193
|
+
queueAttributeMutationRecord,
|
|
194
|
+
|
|
195
|
+
queueMutationObserverMicrotask,
|
|
196
|
+
|
|
197
|
+
signalSlotList
|
|
198
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Do not require generated files from here, as this file is shared with the Web IDL converter.
|
|
3
|
+
|
|
4
|
+
// https://infra.spec.whatwg.org/#namespaces
|
|
5
|
+
|
|
6
|
+
exports.HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
7
|
+
|
|
8
|
+
exports.MATHML_NS = "http://www.w3.org/1998/Math/MathML";
|
|
9
|
+
|
|
10
|
+
exports.SVG_NS = "http://www.w3.org/2000/svg";
|
|
11
|
+
|
|
12
|
+
exports.XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
13
|
+
|
|
14
|
+
exports.XML_NS = "http://www.w3.org/XML/1998/namespace";
|
|
15
|
+
|
|
16
|
+
exports.XMLNS_NS = "http://www.w3.org/2000/xmlns/";
|