From 3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 Mon Sep 17 00:00:00 2001 From: Minteck Date: Thu, 23 Feb 2023 19:34:56 +0100 Subject: Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated) --- .../external/school/node_modules/jsdom/lib/api.js | 333 ++ .../node_modules/jsdom/lib/jsdom/browser/Window.js | 933 ++++++ .../jsdom/lib/jsdom/browser/default-stylesheet.js | 789 +++++ .../jsdom/lib/jsdom/browser/js-globals.json | 307 ++ .../jsdom/lib/jsdom/browser/not-implemented.js | 13 + .../jsdom/lib/jsdom/browser/parser/html.js | 223 ++ .../jsdom/lib/jsdom/browser/parser/index.js | 37 + .../jsdom/lib/jsdom/browser/parser/xml.js | 202 ++ .../browser/resources/async-resource-queue.js | 114 + .../browser/resources/no-op-resource-loader.js | 8 + .../resources/per-document-resource-loader.js | 95 + .../lib/jsdom/browser/resources/request-manager.js | 33 + .../lib/jsdom/browser/resources/resource-loader.js | 142 + .../lib/jsdom/browser/resources/resource-queue.js | 142 + .../node_modules/jsdom/lib/jsdom/level2/style.js | 57 + .../node_modules/jsdom/lib/jsdom/level3/xpath.js | 1874 +++++++++++ .../jsdom/living/aborting/AbortController-impl.js | 17 + .../lib/jsdom/living/aborting/AbortSignal-impl.js | 55 + .../jsdom/lib/jsdom/living/attributes.js | 312 ++ .../jsdom/lib/jsdom/living/attributes/Attr-impl.js | 60 + .../jsdom/living/attributes/NamedNodeMap-impl.js | 78 + .../DefaultConstraintValidation-impl.js | 75 + .../constraint-validation/ValidityState-impl.js | 66 + .../lib/jsdom/living/cssom/StyleSheetList-impl.js | 38 + .../custom-elements/CustomElementRegistry-impl.js | 265 ++ .../jsdom/lib/jsdom/living/documents.js | 15 + .../lib/jsdom/living/domparsing/DOMParser-impl.js | 58 + .../lib/jsdom/living/domparsing/InnerHTML-impl.js | 29 + .../jsdom/living/domparsing/XMLSerializer-impl.js | 18 + .../domparsing/parse5-adapter-serialization.js | 63 + .../lib/jsdom/living/domparsing/serialization.js | 45 + .../lib/jsdom/living/events/CloseEvent-impl.js | 10 + .../jsdom/living/events/CompositionEvent-impl.js | 20 + .../lib/jsdom/living/events/CustomEvent-impl.js | 21 + .../lib/jsdom/living/events/ErrorEvent-impl.js | 14 + .../jsdom/lib/jsdom/living/events/Event-impl.js | 197 ++ .../jsdom/living/events/EventModifierMixin-impl.js | 18 + .../lib/jsdom/living/events/EventTarget-impl.js | 403 +++ .../lib/jsdom/living/events/FocusEvent-impl.js | 9 + .../jsdom/living/events/HashChangeEvent-impl.js | 14 + .../lib/jsdom/living/events/InputEvent-impl.js | 11 + .../lib/jsdom/living/events/KeyboardEvent-impl.js | 29 + .../lib/jsdom/living/events/MessageEvent-impl.js | 25 + .../lib/jsdom/living/events/MouseEvent-impl.js | 49 + .../living/events/PageTransitionEvent-impl.js | 20 + .../lib/jsdom/living/events/PopStateEvent-impl.js | 9 + .../lib/jsdom/living/events/ProgressEvent-impl.js | 14 + .../lib/jsdom/living/events/StorageEvent-impl.js | 26 + .../lib/jsdom/living/events/TouchEvent-impl.js | 14 + .../jsdom/lib/jsdom/living/events/UIEvent-impl.js | 59 + .../lib/jsdom/living/events/WheelEvent-impl.js | 12 + .../jsdom/lib/jsdom/living/fetch/Headers-impl.js | 165 + .../jsdom/lib/jsdom/living/fetch/header-list.js | 54 + .../jsdom/lib/jsdom/living/fetch/header-types.js | 103 + .../jsdom/lib/jsdom/living/file-api/Blob-impl.js | 93 + .../jsdom/lib/jsdom/living/file-api/File-impl.js | 12 + .../lib/jsdom/living/file-api/FileList-impl.js | 15 + .../lib/jsdom/living/file-api/FileReader-impl.js | 130 + .../lib/jsdom/living/generated/AbortController.js | 130 + .../lib/jsdom/living/generated/AbortSignal.js | 159 + .../lib/jsdom/living/generated/AbstractRange.js | 162 + .../living/generated/AddEventListenerOptions.js | 44 + .../jsdom/living/generated/AssignedNodesOptions.js | 28 + .../jsdom/lib/jsdom/living/generated/Attr.js | 215 ++ .../jsdom/lib/jsdom/living/generated/BarProp.js | 118 + .../jsdom/lib/jsdom/living/generated/BinaryType.js | 12 + .../jsdom/lib/jsdom/living/generated/Blob.js | 198 ++ .../lib/jsdom/living/generated/BlobCallback.js | 34 + .../lib/jsdom/living/generated/BlobPropertyBag.js | 42 + .../lib/jsdom/living/generated/CDATASection.js | 114 + .../jsdom/living/generated/CanPlayTypeResult.js | 12 + .../lib/jsdom/living/generated/CharacterData.js | 436 +++ .../jsdom/lib/jsdom/living/generated/CloseEvent.js | 164 + .../lib/jsdom/living/generated/CloseEventInit.js | 56 + .../jsdom/lib/jsdom/living/generated/Comment.js | 122 + .../lib/jsdom/living/generated/CompositionEvent.js | 217 ++ .../jsdom/living/generated/CompositionEventInit.js | 32 + .../living/generated/CustomElementConstructor.js | 38 + .../living/generated/CustomElementRegistry.js | 242 ++ .../lib/jsdom/living/generated/CustomEvent.js | 200 ++ .../lib/jsdom/living/generated/CustomEventInit.js | 32 + .../jsdom/living/generated/DOMImplementation.js | 232 ++ .../jsdom/lib/jsdom/living/generated/DOMParser.js | 140 + .../lib/jsdom/living/generated/DOMStringMap.js | 322 ++ .../lib/jsdom/living/generated/DOMTokenList.js | 531 ++++ .../jsdom/lib/jsdom/living/generated/Document.js | 3322 ++++++++++++++++++++ .../lib/jsdom/living/generated/DocumentFragment.js | 325 ++ .../jsdom/living/generated/DocumentReadyState.js | 12 + .../lib/jsdom/living/generated/DocumentType.js | 246 ++ .../jsdom/lib/jsdom/living/generated/Element.js | 1609 ++++++++++ .../living/generated/ElementCreationOptions.js | 26 + .../living/generated/ElementDefinitionOptions.js | 26 + .../jsdom/lib/jsdom/living/generated/EndingType.js | 12 + .../jsdom/lib/jsdom/living/generated/ErrorEvent.js | 186 ++ .../lib/jsdom/living/generated/ErrorEventInit.js | 80 + .../jsdom/lib/jsdom/living/generated/Event.js | 390 +++ .../jsdom/living/generated/EventHandlerNonNull.js | 40 + .../jsdom/lib/jsdom/living/generated/EventInit.js | 52 + .../lib/jsdom/living/generated/EventListener.js | 35 + .../jsdom/living/generated/EventListenerOptions.js | 28 + .../jsdom/living/generated/EventModifierInit.js | 188 ++ .../lib/jsdom/living/generated/EventTarget.js | 252 ++ .../jsdom/lib/jsdom/living/generated/External.js | 129 + .../jsdom/lib/jsdom/living/generated/File.js | 176 ++ .../jsdom/lib/jsdom/living/generated/FileList.js | 305 ++ .../lib/jsdom/living/generated/FilePropertyBag.js | 30 + .../jsdom/lib/jsdom/living/generated/FileReader.js | 440 +++ .../jsdom/lib/jsdom/living/generated/FocusEvent.js | 142 + .../lib/jsdom/living/generated/FocusEventInit.js | 36 + .../jsdom/lib/jsdom/living/generated/FormData.js | 421 +++ .../jsdom/lib/jsdom/living/generated/Function.js | 46 + .../jsdom/living/generated/GetRootNodeOptions.js | 28 + .../jsdom/living/generated/HTMLAnchorElement.js | 915 ++++++ .../lib/jsdom/living/generated/HTMLAreaElement.js | 739 +++++ .../lib/jsdom/living/generated/HTMLAudioElement.js | 115 + .../lib/jsdom/living/generated/HTMLBRElement.js | 153 + .../lib/jsdom/living/generated/HTMLBaseElement.js | 188 ++ .../lib/jsdom/living/generated/HTMLBodyElement.js | 808 +++++ .../jsdom/living/generated/HTMLButtonElement.js | 487 +++ .../jsdom/living/generated/HTMLCanvasElement.js | 291 ++ .../lib/jsdom/living/generated/HTMLCollection.js | 358 +++ .../lib/jsdom/living/generated/HTMLDListElement.js | 156 + .../lib/jsdom/living/generated/HTMLDataElement.js | 153 + .../jsdom/living/generated/HTMLDataListElement.js | 128 + .../jsdom/living/generated/HTMLDetailsElement.js | 156 + .../jsdom/living/generated/HTMLDialogElement.js | 156 + .../jsdom/living/generated/HTMLDirectoryElement.js | 156 + .../lib/jsdom/living/generated/HTMLDivElement.js | 153 + .../lib/jsdom/living/generated/HTMLElement.js | 2269 +++++++++++++ .../lib/jsdom/living/generated/HTMLEmbedElement.js | 346 ++ .../jsdom/living/generated/HTMLFieldSetElement.js | 315 ++ .../lib/jsdom/living/generated/HTMLFontElement.js | 226 ++ .../lib/jsdom/living/generated/HTMLFormElement.js | 457 +++ .../lib/jsdom/living/generated/HTMLFrameElement.js | 459 +++ .../jsdom/living/generated/HTMLFrameSetElement.js | 683 ++++ .../lib/jsdom/living/generated/HTMLHRElement.js | 300 ++ .../lib/jsdom/living/generated/HTMLHeadElement.js | 115 + .../jsdom/living/generated/HTMLHeadingElement.js | 153 + .../lib/jsdom/living/generated/HTMLHtmlElement.js | 153 + .../jsdom/living/generated/HTMLIFrameElement.js | 621 ++++ .../lib/jsdom/living/generated/HTMLImageElement.js | 789 +++++ .../lib/jsdom/living/generated/HTMLInputElement.js | 1696 ++++++++++ .../lib/jsdom/living/generated/HTMLLIElement.js | 194 ++ .../lib/jsdom/living/generated/HTMLLabelElement.js | 175 ++ .../jsdom/living/generated/HTMLLegendElement.js | 164 + .../lib/jsdom/living/generated/HTMLLinkElement.js | 496 +++ .../lib/jsdom/living/generated/HTMLMapElement.js | 166 + .../jsdom/living/generated/HTMLMarqueeElement.js | 509 +++ .../lib/jsdom/living/generated/HTMLMediaElement.js | 802 +++++ .../lib/jsdom/living/generated/HTMLMenuElement.js | 156 + .../lib/jsdom/living/generated/HTMLMetaElement.js | 261 ++ .../lib/jsdom/living/generated/HTMLMeterElement.js | 338 ++ .../lib/jsdom/living/generated/HTMLModElement.js | 202 ++ .../lib/jsdom/living/generated/HTMLOListElement.js | 266 ++ .../jsdom/living/generated/HTMLObjectElement.js | 839 +++++ .../jsdom/living/generated/HTMLOptGroupElement.js | 192 ++ .../jsdom/living/generated/HTMLOptionElement.js | 351 +++ .../living/generated/HTMLOptionsCollection.js | 533 ++++ .../jsdom/living/generated/HTMLOutputElement.js | 371 +++ .../jsdom/living/generated/HTMLParagraphElement.js | 153 + .../lib/jsdom/living/generated/HTMLParamElement.js | 261 ++ .../jsdom/living/generated/HTMLPictureElement.js | 115 + .../lib/jsdom/living/generated/HTMLPreElement.js | 158 + .../jsdom/living/generated/HTMLProgressElement.js | 209 ++ .../lib/jsdom/living/generated/HTMLQuoteElement.js | 166 + .../jsdom/living/generated/HTMLScriptElement.js | 424 +++ .../jsdom/living/generated/HTMLSelectElement.js | 957 ++++++ .../lib/jsdom/living/generated/HTMLSlotElement.js | 188 ++ .../jsdom/living/generated/HTMLSourceElement.js | 310 ++ .../lib/jsdom/living/generated/HTMLSpanElement.js | 115 + .../lib/jsdom/living/generated/HTMLStyleElement.js | 200 ++ .../living/generated/HTMLTableCaptionElement.js | 153 + .../jsdom/living/generated/HTMLTableCellElement.js | 635 ++++ .../jsdom/living/generated/HTMLTableColElement.js | 339 ++ .../lib/jsdom/living/generated/HTMLTableElement.js | 725 +++++ .../jsdom/living/generated/HTMLTableRowElement.js | 386 +++ .../living/generated/HTMLTableSectionElement.js | 329 ++ .../jsdom/living/generated/HTMLTemplateElement.js | 126 + .../jsdom/living/generated/HTMLTextAreaElement.js | 1088 +++++++ .../lib/jsdom/living/generated/HTMLTimeElement.js | 153 + .../lib/jsdom/living/generated/HTMLTitleElement.js | 152 + .../lib/jsdom/living/generated/HTMLTrackElement.js | 334 ++ .../lib/jsdom/living/generated/HTMLUListElement.js | 192 ++ .../jsdom/living/generated/HTMLUnknownElement.js | 114 + .../lib/jsdom/living/generated/HTMLVideoElement.js | 310 ++ .../lib/jsdom/living/generated/HashChangeEvent.js | 153 + .../jsdom/living/generated/HashChangeEventInit.js | 44 + .../jsdom/lib/jsdom/living/generated/Headers.js | 379 +++ .../jsdom/lib/jsdom/living/generated/History.js | 256 ++ .../jsdom/lib/jsdom/living/generated/InputEvent.js | 164 + .../lib/jsdom/living/generated/InputEventInit.js | 59 + .../lib/jsdom/living/generated/KeyboardEvent.js | 413 +++ .../jsdom/living/generated/KeyboardEventInit.js | 104 + .../jsdom/lib/jsdom/living/generated/Location.js | 370 +++ .../lib/jsdom/living/generated/MessageEvent.js | 301 ++ .../lib/jsdom/living/generated/MessageEventInit.js | 94 + .../jsdom/lib/jsdom/living/generated/MimeType.js | 151 + .../lib/jsdom/living/generated/MimeTypeArray.js | 330 ++ .../jsdom/lib/jsdom/living/generated/MouseEvent.js | 463 +++ .../lib/jsdom/living/generated/MouseEventInit.js | 108 + .../lib/jsdom/living/generated/MutationCallback.js | 38 + .../lib/jsdom/living/generated/MutationObserver.js | 171 + .../jsdom/living/generated/MutationObserverInit.js | 103 + .../lib/jsdom/living/generated/MutationRecord.js | 216 ++ .../lib/jsdom/living/generated/NamedNodeMap.js | 522 +++ .../jsdom/lib/jsdom/living/generated/Navigator.js | 297 ++ .../jsdom/lib/jsdom/living/generated/Node.js | 736 +++++ .../jsdom/lib/jsdom/living/generated/NodeFilter.js | 74 + .../lib/jsdom/living/generated/NodeIterator.js | 196 ++ .../jsdom/lib/jsdom/living/generated/NodeList.js | 309 ++ .../generated/OnBeforeUnloadEventHandlerNonNull.js | 46 + .../living/generated/OnErrorEventHandlerNonNull.js | 60 + .../jsdom/living/generated/PageTransitionEvent.js | 146 + .../living/generated/PageTransitionEventInit.js | 32 + .../lib/jsdom/living/generated/Performance.js | 145 + .../jsdom/lib/jsdom/living/generated/Plugin.js | 361 +++ .../lib/jsdom/living/generated/PluginArray.js | 340 ++ .../lib/jsdom/living/generated/PopStateEvent.js | 142 + .../jsdom/living/generated/PopStateEventInit.js | 32 + .../living/generated/ProcessingInstruction.js | 125 + .../lib/jsdom/living/generated/ProgressEvent.js | 166 + .../jsdom/living/generated/ProgressEventInit.js | 56 + .../jsdom/lib/jsdom/living/generated/Range.js | 619 ++++ .../jsdom/living/generated/SVGAnimatedString.js | 143 + .../living/generated/SVGBoundingBoxOptions.js | 64 + .../jsdom/lib/jsdom/living/generated/SVGElement.js | 1986 ++++++++++++ .../jsdom/living/generated/SVGGraphicsElement.js | 144 + .../jsdom/lib/jsdom/living/generated/SVGNumber.js | 130 + .../lib/jsdom/living/generated/SVGSVGElement.js | 681 ++++ .../lib/jsdom/living/generated/SVGStringList.js | 504 +++ .../lib/jsdom/living/generated/SVGTitleElement.js | 114 + .../jsdom/lib/jsdom/living/generated/Screen.js | 173 + .../lib/jsdom/living/generated/ScrollBehavior.js | 12 + .../living/generated/ScrollIntoViewOptions.js | 45 + .../living/generated/ScrollLogicalPosition.js | 12 + .../lib/jsdom/living/generated/ScrollOptions.js | 30 + .../jsdom/living/generated/ScrollRestoration.js | 12 + .../jsdom/lib/jsdom/living/generated/Selection.js | 527 ++++ .../lib/jsdom/living/generated/SelectionMode.js | 12 + .../jsdom/lib/jsdom/living/generated/ShadowRoot.js | 185 ++ .../lib/jsdom/living/generated/ShadowRootInit.js | 30 + .../lib/jsdom/living/generated/ShadowRootMode.js | 12 + .../lib/jsdom/living/generated/StaticRange.js | 126 + .../lib/jsdom/living/generated/StaticRangeInit.js | 66 + .../jsdom/lib/jsdom/living/generated/Storage.js | 389 +++ .../lib/jsdom/living/generated/StorageEvent.js | 305 ++ .../lib/jsdom/living/generated/StorageEventInit.js | 93 + .../lib/jsdom/living/generated/StyleSheetList.js | 307 ++ .../lib/jsdom/living/generated/SupportedType.js | 18 + .../jsdom/lib/jsdom/living/generated/Text.js | 169 + .../lib/jsdom/living/generated/TextTrackKind.js | 12 + .../jsdom/lib/jsdom/living/generated/TouchEvent.js | 208 ++ .../lib/jsdom/living/generated/TouchEventInit.js | 89 + .../jsdom/lib/jsdom/living/generated/TreeWalker.js | 236 ++ .../jsdom/lib/jsdom/living/generated/UIEvent.js | 235 ++ .../lib/jsdom/living/generated/UIEventInit.js | 59 + .../lib/jsdom/living/generated/ValidityState.js | 228 ++ .../lib/jsdom/living/generated/VisibilityState.js | 12 + .../lib/jsdom/living/generated/VoidFunction.js | 30 + .../jsdom/lib/jsdom/living/generated/WebSocket.js | 444 +++ .../jsdom/lib/jsdom/living/generated/WheelEvent.js | 183 ++ .../lib/jsdom/living/generated/WheelEventInit.js | 68 + .../lib/jsdom/living/generated/XMLDocument.js | 114 + .../lib/jsdom/living/generated/XMLHttpRequest.js | 617 ++++ .../living/generated/XMLHttpRequestEventTarget.js | 341 ++ .../living/generated/XMLHttpRequestResponseType.js | 12 + .../jsdom/living/generated/XMLHttpRequestUpload.js | 114 + .../lib/jsdom/living/generated/XMLSerializer.js | 133 + .../jsdom/lib/jsdom/living/generated/utils.js | 141 + .../lib/jsdom/living/helpers/agent-factory.js | 15 + .../jsdom/lib/jsdom/living/helpers/binary-data.js | 9 + .../lib/jsdom/living/helpers/create-element.js | 320 ++ .../jsdom/living/helpers/create-event-accessor.js | 188 ++ .../lib/jsdom/living/helpers/custom-elements.js | 270 ++ .../lib/jsdom/living/helpers/dates-and-times.js | 270 ++ .../jsdom/lib/jsdom/living/helpers/details.js | 15 + .../lib/jsdom/living/helpers/document-base-url.js | 54 + .../jsdom/lib/jsdom/living/helpers/events.js | 24 + .../jsdom/lib/jsdom/living/helpers/focusing.js | 104 + .../lib/jsdom/living/helpers/form-controls.js | 306 ++ .../lib/jsdom/living/helpers/html-constructor.js | 78 + .../jsdom/lib/jsdom/living/helpers/http-request.js | 254 ++ .../lib/jsdom/living/helpers/internal-constants.js | 12 + .../lib/jsdom/living/helpers/iterable-weak-set.js | 48 + .../jsdom/lib/jsdom/living/helpers/json.js | 12 + .../lib/jsdom/living/helpers/mutation-observers.js | 198 ++ .../jsdom/lib/jsdom/living/helpers/namespaces.js | 15 + .../jsdom/lib/jsdom/living/helpers/node.js | 68 + .../jsdom/living/helpers/number-and-date-inputs.js | 195 ++ .../jsdom/lib/jsdom/living/helpers/ordered-set.js | 104 + .../jsdom/living/helpers/runtime-script-errors.js | 76 + .../jsdom/lib/jsdom/living/helpers/selectors.js | 47 + .../jsdom/lib/jsdom/living/helpers/shadow-dom.js | 285 ++ .../jsdom/lib/jsdom/living/helpers/strings.js | 148 + .../jsdom/lib/jsdom/living/helpers/style-rules.js | 114 + .../jsdom/lib/jsdom/living/helpers/stylesheets.js | 113 + .../lib/jsdom/living/helpers/svg/basic-types.js | 41 + .../jsdom/lib/jsdom/living/helpers/svg/render.js | 46 + .../jsdom/lib/jsdom/living/helpers/text.js | 19 + .../jsdom/lib/jsdom/living/helpers/traversal.js | 72 + .../lib/jsdom/living/helpers/validate-names.js | 75 + .../lib/jsdom/living/hr-time/Performance-impl.js | 25 + .../jsdom/lib/jsdom/living/interfaces.js | 217 ++ .../mutation-observer/MutationObserver-impl.js | 95 + .../mutation-observer/MutationRecord-impl.js | 37 + .../lib/jsdom/living/named-properties-window.js | 141 + .../lib/jsdom/living/navigator/MimeType-impl.js | 3 + .../jsdom/living/navigator/MimeTypeArray-impl.js | 21 + .../lib/jsdom/living/navigator/Navigator-impl.js | 29 + .../navigator/NavigatorConcurrentHardware-impl.js | 8 + .../living/navigator/NavigatorCookies-impl.js | 7 + .../lib/jsdom/living/navigator/NavigatorID-impl.js | 37 + .../living/navigator/NavigatorLanguage-impl.js | 9 + .../jsdom/living/navigator/NavigatorOnLine-impl.js | 7 + .../living/navigator/NavigatorPlugins-impl.js | 8 + .../lib/jsdom/living/navigator/Plugin-impl.js | 3 + .../lib/jsdom/living/navigator/PluginArray-impl.js | 23 + .../lib/jsdom/living/node-document-position.js | 10 + .../jsdom/lib/jsdom/living/node-type.js | 16 + .../node_modules/jsdom/lib/jsdom/living/node.js | 331 ++ .../lib/jsdom/living/nodes/CDATASection-impl.js | 16 + .../lib/jsdom/living/nodes/CharacterData-impl.js | 118 + .../jsdom/lib/jsdom/living/nodes/ChildNode-impl.js | 80 + .../jsdom/lib/jsdom/living/nodes/Comment-impl.js | 20 + .../jsdom/living/nodes/DOMImplementation-impl.js | 120 + .../lib/jsdom/living/nodes/DOMStringMap-impl.js | 64 + .../lib/jsdom/living/nodes/DOMTokenList-impl.js | 171 + .../jsdom/lib/jsdom/living/nodes/Document-impl.js | 946 ++++++ .../jsdom/living/nodes/DocumentFragment-impl.js | 44 + .../living/nodes/DocumentOrShadowRoot-impl.js | 28 + .../lib/jsdom/living/nodes/DocumentType-impl.js | 24 + .../jsdom/lib/jsdom/living/nodes/Element-impl.js | 578 ++++ .../living/nodes/ElementCSSInlineStyle-impl.js | 25 + .../living/nodes/ElementContentEditable-impl.js | 7 + .../jsdom/living/nodes/GlobalEventHandlers-impl.js | 95 + .../jsdom/living/nodes/HTMLAnchorElement-impl.js | 50 + .../lib/jsdom/living/nodes/HTMLAreaElement-impl.js | 43 + .../jsdom/living/nodes/HTMLAudioElement-impl.js | 9 + .../lib/jsdom/living/nodes/HTMLBRElement-impl.js | 9 + .../lib/jsdom/living/nodes/HTMLBaseElement-impl.js | 27 + .../lib/jsdom/living/nodes/HTMLBodyElement-impl.js | 17 + .../jsdom/living/nodes/HTMLButtonElement-impl.js | 79 + .../jsdom/living/nodes/HTMLCanvasElement-impl.js | 130 + .../lib/jsdom/living/nodes/HTMLCollection-impl.js | 96 + .../jsdom/living/nodes/HTMLDListElement-impl.js | 9 + .../lib/jsdom/living/nodes/HTMLDataElement-impl.js | 9 + .../jsdom/living/nodes/HTMLDataListElement-impl.js | 20 + .../jsdom/living/nodes/HTMLDetailsElement-impl.js | 35 + .../jsdom/living/nodes/HTMLDialogElement-impl.js | 9 + .../living/nodes/HTMLDirectoryElement-impl.js | 9 + .../lib/jsdom/living/nodes/HTMLDivElement-impl.js | 9 + .../lib/jsdom/living/nodes/HTMLElement-impl.js | 160 + .../jsdom/living/nodes/HTMLEmbedElement-impl.js | 8 + .../jsdom/living/nodes/HTMLFieldSetElement-impl.js | 43 + .../lib/jsdom/living/nodes/HTMLFontElement-impl.js | 9 + .../lib/jsdom/living/nodes/HTMLFormElement-impl.js | 226 ++ .../jsdom/living/nodes/HTMLFrameElement-impl.js | 261 ++ .../jsdom/living/nodes/HTMLFrameSetElement-impl.js | 17 + .../lib/jsdom/living/nodes/HTMLHRElement-impl.js | 9 + .../lib/jsdom/living/nodes/HTMLHeadElement-impl.js | 9 + .../jsdom/living/nodes/HTMLHeadingElement-impl.js | 9 + .../lib/jsdom/living/nodes/HTMLHtmlElement-impl.js | 9 + .../living/nodes/HTMLHyperlinkElementUtils-impl.js | 371 +++ .../jsdom/living/nodes/HTMLIFrameElement-impl.js | 9 + .../jsdom/living/nodes/HTMLImageElement-impl.js | 132 + .../jsdom/living/nodes/HTMLInputElement-impl.js | 1128 +++++++ .../lib/jsdom/living/nodes/HTMLLIElement-impl.js | 9 + .../jsdom/living/nodes/HTMLLabelElement-impl.js | 94 + .../jsdom/living/nodes/HTMLLegendElement-impl.js | 18 + .../lib/jsdom/living/nodes/HTMLLinkElement-impl.js | 101 + .../lib/jsdom/living/nodes/HTMLMapElement-impl.js | 13 + .../jsdom/living/nodes/HTMLMarqueeElement-impl.js | 9 + .../jsdom/living/nodes/HTMLMediaElement-impl.js | 138 + .../lib/jsdom/living/nodes/HTMLMenuElement-impl.js | 9 + .../lib/jsdom/living/nodes/HTMLMetaElement-impl.js | 9 + .../jsdom/living/nodes/HTMLMeterElement-impl.js | 180 ++ .../lib/jsdom/living/nodes/HTMLModElement-impl.js | 9 + .../jsdom/living/nodes/HTMLOListElement-impl.js | 22 + .../jsdom/living/nodes/HTMLObjectElement-impl.js | 26 + .../jsdom/living/nodes/HTMLOptGroupElement-impl.js | 9 + .../jsdom/living/nodes/HTMLOptionElement-impl.js | 146 + .../living/nodes/HTMLOptionsCollection-impl.js | 110 + .../jsdom/living/nodes/HTMLOrSVGElement-impl.js | 85 + .../jsdom/living/nodes/HTMLOutputElement-impl.js | 88 + .../living/nodes/HTMLParagraphElement-impl.js | 9 + .../jsdom/living/nodes/HTMLParamElement-impl.js | 9 + .../jsdom/living/nodes/HTMLPictureElement-impl.js | 9 + .../lib/jsdom/living/nodes/HTMLPreElement-impl.js | 9 + .../jsdom/living/nodes/HTMLProgressElement-impl.js | 74 + .../jsdom/living/nodes/HTMLQuoteElement-impl.js | 9 + .../jsdom/living/nodes/HTMLScriptElement-impl.js | 265 ++ .../jsdom/living/nodes/HTMLSelectElement-impl.js | 283 ++ .../lib/jsdom/living/nodes/HTMLSlotElement-impl.js | 59 + .../jsdom/living/nodes/HTMLSourceElement-impl.js | 8 + .../lib/jsdom/living/nodes/HTMLSpanElement-impl.js | 9 + .../jsdom/living/nodes/HTMLStyleElement-impl.js | 74 + .../living/nodes/HTMLTableCaptionElement-impl.js | 9 + .../living/nodes/HTMLTableCellElement-impl.js | 73 + .../jsdom/living/nodes/HTMLTableColElement-impl.js | 9 + .../jsdom/living/nodes/HTMLTableElement-impl.js | 236 ++ .../jsdom/living/nodes/HTMLTableRowElement-impl.js | 88 + .../living/nodes/HTMLTableSectionElement-impl.js | 61 + .../jsdom/living/nodes/HTMLTemplateElement-impl.js | 67 + .../jsdom/living/nodes/HTMLTextAreaElement-impl.js | 272 ++ .../lib/jsdom/living/nodes/HTMLTimeElement-impl.js | 9 + .../jsdom/living/nodes/HTMLTitleElement-impl.js | 18 + .../jsdom/living/nodes/HTMLTrackElement-impl.js | 13 + .../jsdom/living/nodes/HTMLUListElement-impl.js | 9 + .../jsdom/living/nodes/HTMLUnknownElement-impl.js | 9 + .../jsdom/living/nodes/HTMLVideoElement-impl.js | 17 + .../jsdom/lib/jsdom/living/nodes/LinkStyle-impl.js | 2 + .../jsdom/lib/jsdom/living/nodes/Node-impl.js | 1165 +++++++ .../jsdom/lib/jsdom/living/nodes/NodeList-impl.js | 43 + .../living/nodes/NonDocumentTypeChildNode-impl.js | 28 + .../living/nodes/NonElementParentNode-impl.js | 11 + .../lib/jsdom/living/nodes/ParentNode-impl.js | 91 + .../living/nodes/ProcessingInstruction-impl.js | 22 + .../lib/jsdom/living/nodes/SVGElement-impl.js | 64 + .../jsdom/living/nodes/SVGGraphicsElement-impl.js | 16 + .../lib/jsdom/living/nodes/SVGSVGElement-impl.js | 42 + .../jsdom/lib/jsdom/living/nodes/SVGTests-impl.js | 42 + .../lib/jsdom/living/nodes/SVGTitleElement-impl.js | 9 + .../lib/jsdom/living/nodes/ShadowRoot-impl.js | 40 + .../jsdom/lib/jsdom/living/nodes/Slotable-impl.js | 48 + .../jsdom/lib/jsdom/living/nodes/Text-impl.js | 96 + .../jsdom/living/nodes/WindowEventHandlers-impl.js | 52 + .../lib/jsdom/living/nodes/XMLDocument-impl.js | 4 + .../jsdom/lib/jsdom/living/post-message.js | 39 + .../lib/jsdom/living/range/AbstractRange-impl.js | 43 + .../jsdom/lib/jsdom/living/range/Range-impl.js | 889 ++++++ .../lib/jsdom/living/range/StaticRange-impl.js | 39 + .../jsdom/lib/jsdom/living/range/boundary-point.js | 47 + .../lib/jsdom/living/selection/Selection-impl.js | 342 ++ .../lib/jsdom/living/svg/SVGAnimatedString-impl.js | 38 + .../jsdom/lib/jsdom/living/svg/SVGListBase.js | 195 ++ .../jsdom/lib/jsdom/living/svg/SVGNumber-impl.js | 48 + .../lib/jsdom/living/svg/SVGStringList-impl.js | 16 + .../jsdom/living/traversal/NodeIterator-impl.js | 127 + .../lib/jsdom/living/traversal/TreeWalker-impl.js | 217 ++ .../jsdom/lib/jsdom/living/traversal/helpers.js | 44 + .../living/websockets/WebSocket-impl-browser.js | 175 ++ .../lib/jsdom/living/websockets/WebSocket-impl.js | 328 ++ .../lib/jsdom/living/webstorage/Storage-impl.js | 102 + .../jsdom/lib/jsdom/living/window/BarProp-impl.js | 10 + .../jsdom/lib/jsdom/living/window/External-impl.js | 9 + .../jsdom/lib/jsdom/living/window/History-impl.js | 134 + .../jsdom/lib/jsdom/living/window/Location-impl.js | 238 ++ .../jsdom/lib/jsdom/living/window/Screen-impl.js | 13 + .../lib/jsdom/living/window/SessionHistory.js | 163 + .../jsdom/lib/jsdom/living/window/navigation.js | 84 + .../jsdom/lib/jsdom/living/xhr/FormData-impl.js | 171 + .../lib/jsdom/living/xhr/XMLHttpRequest-impl.js | 1023 ++++++ .../living/xhr/XMLHttpRequestEventTarget-impl.js | 17 + .../jsdom/living/xhr/XMLHttpRequestUpload-impl.js | 4 + .../jsdom/lib/jsdom/living/xhr/xhr-sync-worker.js | 60 + .../jsdom/lib/jsdom/living/xhr/xhr-utils.js | 438 +++ .../jsdom/lib/jsdom/named-properties-tracker.js | 158 + .../school/node_modules/jsdom/lib/jsdom/utils.js | 165 + .../jsdom/lib/jsdom/virtual-console.js | 34 + .../school/node_modules/jsdom/lib/jsdom/vm-shim.js | 106 + 460 files changed, 86534 insertions(+) create mode 100644 includes/external/school/node_modules/jsdom/lib/api.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/Window.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/default-stylesheet.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/js-globals.json create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/not-implemented.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/parser/html.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/parser/index.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/parser/xml.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/resources/async-resource-queue.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/resources/no-op-resource-loader.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/resources/per-document-resource-loader.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/resources/resource-loader.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/browser/resources/resource-queue.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/level2/style.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/level3/xpath.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/aborting/AbortController-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/aborting/AbortSignal-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/attributes.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/attributes/NamedNodeMap-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/constraint-validation/DefaultConstraintValidation-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/constraint-validation/ValidityState-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/cssom/StyleSheetList-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/custom-elements/CustomElementRegistry-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/documents.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/domparsing/DOMParser-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/domparsing/XMLSerializer-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/domparsing/parse5-adapter-serialization.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/domparsing/serialization.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/CloseEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/CompositionEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/CustomEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/ErrorEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/Event-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/FocusEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/HashChangeEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/InputEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/MessageEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/MouseEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/PageTransitionEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/PopStateEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/ProgressEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/StorageEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/TouchEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/UIEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/events/WheelEvent-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/fetch/Headers-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/fetch/header-list.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/fetch/header-types.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/file-api/Blob-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/file-api/File-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/file-api/FileList-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/file-api/FileReader-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/AbortController.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/AbortSignal.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/AbstractRange.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/AddEventListenerOptions.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/AssignedNodesOptions.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Attr.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/BarProp.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/BinaryType.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Blob.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/BlobCallback.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/BlobPropertyBag.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/CDATASection.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/CanPlayTypeResult.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/CharacterData.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/CloseEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/CloseEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Comment.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/CompositionEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/CompositionEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/CustomElementConstructor.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/CustomElementRegistry.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/CustomEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/CustomEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/DOMImplementation.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/DOMParser.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/DOMStringMap.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/DOMTokenList.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Document.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/DocumentFragment.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/DocumentReadyState.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/DocumentType.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Element.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ElementCreationOptions.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ElementDefinitionOptions.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/EndingType.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ErrorEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ErrorEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Event.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/EventHandlerNonNull.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/EventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/EventListener.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/EventListenerOptions.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/EventModifierInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/External.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/File.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/FileList.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/FilePropertyBag.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/FileReader.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/FocusEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/FocusEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/FormData.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Function.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/GetRootNodeOptions.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLAnchorElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLAreaElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLAudioElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLBRElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLBaseElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLBodyElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLButtonElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLCollection.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLDListElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLDataElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLDataListElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLDetailsElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLDialogElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLDirectoryElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLDivElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLEmbedElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLFieldSetElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLFontElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLFormElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLFrameElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLFrameSetElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLHRElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLHeadElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLHeadingElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLHtmlElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLIFrameElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLImageElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLInputElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLLIElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLLabelElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLLegendElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLLinkElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLMapElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLMarqueeElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLMediaElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLMenuElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLMetaElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLMeterElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLModElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLOListElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLObjectElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLOptGroupElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLOptionElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLOptionsCollection.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLOutputElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLParagraphElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLParamElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLPictureElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLPreElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLProgressElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLQuoteElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLScriptElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLSelectElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLSlotElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLSourceElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLSpanElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLStyleElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableCaptionElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableCellElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableColElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableRowElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableSectionElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLTemplateElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLTextAreaElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLTimeElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLTitleElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLTrackElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLUListElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLUnknownElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HTMLVideoElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HashChangeEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/HashChangeEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Headers.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/History.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/InputEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/InputEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/KeyboardEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/KeyboardEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Location.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/MessageEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/MessageEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/MimeType.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/MimeTypeArray.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/MouseEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/MouseEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/MutationCallback.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/MutationObserver.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/MutationObserverInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/MutationRecord.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/NamedNodeMap.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Navigator.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Node.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/NodeFilter.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/NodeIterator.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/NodeList.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/OnBeforeUnloadEventHandlerNonNull.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/OnErrorEventHandlerNonNull.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/PageTransitionEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/PageTransitionEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Performance.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Plugin.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/PluginArray.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/PopStateEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/PopStateEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ProcessingInstruction.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ProgressEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ProgressEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Range.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedString.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/SVGBoundingBoxOptions.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/SVGElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/SVGGraphicsElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/SVGNumber.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/SVGSVGElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/SVGStringList.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/SVGTitleElement.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Screen.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ScrollBehavior.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ScrollIntoViewOptions.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ScrollLogicalPosition.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ScrollOptions.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ScrollRestoration.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Selection.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/SelectionMode.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ShadowRoot.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ShadowRootInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ShadowRootMode.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/StaticRange.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/StaticRangeInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Storage.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/StorageEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/StorageEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/StyleSheetList.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/SupportedType.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/Text.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/TextTrackKind.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/TouchEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/TouchEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/TreeWalker.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/UIEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/UIEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/ValidityState.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/VisibilityState.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/VoidFunction.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/WebSocket.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/WheelEvent.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/WheelEventInit.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/XMLDocument.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequest.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequestEventTarget.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequestResponseType.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequestUpload.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/XMLSerializer.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/generated/utils.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/agent-factory.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/binary-data.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/create-element.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/create-event-accessor.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/custom-elements.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/dates-and-times.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/details.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/document-base-url.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/events.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/focusing.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/form-controls.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/html-constructor.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/http-request.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/internal-constants.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/iterable-weak-set.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/json.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/mutation-observers.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/namespaces.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/node.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/number-and-date-inputs.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/ordered-set.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/selectors.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/shadow-dom.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/strings.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/style-rules.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/stylesheets.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/svg/basic-types.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/svg/render.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/text.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/traversal.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/helpers/validate-names.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/hr-time/Performance-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/interfaces.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/mutation-observer/MutationObserver-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/mutation-observer/MutationRecord-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/named-properties-window.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/navigator/MimeType-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/navigator/MimeTypeArray-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/navigator/Navigator-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorConcurrentHardware-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorCookies-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorID-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorLanguage-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorOnLine-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorPlugins-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/navigator/Plugin-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/navigator/PluginArray-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/node-document-position.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/node-type.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/node.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/CDATASection-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/CharacterData-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/ChildNode-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/Comment-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/DOMImplementation-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/DOMStringMap-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/DOMTokenList-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/DocumentFragment-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/DocumentOrShadowRoot-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/DocumentType-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/Element-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/ElementCSSInlineStyle-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/ElementContentEditable-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/GlobalEventHandlers-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAnchorElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAreaElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAudioElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBRElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBodyElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLButtonElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCollection-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDListElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDataElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDataListElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDetailsElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDialogElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDirectoryElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDivElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLEmbedElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFieldSetElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFontElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFormElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFrameElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFrameSetElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHRElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHeadElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHeadingElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHtmlElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHyperlinkElementUtils-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLIFrameElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLImageElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLInputElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLIElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLabelElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLegendElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLinkElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMapElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMarqueeElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMediaElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMenuElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMetaElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMeterElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLModElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOListElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLObjectElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptGroupElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptionElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptionsCollection-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOrSVGElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOutputElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLParagraphElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLParamElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLPictureElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLPreElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLProgressElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLQuoteElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSelectElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSlotElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSourceElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSpanElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableCaptionElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableCellElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableColElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableRowElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableSectionElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTemplateElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTextAreaElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTimeElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTitleElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTrackElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLUListElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLUnknownElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/HTMLVideoElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/LinkStyle-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/Node-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/NodeList-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/NonElementParentNode-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/ParentNode-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/ProcessingInstruction-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/SVGElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/SVGGraphicsElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/SVGSVGElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/SVGTests-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/SVGTitleElement-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/ShadowRoot-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/Slotable-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/Text-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/WindowEventHandlers-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/nodes/XMLDocument-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/post-message.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/range/AbstractRange-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/range/Range-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/range/StaticRange-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/range/boundary-point.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/selection/Selection-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/svg/SVGAnimatedString-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/svg/SVGListBase.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/svg/SVGNumber-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/svg/SVGStringList-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/traversal/NodeIterator-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/traversal/TreeWalker-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/traversal/helpers.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/websockets/WebSocket-impl-browser.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/websockets/WebSocket-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/webstorage/Storage-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/window/BarProp-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/window/External-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/window/History-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/window/Location-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/window/Screen-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/window/SessionHistory.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/window/navigation.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/xhr/FormData-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequestEventTarget-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequestUpload-impl.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/xhr/xhr-sync-worker.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/named-properties-tracker.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/utils.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/virtual-console.js create mode 100644 includes/external/school/node_modules/jsdom/lib/jsdom/vm-shim.js (limited to 'includes/external/school/node_modules/jsdom/lib') diff --git a/includes/external/school/node_modules/jsdom/lib/api.js b/includes/external/school/node_modules/jsdom/lib/api.js new file mode 100644 index 0000000..5227f94 --- /dev/null +++ b/includes/external/school/node_modules/jsdom/lib/api.js @@ -0,0 +1,333 @@ +"use strict"; +const path = require("path"); +const fs = require("fs").promises; +const vm = require("vm"); +const toughCookie = require("tough-cookie"); +const sniffHTMLEncoding = require("html-encoding-sniffer"); +const whatwgURL = require("whatwg-url"); +const whatwgEncoding = require("whatwg-encoding"); +const { URL } = require("whatwg-url"); +const MIMEType = require("whatwg-mimetype"); +const idlUtils = require("./jsdom/living/generated/utils.js"); +const VirtualConsole = require("./jsdom/virtual-console.js"); +const { createWindow } = require("./jsdom/browser/Window.js"); +const { parseIntoDocument } = require("./jsdom/browser/parser"); +const { fragmentSerialization } = require("./jsdom/living/domparsing/serialization.js"); +const ResourceLoader = require("./jsdom/browser/resources/resource-loader.js"); +const NoOpResourceLoader = require("./jsdom/browser/resources/no-op-resource-loader.js"); + +class CookieJar extends toughCookie.CookieJar { + constructor(store, options) { + // jsdom cookie jars must be loose by default + super(store, { looseMode: true, ...options }); + } +} + +const window = Symbol("window"); +let sharedFragmentDocument = null; + +class JSDOM { + constructor(input = "", options = {}) { + const mimeType = new MIMEType(options.contentType === undefined ? "text/html" : options.contentType); + const { html, encoding } = normalizeHTML(input, mimeType); + + options = transformOptions(options, encoding, mimeType); + + this[window] = createWindow(options.windowOptions); + + const documentImpl = idlUtils.implForWrapper(this[window]._document); + + options.beforeParse(this[window]._globalProxy); + + parseIntoDocument(html, documentImpl); + + documentImpl.close(); + } + + get window() { + // It's important to grab the global proxy, instead of just the result of `createWindow(...)`, since otherwise + // things like `window.eval` don't exist. + return this[window]._globalProxy; + } + + get virtualConsole() { + return this[window]._virtualConsole; + } + + get cookieJar() { + // TODO NEWAPI move _cookieJar to window probably + return idlUtils.implForWrapper(this[window]._document)._cookieJar; + } + + serialize() { + return fragmentSerialization(idlUtils.implForWrapper(this[window]._document), { requireWellFormed: false }); + } + + nodeLocation(node) { + if (!idlUtils.implForWrapper(this[window]._document)._parseOptions.sourceCodeLocationInfo) { + throw new Error("Location information was not saved for this jsdom. Use includeNodeLocations during creation."); + } + + return idlUtils.implForWrapper(node).sourceCodeLocation; + } + + getInternalVMContext() { + if (!vm.isContext(this[window])) { + throw new TypeError("This jsdom was not configured to allow script running. " + + "Use the runScripts option during creation."); + } + + return this[window]; + } + + reconfigure(settings) { + if ("windowTop" in settings) { + this[window]._top = settings.windowTop; + } + + if ("url" in settings) { + const document = idlUtils.implForWrapper(this[window]._document); + + const url = whatwgURL.parseURL(settings.url); + if (url === null) { + throw new TypeError(`Could not parse "${settings.url}" as a URL`); + } + + document._URL = url; + document._origin = whatwgURL.serializeURLOrigin(document._URL); + } + } + + static fragment(string = "") { + if (!sharedFragmentDocument) { + sharedFragmentDocument = (new JSDOM()).window.document; + } + + const template = sharedFragmentDocument.createElement("template"); + template.innerHTML = string; + return template.content; + } + + static fromURL(url, options = {}) { + return Promise.resolve().then(() => { + // Remove the hash while sending this through the research loader fetch(). + // It gets added back a few lines down when constructing the JSDOM object. + const parsedURL = new URL(url); + const originalHash = parsedURL.hash; + parsedURL.hash = ""; + url = parsedURL.href; + + options = normalizeFromURLOptions(options); + + const resourceLoader = resourcesToResourceLoader(options.resources); + const resourceLoaderForInitialRequest = resourceLoader.constructor === NoOpResourceLoader ? + new ResourceLoader() : + resourceLoader; + + const req = resourceLoaderForInitialRequest.fetch(url, { + accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + cookieJar: options.cookieJar, + referrer: options.referrer + }); + + return req.then(body => { + const res = req.response; + + options = Object.assign(options, { + url: req.href + originalHash, + contentType: res.headers["content-type"], + referrer: req.getHeader("referer") + }); + + return new JSDOM(body, options); + }); + }); + } + + static async fromFile(filename, options = {}) { + options = normalizeFromFileOptions(filename, options); + const buffer = await fs.readFile(filename); + + return new JSDOM(buffer, options); + } +} + +function normalizeFromURLOptions(options) { + // Checks on options that are invalid for `fromURL` + if (options.url !== undefined) { + throw new TypeError("Cannot supply a url option when using fromURL"); + } + if (options.contentType !== undefined) { + throw new TypeError("Cannot supply a contentType option when using fromURL"); + } + + // Normalization of options which must be done before the rest of the fromURL code can use them, because they are + // given to request() + const normalized = { ...options }; + + if (options.referrer !== undefined) { + normalized.referrer = (new URL(options.referrer)).href; + } + + if (options.cookieJar === undefined) { + normalized.cookieJar = new CookieJar(); + } + + return normalized; + + // All other options don't need to be processed yet, and can be taken care of in the normal course of things when + // `fromURL` calls `new JSDOM(html, options)`. +} + +function normalizeFromFileOptions(filename, options) { + const normalized = { ...options }; + + if (normalized.contentType === undefined) { + const extname = path.extname(filename); + if (extname === ".xhtml" || extname === ".xht" || extname === ".xml") { + normalized.contentType = "application/xhtml+xml"; + } + } + + if (normalized.url === undefined) { + normalized.url = new URL("file:" + path.resolve(filename)); + } + + return normalized; +} + +function transformOptions(options, encoding, mimeType) { + const transformed = { + windowOptions: { + // Defaults + url: "about:blank", + referrer: "", + contentType: "text/html", + parsingMode: "html", + parseOptions: { + sourceCodeLocationInfo: false, + scriptingEnabled: false + }, + runScripts: undefined, + encoding, + pretendToBeVisual: false, + storageQuota: 5000000, + + // Defaults filled in later + resourceLoader: undefined, + virtualConsole: undefined, + cookieJar: undefined + }, + + // Defaults + beforeParse() { } + }; + + // options.contentType was parsed into mimeType by the caller. + if (!mimeType.isHTML() && !mimeType.isXML()) { + throw new RangeError(`The given content type of "${options.contentType}" was not a HTML or XML content type`); + } + + transformed.windowOptions.contentType = mimeType.essence; + transformed.windowOptions.parsingMode = mimeType.isHTML() ? "html" : "xml"; + + if (options.url !== undefined) { + transformed.windowOptions.url = (new URL(options.url)).href; + } + + if (options.referrer !== undefined) { + transformed.windowOptions.referrer = (new URL(options.referrer)).href; + } + + if (options.includeNodeLocations) { + if (transformed.windowOptions.parsingMode === "xml") { + throw new TypeError("Cannot set includeNodeLocations to true with an XML content type"); + } + + transformed.windowOptions.parseOptions = { sourceCodeLocationInfo: true }; + } + + transformed.windowOptions.cookieJar = options.cookieJar === undefined ? + new CookieJar() : + options.cookieJar; + + transformed.windowOptions.virtualConsole = options.virtualConsole === undefined ? + (new VirtualConsole()).sendTo(console) : + options.virtualConsole; + + if (!(transformed.windowOptions.virtualConsole instanceof VirtualConsole)) { + throw new TypeError("virtualConsole must be an instance of VirtualConsole"); + } + + transformed.windowOptions.resourceLoader = resourcesToResourceLoader(options.resources); + + if (options.runScripts !== undefined) { + transformed.windowOptions.runScripts = String(options.runScripts); + if (transformed.windowOptions.runScripts === "dangerously") { + transformed.windowOptions.parseOptions.scriptingEnabled = true; + } else if (transformed.windowOptions.runScripts !== "outside-only") { + throw new RangeError(`runScripts must be undefined, "dangerously", or "outside-only"`); + } + } + + if (options.beforeParse !== undefined) { + transformed.beforeParse = options.beforeParse; + } + + if (options.pretendToBeVisual !== undefined) { + transformed.windowOptions.pretendToBeVisual = Boolean(options.pretendToBeVisual); + } + + if (options.storageQuota !== undefined) { + transformed.windowOptions.storageQuota = Number(options.storageQuota); + } + + return transformed; +} + +function normalizeHTML(html, mimeType) { + let encoding = "UTF-8"; + + if (ArrayBuffer.isView(html)) { + html = Buffer.from(html.buffer, html.byteOffset, html.byteLength); + } else if (html instanceof ArrayBuffer) { + html = Buffer.from(html); + } + + if (Buffer.isBuffer(html)) { + encoding = sniffHTMLEncoding(html, { + defaultEncoding: mimeType.isXML() ? "UTF-8" : "windows-1252", + transportLayerEncodingLabel: mimeType.parameters.get("charset") + }); + html = whatwgEncoding.decode(html, encoding); + } else { + html = String(html); + } + + return { html, encoding }; +} + +function resourcesToResourceLoader(resources) { + switch (resources) { + case undefined: { + return new NoOpResourceLoader(); + } + case "usable": { + return new ResourceLoader(); + } + default: { + if (!(resources instanceof ResourceLoader)) { + throw new TypeError("resources must be an instance of ResourceLoader"); + } + return resources; + } + } +} + +exports.JSDOM = JSDOM; + +exports.VirtualConsole = VirtualConsole; +exports.CookieJar = CookieJar; +exports.ResourceLoader = ResourceLoader; + +exports.toughCookie = toughCookie; diff --git a/includes/external/school/node_modules/jsdom/lib/jsdom/browser/Window.js b/includes/external/school/node_modules/jsdom/lib/jsdom/browser/Window.js new file mode 100644 index 0000000..9b2d75f --- /dev/null +++ b/includes/external/school/node_modules/jsdom/lib/jsdom/browser/Window.js @@ -0,0 +1,933 @@ +"use strict"; +const vm = require("vm"); +const webIDLConversions = require("webidl-conversions"); +const { CSSStyleDeclaration } = require("cssstyle"); +const { Performance: RawPerformance } = require("w3c-hr-time"); +const notImplemented = require("./not-implemented"); +const { installInterfaces } = require("../living/interfaces"); +const { define, mixin } = require("../utils"); +const Element = require("../living/generated/Element"); +const EventTarget = require("../living/generated/EventTarget"); +const EventHandlerNonNull = require("../living/generated/EventHandlerNonNull"); +const OnBeforeUnloadEventHandlerNonNull = require("../living/generated/OnBeforeUnloadEventHandlerNonNull"); +const OnErrorEventHandlerNonNull = require("../living/generated/OnErrorEventHandlerNonNull"); +const PageTransitionEvent = require("../living/generated/PageTransitionEvent"); +const namedPropertiesWindow = require("../living/named-properties-window"); +const postMessage = require("../living/post-message"); +const DOMException = require("domexception/webidl2js-wrapper"); +const { btoa, atob } = require("abab"); +const idlUtils = require("../living/generated/utils"); +const WebSocketImpl = require("../living/websockets/WebSocket-impl").implementation; +const BarProp = require("../living/generated/BarProp"); +const documents = require("../living/documents.js"); +const External = require("../living/generated/External"); +const Navigator = require("../living/generated/Navigator"); +const Performance = require("../living/generated/Performance"); +const Screen = require("../living/generated/Screen"); +const Storage = require("../living/generated/Storage"); +const Selection = require("../living/generated/Selection"); +const reportException = require("../living/helpers/runtime-script-errors"); +const { getCurrentEventHandlerValue } = require("../living/helpers/create-event-accessor.js"); +const { fireAnEvent } = require("../living/helpers/events"); +const SessionHistory = require("../living/window/SessionHistory"); +const { forEachMatchingSheetRuleOfElement, getResolvedValue, propertiesWithResolvedValueImplemented, + SHADOW_DOM_PSEUDO_REGEXP } = require("../living/helpers/style-rules.js"); +const CustomElementRegistry = require("../living/generated/CustomElementRegistry"); +const jsGlobals = require("./js-globals.json"); + +const GlobalEventHandlersImpl = require("../living/nodes/GlobalEventHandlers-impl").implementation; +const WindowEventHandlersImpl = require("../living/nodes/WindowEventHandlers-impl").implementation; + +const events = new Set([ + // GlobalEventHandlers + "abort", "autocomplete", + "autocompleteerror", "blur", + "cancel", "canplay", "canplaythrough", + "change", "click", + "close", "contextmenu", + "cuechange", "dblclick", + "drag", "dragend", + "dragenter", + "dragleave", "dragover", + "dragstart", "drop", + "durationchange", "emptied", + "ended", "focus", + "input", "invalid", + "keydown", "keypress", + "keyup", "load", "loadeddata", + "loadedmetadata", "loadstart", + "mousedown", "mouseenter", + "mouseleave", "mousemove", + "mouseout", "mouseover", + "mouseup", "wheel", + "pause", "play", + "playing", "progress", + "ratechange", "reset", + "resize", "scroll", + "securitypolicyviolation", + "seeked", "seeking", + "select", "sort", "stalled", + "submit", "suspend", + "timeupdate", "toggle", + "volumechange", "waiting", + + // WindowEventHandlers + "afterprint", + "beforeprint", + "hashchange", + "languagechange", + "message", + "messageerror", + "offline", + "online", + "pagehide", + "pageshow", + "popstate", + "rejectionhandled", + "storage", + "unhandledrejection", + "unload" + + // "error" and "beforeunload" are added separately +]); + +exports.createWindow = function (options) { + return new Window(options); +}; + +const jsGlobalEntriesToInstall = Object.entries(jsGlobals).filter(([name]) => name in global); + +// TODO remove when we drop Node v10 support. +const anyNodeVersionQueueMicrotask = typeof queueMicrotask === "function" ? queueMicrotask : process.nextTick; + +// https://html.spec.whatwg.org/#the-window-object +function setupWindow(windowInstance, { runScripts }) { + if (runScripts === "outside-only" || runScripts === "dangerously") { + contextifyWindow(windowInstance); + + // Without this, these globals will only appear to scripts running inside the context using vm.runScript; they will + // not appear to scripts running from the outside, including to JSDOM implementation code. + for (const [globalName, globalPropDesc] of jsGlobalEntriesToInstall) { + const propDesc = { ...globalPropDesc, value: vm.runInContext(globalName, windowInstance) }; + Object.defineProperty(windowInstance, globalName, propDesc); + } + } else { + // Without contextifying the window, none of the globals will exist. So, let's at least alias them from the Node.js + // context. See https://github.com/jsdom/jsdom/issues/2727 for more background and discussion. + for (const [globalName, globalPropDesc] of jsGlobalEntriesToInstall) { + const propDesc = { ...globalPropDesc, value: global[globalName] }; + Object.defineProperty(windowInstance, globalName, propDesc); + } + } + + installInterfaces(windowInstance, ["Window"]); + + const EventTargetConstructor = windowInstance.EventTarget; + + // eslint-disable-next-line func-name-matching, func-style, no-shadow + const windowConstructor = function Window() { + throw new TypeError("Illegal constructor"); + }; + Object.setPrototypeOf(windowConstructor, EventTargetConstructor); + + Object.defineProperty(windowInstance, "Window", { + configurable: true, + writable: true, + value: windowConstructor + }); + + const windowPrototype = Object.create(EventTargetConstructor.prototype); + Object.defineProperties(windowPrototype, { + constructor: { + value: windowConstructor, + writable: true, + configurable: true + }, + [Symbol.toStringTag]: { + value: "Window", + configurable: true + } + }); + + windowConstructor.prototype = windowPrototype; + Object.setPrototypeOf(windowInstance, windowPrototype); + + EventTarget.setup(windowInstance, windowInstance); + mixin(windowInstance, WindowEventHandlersImpl.prototype); + mixin(windowInstance, GlobalEventHandlersImpl.prototype); + windowInstance._initGlobalEvents(); + + Object.defineProperty(windowInstance, "onbeforeunload", { + configurable: true, + enumerable: true, + get() { + return idlUtils.tryWrapperForImpl(getCurrentEventHandlerValue(this, "beforeunload")); + }, + set(V) { + if (!idlUtils.isObject(V)) { + V = null; + } else { + V = OnBeforeUnloadEventHandlerNonNull.convert(V, { + context: "Failed to set the 'onbeforeunload' property on 'Window': The provided value" + }); + } + this._setEventHandlerFor("beforeunload", V); + } + }); + + Object.defineProperty(windowInstance, "onerror", { + configurable: true, + enumerable: true, + get() { + return idlUtils.tryWrapperForImpl(getCurrentEventHandlerValue(this, "error")); + }, + set(V) { + if (!idlUtils.isObject(V)) { + V = null; + } else { + V = OnErrorEventHandlerNonNull.convert(V, { + context: "Failed to set the 'onerror' property on 'Window': The provided value" + }); + } + this._setEventHandlerFor("error", V); + } + }); + + for (const event of events) { + Object.defineProperty(windowInstance, `on${event}`, { + configurable: true, + enumerable: true, + get() { + return idlUtils.tryWrapperForImpl(getCurrentEventHandlerValue(this, event)); + }, + set(V) { + if (!idlUtils.isObject(V)) { + V = null; + } else { + V = EventHandlerNonNull.convert(V, { + context: `Failed to set the 'on${event}' property on 'Window': The provided value` + }); + } + this._setEventHandlerFor(event, V); + } + }); + } + + windowInstance._globalObject = windowInstance; +} + +// NOTE: per https://heycam.github.io/webidl/#Global, all properties on the Window object must be own-properties. +// That is why we assign everything inside of the constructor, instead of using a shared prototype. +// You can verify this in e.g. Firefox or Internet Explorer, which do a good job with Web IDL compliance. +function Window(options) { + setupWindow(this, { runScripts: options.runScripts }); + + const rawPerformance = new RawPerformance(); + const windowInitialized = rawPerformance.now(); + + const window = this; + + // ### PRIVATE DATA PROPERTIES + + this._resourceLoader = options.resourceLoader; + + // vm initialization is deferred until script processing is activated + this._globalProxy = this; + Object.defineProperty(idlUtils.implForWrapper(this), idlUtils.wrapperSymbol, { get: () => this._globalProxy }); + + // List options explicitly to be clear which are passed through + this._document = documents.createWrapper(window, { + parsingMode: options.parsingMode, + contentType: options.contentType, + encoding: options.encoding, + cookieJar: options.cookieJar, + url: options.url, + lastModified: options.lastModified, + referrer: options.referrer, + parseOptions: options.parseOptions, + defaultView: this._globalProxy, + global: this, + parentOrigin: options.parentOrigin + }, { alwaysUseDocumentClass: true }); + + if (vm.isContext(window)) { + const documentImpl = idlUtils.implForWrapper(window._document); + documentImpl._defaultView = window._globalProxy = vm.runInContext("this", window); + } + + const documentOrigin = idlUtils.implForWrapper(this._document)._origin; + this._origin = documentOrigin; + + // https://html.spec.whatwg.org/#session-history + this._sessionHistory = new SessionHistory({ + document: idlUtils.implForWrapper(this._document), + url: idlUtils.implForWrapper(this._document)._URL, + stateObject: null + }, this); + + this._virtualConsole = options.virtualConsole; + + this._runScripts = options.runScripts; + + // Set up the window as if it's a top level window. + // If it's not, then references will be corrected by frame/iframe code. + this._parent = this._top = this._globalProxy; + this._frameElement = null; + + // This implements window.frames.length, since window.frames returns a + // self reference to the window object. This value is incremented in the + // HTMLFrameElement implementation. + this._length = 0; + + // https://dom.spec.whatwg.org/#window-current-event + this._currentEvent = undefined; + + this._pretendToBeVisual = options.pretendToBeVisual; + this._storageQuota = options.storageQuota; + + // Some properties (such as localStorage and sessionStorage) share data + // between windows in the same origin. This object is intended + // to contain such data. + if (options.commonForOrigin && options.commonForOrigin[documentOrigin]) { + this._commonForOrigin = options.commonForOrigin; + } else { + this._commonForOrigin = { + [documentOrigin]: { + localStorageArea: new Map(), + sessionStorageArea: new Map(), + windowsInSameOrigin: [this] + } + }; + } + + this._currentOriginData = this._commonForOrigin[documentOrigin]; + + // ### WEB STORAGE + + this._localStorage = Storage.create(window, [], { + associatedWindow: this, + storageArea: this._currentOriginData.localStorageArea, + type: "localStorage", + url: this._document.documentURI, + storageQuota: this._storageQuota + }); + this._sessionStorage = Storage.create(window, [], { + associatedWindow: this, + storageArea: this._currentOriginData.sessionStorageArea, + type: "sessionStorage", + url: this._document.documentURI, + storageQuota: this._storageQuota + }); + + // ### SELECTION + + // https://w3c.github.io/selection-api/#dfn-selection + this._selection = Selection.createImpl(window); + + // https://w3c.github.io/selection-api/#dom-window + this.getSelection = function () { + return window._selection; + }; + + // ### GETTERS + + const locationbar = BarProp.create(window); + const menubar = BarProp.create(window); + const personalbar = BarProp.create(window); + const scrollbars = BarProp.create(window); + const statusbar = BarProp.create(window); + const toolbar = BarProp.create(window); + const external = External.create(window); + const navigator = Navigator.create(window, [], { userAgent: this._resourceLoader._userAgent }); + const performance = Performance.create(window, [], { rawPerformance }); + const screen = Screen.create(window); + const customElementRegistry = CustomElementRegistry.create(window); + + define(this, { + get length() { + return window._length; + }, + get window() { + return window._globalProxy; + }, + get frameElement() { + return idlUtils.wrapperForImpl(window._frameElement); + }, + get frames() { + return window._globalProxy; + }, + get self() { + return window._globalProxy; + }, + get parent() { + return window._parent; + }, + get top() { + return window._top; + }, + get document() { + return window._document; + }, + get external() { + return external; + }, + get location() { + return idlUtils.wrapperForImpl(idlUtils.implForWrapper(window._document)._location); + }, + get history() { + return idlUtils.wrapperForImpl(idlUtils.implForWrapper(window._document)._history); + }, + get navigator() { + return navigator; + }, + get locationbar() { + return locationbar; + }, + get menubar() { + return menubar; + }, + get personalbar() { + return personalbar; + }, + get scrollbars() { + return scrollbars; + }, + get statusbar() { + return statusbar; + }, + get toolbar() { + return toolbar; + }, + get performance() { + return performance; + }, + get screen() { + return screen; + }, + get origin() { + return window._origin; + }, + // The origin IDL attribute is defined with [Replaceable]. + set origin(value) { + Object.defineProperty(this, "origin", { + value, + writable: true, + enumerable: true, + configurable: true + }); + }, + get localStorage() { + if (idlUtils.implForWrapper(this._document)._origin === "null") { + throw DOMException.create(window, [ + "localStorage is not available for opaque origins", + "SecurityError" + ]); + } + + return this._localStorage; + }, + get sessionStorage() { + if (idlUtils.implForWrapper(this._document)._origin === "null") { + throw DOMException.create(window, [ + "sessionStorage is not available for opaque origins", + "SecurityError" + ]); + } + + return this._sessionStorage; + }, + get customElements() { + return customElementRegistry; + }, + get event() { + return window._currentEvent ? idlUtils.wrapperForImpl(window._currentEvent) : undefined; + }, + set event(value) { + Object.defineProperty(window, "event", { configurable: true, enumerable: true, writable: true, value }); + } + }); + + namedPropertiesWindow.initializeWindow(this, this._globalProxy); + + // ### METHODS + + // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers + + // In the spec the list of active timers is a set of IDs. We make it a map of IDs to Node.js timer objects, so that + // we can call Node.js-side clearTimeout() when clearing, and thus allow process shutdown faster. + const listOfActiveTimers = new Map(); + let latestTimerId = 0; + + this.setTimeout = function (handler, timeout = 0, ...args) { + if (typeof handler !== "function") { + handler = webIDLConversions.DOMString(handler); + } + timeout = webIDLConversions.long(timeout); + + return timerInitializationSteps(handler, timeout, args, { methodContext: window, repeat: false }); + }; + this.setInterval = function (handler, timeout = 0, ...args) { + if (typeof handler !== "function") { + handler = webIDLConversions.DOMString(handler); + } + timeout = webIDLConversions.long(timeout); + + return timerInitializationSteps(handler, timeout, args, { methodContext: window, repeat: true }); + }; + + this.clearTimeout = function (handle = 0) { + handle = webIDLConversions.long(handle); + + const nodejsTimer = listOfActiveTimers.get(handle); + if (nodejsTimer) { + clearTimeout(nodejsTimer); + listOfActiveTimers.delete(handle); + } + }; + this.clearInterval = function (handle = 0) { + handle = webIDLConversions.long(handle); + + const nodejsTimer = listOfActiveTimers.get(handle); + if (nodejsTimer) { + // We use setTimeout() in timerInitializationSteps even for this.setInterval(). + clearTimeout(nodejsTimer); + listOfActiveTimers.delete(handle); + } + }; + + function timerInitializationSteps(handler, timeout, args, { methodContext, repeat, previousHandle }) { + // This appears to be unspecced, but matches browser behavior for close()ed windows. + if (!methodContext._document) { + return 0; + } + + // TODO: implement timer nesting level behavior. + + const methodContextProxy = methodContext._globalProxy; + const handle = previousHandle !== undefined ? previousHandle : ++latestTimerId; + + function task() { + if (!listOfActiveTimers.has(handle)) { + return; + } + + try { + if (typeof handler === "function") { + handler.apply(methodContextProxy, args); + } else if (window._runScripts === "dangerously") { + vm.runInContext(handler, window, { filename: window.location.href, displayErrors: false }); + } + } catch (e) { + reportException(window, e, window.location.href); + } + + if (listOfActiveTimers.has(handle)) { + if (repeat) { + timerInitializationSteps(handler, timeout, args, { methodContext, repeat: true, previousHandle: handle }); + } else { + listOfActiveTimers.delete(handle); + } + } + } + + if (timeout < 0) { + timeout = 0; + } + + const nodejsTimer = setTimeout(task, timeout); + listOfActiveTimers.set(handle, nodejsTimer); + + return handle; + } + + // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#microtask-queuing + + this.queueMicrotask = function (callback) { + callback = webIDLConversions.Function(callback); + + anyNodeVersionQueueMicrotask(() => { + try { + callback(); + } catch (e) { + reportException(window, e, window.location.href); + } + }); + }; + + // https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#animation-frames + + let animationFrameCallbackId = 0; + const mapOfAnimationFrameCallbacks = new Map(); + let animationFrameNodejsInterval = null; + + // Unlike the spec, where an animation frame happens every 60 Hz regardless, we optimize so that if there are no + // requestAnimationFrame() calls outstanding, we don't fire the timer. This helps us track that. + let numberOfOngoingAnimationFrameCallbacks = 0; + + if (this._pretendToBeVisual) { + this.requestAnimationFrame = function (callback) { + callback = webIDLConversions.Function(callback); + + const handle = ++animationFrameCallbackId; + mapOfAnimationFrameCallbacks.set(handle, callback); + + ++numberOfOngoingAnimationFrameCallbacks; + if (numberOfOngoingAnimationFrameCallbacks === 1) { + animationFrameNodejsInterval = setInterval(() => { + runAnimationFrameCallbacks(rawPerformance.now() - windowInitialized); + }, 1000 / 60); + } + + return handle; + }; + + this.cancelAnimationFrame = function (handle) { + handle = webIDLConversions["unsigned long"](handle); + + removeAnimationFrameCallback(handle); + }; + + function runAnimationFrameCallbacks(now) { + // Converting to an array is important to get a sync snapshot and thus match spec semantics. + const callbackHandles = [...mapOfAnimationFrameCallbacks.keys()]; + for (const handle of callbackHandles) { + // This has() can be false if a callback calls cancelAnimationFrame(). + if (mapOfAnimationFrameCallbacks.has(handle)) { + const callback = mapOfAnimationFrameCallbacks.get(handle); + removeAnimationFrameCallback(handle); + try { + callback(now); + } catch (e) { + reportException(window, e, window.location.href); + } + } + } + } + + function removeAnimationFrameCallback(handle) { + if (mapOfAnimationFrameCallbacks.has(handle)) { + --numberOfOngoingAnimationFrameCallbacks; + if (numberOfOngoingAnimationFrameCallbacks === 0) { + clearInterval(animationFrameNodejsInterval); + } + } + + mapOfAnimationFrameCallbacks.delete(handle); + } + } + + function stopAllTimers() { + for (const nodejsTimer of listOfActiveTimers.values()) { + clearTimeout(nodejsTimer); + } + listOfActiveTimers.clear(); + + clearInterval(animationFrameNodejsInterval); + } + + function Option(text, value, defaultSelected, selected) { + if (text === undefined) { + text = ""; + } + text = webIDLConversions.DOMString(text); + + if (value !== undefined) { + value = webIDLConversions.DOMString(value); + } + + defaultSelected = webIDLConversions.boolean(defaultSelected); + selected = webIDLConversions.boolean(selected); + + const option = window._document.createElement("option"); + const impl = idlUtils.implForWrapper(option); + + if (text !== "") { + impl.text = text; + } + if (value !== undefined) { + impl.setAttributeNS(null, "value", value); + } + if (defaultSelected) { + impl.setAttributeNS(null, "selected", ""); + } + impl._selectedness = selected; + + return option; + } + Object.defineProperty(Option, "prototype", { + value: this.HTMLOptionElement.prototype, + configurable: false, + enumerable: false, + writable: false + }); + Object.defineProperty(window, "Option", { + value: Option, + configurable: true, + enumerable: false, + writable: true + }); + + function Image(...args) { + const img = window._document.createElement("img"); + const impl = idlUtils.implForWrapper(img); + + if (args.length > 0) { + impl.setAttributeNS(null, "width", String(args[0])); + } + if (args.length > 1) { + impl.setAttributeNS(null, "height", String(args[1])); + } + + return img; + } + Object.defineProperty(Image, "prototype", { + value: this.HTMLImageElement.prototype, + configurable: false, + enumerable: false, + writable: false + }); + Object.defineProperty(window, "Image", { + value: Image, + configurable: true, + enumerable: false, + writable: true + }); + + function Audio(src) { + const audio = window._document.createElement("audio"); + const impl = idlUtils.implForWrapper(audio); + impl.setAttributeNS(null, "preload", "auto"); + + if (src !== undefined) { + impl.setAttributeNS(null, "src", String(src)); + } + + return audio; + } + Object.defineProperty(Audio, "prototype", { + value: this.HTMLAudioElement.prototype, + configurable: false, + enumerable: false, + writable: false + }); + Object.defineProperty(window, "Audio", { + value: Audio, + configurable: true, + enumerable: false, + writable: true + }); + + this.postMessage = postMessage(window); + + this.atob = function (str) { + const result = atob(str); + if (result === null) { + throw DOMException.create(window, [ + "The string to be decoded contains invalid characters.", + "InvalidCharacterError" + ]); + } + return result; + }; + + this.btoa = function (str) { + const result = btoa(str); + if (result === null) { + throw DOMException.create(window, [ + "The string to be encoded contains invalid characters.", + "InvalidCharacterError" + ]); + } + return result; + }; + + this.stop = function () { + const manager = idlUtils.implForWrapper(this._document)._requestManager; + if (manager) { + manager.close(); + } + }; + + this.close = function () { + // Recursively close child frame windows, then ourselves (depth-first). + for (let i = 0; i < this.length; ++i) { + this[i].close(); + } + + // Clear out all listeners. Any in-flight or upcoming events should not get delivered. + idlUtils.implForWrapper(this)._eventListeners = Object.create(null); + + if (this._document) { + if (this._document.body) { + this._document.body.innerHTML = ""; + } + + if (this._document.close) { + // It's especially important to clear out the listeners here because document.close() causes a "load" event to + // fire. + idlUtils.implForWrapper(this._document)._eventListeners = Object.create(null); + this._document.close(); + } + const doc = idlUtils.implForWrapper(this._document); + if (doc._requestManager) { + doc._requestManager.close(); + } + delete this._document; + } + + stopAllTimers(); + WebSocketImpl.cleanUpWindow(this); + }; + + this.getComputedStyle = function (elt, pseudoElt = undefined) { + elt = Element.convert(elt); + if (pseudoElt !== undefined && pseudoElt !== null) { + pseudoElt = webIDLConversions.DOMString(pseudoElt); + } + + if (pseudoElt !== undefined && pseudoElt !== null && pseudoElt !== "") { + // TODO: Parse pseudoElt + + if (SHADOW_DOM_PSEUDO_REGEXP.test(pseudoElt)) { + throw new TypeError("Tried to get the computed style of a Shadow DOM pseudo-element."); + } + + notImplemented("window.computedStyle(elt, pseudoElt)", this); + } + + const declaration = new CSSStyleDeclaration(); + const { forEach } = Array.prototype; + const { style } = elt; + + forEachMatchingSheetRuleOfElement(elt, rule => { + forEach.call(rule.style, property => { + declaration.setProperty( + property, + rule.style.getPropertyValue(property), + rule.style.getPropertyPriority(property) + ); + }); + }); + + // https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle + const declarations = Object.keys(propertiesWithResolvedValueImplemented); + forEach.call(declarations, property => { + declaration.setProperty(property, getResolvedValue(elt, property)); + }); + + forEach.call(style, property => { + declaration.setProperty(property, style.getPropertyValue(property), style.getPropertyPriority(property)); + }); + + return declaration; + }; + + this.getSelection = function () { + return window._document.getSelection(); + }; + + // The captureEvents() and releaseEvents() methods must do nothing + this.captureEvents = function () {}; + + this.releaseEvents = function () {}; + + // ### PUBLIC DATA PROPERTIES (TODO: should be getters) + + function wrapConsoleMethod(method) { + return (...args) => { + window._virtualConsole.emit(method, ...args); + }; + } + + this.console = { + assert: wrapConsoleMethod("assert"), + clear: wrapConsoleMethod("clear"), + count: wrapConsoleMethod("count"), + countReset: wrapConsoleMethod("countReset"), + debug: wrapConsoleMethod("debug"), + dir: wrapConsoleMethod("dir"), + dirxml: wrapConsoleMethod("dirxml"), + error: wrapConsoleMethod("error"), + group: wrapConsoleMethod("group"), + groupCollapsed: wrapConsoleMethod("groupCollapsed"), + groupEnd: wrapConsoleMethod("groupEnd"), + info: wrapConsoleMethod("info"), + log: wrapConsoleMethod("log"), + table: wrapConsoleMethod("table"), + time: wrapConsoleMethod("time"), + timeLog: wrapConsoleMethod("timeLog"), + timeEnd: wrapConsoleMethod("timeEnd"), + trace: wrapConsoleMethod("trace"), + warn: wrapConsoleMethod("warn") + }; + + function notImplementedMethod(name) { + return function () { + notImplemented(name, window); + }; + } + + define(this, { + name: "", + status: "", + devicePixelRatio: 1, + innerWidth: 1024, + innerHeight: 768, + outerWidth: 1024, + outerHeight: 768, + pageXOffset: 0, + pageYOffset: 0, + screenX: 0, + screenLeft: 0, + screenY: 0, + screenTop: 0, + scrollX: 0, + scrollY: 0, + + alert: notImplementedMethod("window.alert"), + blur: notImplementedMethod("window.blur"), + confirm: notImplementedMethod("window.confirm"), + focus: notImplementedMethod("window.focus"), + moveBy: notImplementedMethod("window.moveBy"), + moveTo: notImplementedMethod("window.moveTo"), + open: notImplementedMethod("window.open"), + print: notImplementedMethod("window.print"), + prompt: notImplementedMethod("window.prompt"), + resizeBy: notImplementedMethod("window.resizeBy"), + resizeTo: notImplementedMethod("window.resizeTo"), + scroll: notImplementedMethod("window.scroll"), + scrollBy: notImplementedMethod("window.scrollBy"), + scrollTo: notImplementedMethod("window.scrollTo") + }); + + // ### INITIALIZATION + + process.nextTick(() => { + if (!window.document) { + return; // window might've been closed already + } + + const documentImpl = idlUtils.implForWrapper(window._document); + + if (window.document.readyState === "complete") { + fireAnEvent("load", window, undefined, {}, documentImpl); + } else { + window.document.addEventListener("load", () => { + fireAnEvent("load", window, undefined, {}, documentImpl); + + if (!documentImpl._pageShowingFlag) { + documentImpl._pageShowingFlag = true; + fireAnEvent("pageshow", window, PageTransitionEvent, { persisted: false }, documentImpl); + } + }); + } + }); +} + +function contextifyWindow(window) { + if (vm.isContext(window)) { + return; + } + + vm.createContext(window); +} diff --git a/includes/external/school/node_modules/jsdom/lib/jsdom/browser/default-stylesheet.js b/includes/external/school/node_modules/jsdom/lib/jsdom/browser/default-stylesheet.js new file mode 100644 index 0000000..78f69bb --- /dev/null +++ b/includes/external/school/node_modules/jsdom/lib/jsdom/browser/default-stylesheet.js @@ -0,0 +1,789 @@ +// Ideally, we would use +// https://html.spec.whatwg.org/multipage/rendering.html#the-css-user-agent-style-sheet-and-presentational-hints +// but for now, just use the version from blink. This file is copied from +// https://chromium.googlesource.com/chromium/blink/+/96aa3a280ab7d67178c8f122a04949ce5f8579e0/Source/core/css/html.css +// (removed a line which had octal literals inside since octal literals are not allowed in template strings) + +// We use a .js file because otherwise we can't browserify this. (brfs is unusable due to lack of ES2015 support) + +module.exports = ` +/* + * The default style sheet used to render HTML. + * + * Copyright (C) 2000 Lars Knoll (knoll@kde.org) + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +@namespace "http://www.w3.org/1999/xhtml"; + +html { + display: block +} + +:root { + scroll-blocks-on: start-touch wheel-event +} + +/* children of the element all have display:none */ +head { + display: none +} + +meta { + display: none +} + +title { + display: none +} + +link { + display: none +} + +style { + display: none +} + +script { + display: none +} + +/* generic block-level elements */ + +body { + display: block; + margin: 8px +} + +p { + display: block; + -webkit-margin-before: 1__qem; + -webkit-margin-after: 1__qem; + -webkit-margin-start: 0; + -webkit-margin-end: 0; +} + +div { + display: block +} + +layer { + display: block +} + +article, aside, footer, header, hgroup, main, nav, section { + display: block +} + +marquee { + display: inline-block; +} + +address { + display: block +} + +blockquote { + display: block; + -webkit-margin-before: 1__qem; + -webkit-margin-after: 1em; + -webkit-margin-start: 40px; + -webkit-margin-end: 40px; +} + +figcaption { + display: block +} + +figure { + display: block; + -webkit-margin-before: 1em; + -webkit-margin-after: 1em; + -webkit-margin-start: 40px; + -webkit-margin-end: 40px; +} + +q { + display: inline +} + +/* nwmatcher does not support ::before and ::after, so we can't render q +correctly: https://html.spec.whatwg.org/multipage/rendering.html#phrasing-content-3 +TODO: add q::before and q::after selectors +*/ + +center { + display: block; + /* special centering to be able to emulate the html4/netscape behaviour */ + text-align: -webkit-center +} + +hr { + display: block; + -webkit-margin-before: 0.5em; + -webkit-margin-after: 0.5em; + -webkit-margin-start: auto; + -webkit-margin-end: auto; + border-style: inset; + border-width: 1px; + box-sizing: border-box +} + +map { + display: inline +} + +video { + object-fit: contain; +} + +/* heading elements */ + +h1 { + display: block; + font-size: 2em; + -webkit-margin-before: 0.67__qem; + -webkit-margin-after: 0.67em; + -webkit-margin-start: 0; + -webkit-margin-end: 0; + font-weight: bold +} + +article h1, +aside h1, +nav h1, +section h1 { + font-size: 1.5em; + -webkit-margin-before: 0.83__qem; + -webkit-margin-after: 0.83em; +} + +article article h1, +article aside h1, +article nav h1, +article section h1, +aside article h1, +aside aside h1, +aside nav h1, +aside section h1, +nav article h1, +nav aside h1, +nav nav h1, +nav section h1, +section article h1, +section aside h1, +section nav h1, +section section h1 { + font-size: 1.17em; + -webkit-margin-before: 1__qem; + -webkit-margin-after: 1em; +} + +/* Remaining selectors are deleted because nwmatcher does not support +:matches() and expanding the selectors manually would be far too verbose. +Also see https://html.spec.whatwg.org/multipage/rendering.html#sections-and-headings +TODO: rewrite to use :matches() when nwmatcher supports it. +*/ + +h2 { + display: block; + font-size: 1.5em; + -webkit-margin-before: 0.83__qem; + -webkit-margin-after: 0.83em; + -webkit-margin-start: 0; + -webkit-margin-end: 0; + font-weight: bold +} + +h3 { + display: block; + font-size: 1.17em; + -webkit-margin-before: 1__qem; + -webkit-margin-after: 1em; + -webkit-margin-start: 0; + -webkit-margin-end: 0; + font-weight: bold +} + +h4 { + display: block; + -webkit-margin-before: 1.33__qem; + -webkit-margin-after: 1.33em; + -webkit-margin-start: 0; + -webkit-margin-end: 0; + font-weight: bold +} + +h5 { + display: block; + font-size: .83em; + -webkit-margin-before: 1.67__qem; + -webkit-margin-after: 1.67em; + -webkit-margin-start: 0; + -webkit-margin-end: 0; + font-weight: bold +} + +h6 { + display: block; + font-size: .67em; + -webkit-margin-before: 2.33__qem; + -webkit-margin-after: 2.33em; + -webkit-margin-start: 0; + -webkit-margin-end: 0; + font-weight: bold +} + +/* tables */ + +table { + display: table; + border-collapse: separate; + border-spacing: 2px; + border-color: gray +} + +thead { + display: table-header-group; + vertical-align: middle; + border-color: inherit +} + +tbody { + display: table-row-group; + vertical-align: middle; + border-color: inherit +} + +tfoot { + display: table-footer-group; + vertical-align: middle; + border-color: inherit +} + +/* for tables without table section elements (can happen with XHTML or dynamically created tables) */ +table > tr { + vertical-align: middle; +} + +col { + display: table-column +} + +colgroup { + display: table-column-group +} + +tr { + display: table-row; + vertical-align: inherit; + border-color: inherit +} + +td, th { + display: table-cell; + vertical-align: inherit +} + +th { + font-weight: bold +} + +caption { + display: table-caption; + text-align: -webkit-center +} + +/* lists */ + +ul, menu, dir { + display: block; + list-style-type: disc; + -webkit-margin-before: 1__qem; + -webkit-margin-after: 1em; + -webkit-margin-start: 0; + -webkit-margin-end: 0; + -webkit-padding-start: 40px +} + +ol { + display: block; + list-style-type: decimal; + -webkit-margin-before: 1__qem; + -webkit-margin-after: 1em; + -webkit-margin-start: 0; + -webkit-margin-end: 0; + -webkit-padding-start: 40px +} + +li { + display: list-item; + text-align: -webkit-match-parent; +} + +ul ul, ol ul { + list-style-type: circle +} + +ol ol ul, ol ul ul, ul ol ul, ul ul ul { + list-style-type: square +} + +dd { + display: block; + -webkit-margin-start: 40px +} + +dl { + display: block; + -webkit-margin-before: 1__qem; + -webkit-margin-after: 1em; + -webkit-margin-start: 0; + -webkit-margin-end: 0; +} + +dt { + display: block +} + +ol ul, ul ol, ul ul, ol ol { + -webkit-margin-before: 0; + -webkit-margin-after: 0 +} + +/* form elements */ + +form { + display: block; + margin-top: 0__qem; +} + +label { + cursor: default; +} + +legend { + display: block; + -webkit-padding-start: 2px; + -webkit-padding-end: 2px; + border: none +} + +fieldset { + display: block; + -webkit-margin-start: 2px; + -webkit-margin-end: 2px; + -webkit-padding-before: 0.35em; + -webkit-padding-start: 0.75em; + -webkit-padding-end: 0.75em; + -webkit-padding-after: 0.625em; + border: 2px groove ThreeDFace; + min-width: -webkit-min-content; +} + +button { + -webkit-appearance: button; +} + +/* Form controls don't go vertical. */ +input, textarea, select, button, meter, progress { + -webkit-writing-mode: horizontal-tb !important; +} + +input, textarea, select, button { + margin: 0__qem; + font: -webkit-small-control; + text-rendering: auto; /* FIXME: Remove when tabs work with optimizeLegibility. */ + color: initial; + letter-spacing: normal; + word-spacing: normal; + line-height: normal; + text-transform: none; + text-indent: 0; + text-shadow: none; + display: inline-block; + text-align: start; +} + +/* TODO: Add " i" to attribute matchers to support case-insensitive matching */ +input[type="hidden"] { + display: none +} + +input { + -webkit-appearance: textfield; + padding: 1px; + background-color: white; + border: 2px inset; + -webkit-rtl-ordering: logical; + -webkit-user-select: text; + cursor: auto; +} + +input[type="search"] { + -webkit-appearance: searchfield; + box-sizing: border-box; +} + +select { + border-radius: 5px; +} + +textarea { + -webkit-appearance: textarea; + background-color: white; + border: 1px solid; + -webkit-rtl-ordering: logical; + -webkit-user-select: text; + flex-direction: column; + resize: auto; + cursor: auto; + padding: 2px; + white-space: pre-wrap; + word-wrap: break-word; +} + +input[type="password"] { + -webkit-text-security: disc !important; +} + +input[type="hidden"], input[type="image"], input[type="file"] { + -webkit-appearance: initial; + padding: initial; + background-color: initial; + border: initial; +} + +input[type="file"] { + align-items: baseline; + color: inherit; + text-align: start !important; +} + +input[type="radio"], input[type="checkbox"] { + margin: 3px 0.5ex; + padding: initial; + background-color: initial; + border: initial; +} + +input[type="button"], input[type="submit"], input[type="reset"] { + -webkit-appearance: push-button; + -webkit-user-select: none; + white-space: pre +} + +input[type="button"], input[type="submit"], input[type="reset"], button { + align-items: flex-start; + text-align: center; + cursor: default; + color: ButtonText; + padding: 2px 6px 3px 6px; + border: 2px outset ButtonFace; + background-color: ButtonFace; + box-sizing: border-box +} + +input[type="range"] { + -webkit-appearance: slider-horizontal; + padding: initial; + border: initial; + margin: 2px; + color: #909090; +} + +input[type="button"]:disabled, input[type="submit"]:disabled, input[type="reset"]:disabled, +button:disabled, select:disabled, optgroup:disabled, option:disabled, +select[disabled]>option { + color: GrayText +} + +input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, button:active { + border-style: inset +} + +input[type="button"]:active:disabled, input[type="submit"]:active:disabled, input[type="reset"]:active:disabled, button:active:disabled { + border-style: outset +} + +datalist { + display: none +} + +area { + display: inline; + cursor: pointer; +} + +param { + display: none +} + +input[type="checkbox"] { + -webkit-appearance: checkbox; + box-sizing: border-box; +} + +input[type="radio"] { + -webkit-appearance: radio; + box-sizing: border-box; +} + +input[type="color"] { + -webkit-appearance: square-button; + width: 44px; + height: 23px; + background-color: ButtonFace; + /* Same as native_theme_base. */ + border: 1px #a9a9a9 solid; + padding: 1px 2px; +} + +input[type="color"][list] { + -webkit-appearance: menulist; + width: 88px; + height: 23px +} + +select { + -webkit-appearance: menulist; + box-sizing: border-box; + align-items: center; + border: 1px solid; + white-space: pre; + -webkit-rtl-ordering: logical; + color: black; + background-color: white; + cursor: default; +} + +optgroup { + font-weight: bolder; + display: block; +} + +option { + font-weight: normal; + display: block; + padding: 0 2px 1px 2px; + white-space: pre; + min-height: 1.2em; +} + +output { + display: inline; +} + +/* meter */ + +meter { + -webkit-appearance: meter; + box-sizing: border-box; + display: inline-block; + height: 1em; + width: 5em; + vertical-align: -0.2em; +} + +/* progress */ + +progress { + -webkit-appearance: progress-bar; + box-sizing: border-box; + display: inline-block; + height: 1em; + width: 10em; + vertical-align: -0.2em; +} + +/* inline elements */ + +u, ins { + text-decoration: underline +} + +strong, b { + font-weight: bold +} + +i, cite, em, var, address, dfn { + font-style: italic +} + +tt, code, kbd, samp { + font-family: monospace +} + +pre, xmp, plaintext, listing { + display: block; + font-family: monospace; + white-space: pre; + margin: 1__qem 0 +} + +mark { + background-color: yellow; + color: black +} + +big { + font-size: larger +} + +small { + font-size: smaller +} + +s, strike, del { + text-decoration: line-through +} + +sub { + vertical-align: sub; + font-size: smaller +} + +sup { + vertical-align: super; + font-size: smaller +} + +nobr { + white-space: nowrap +} + +/* states */ + +:focus { + outline: auto 5px -webkit-focus-ring-color +} + +/* Read-only text fields do not show a focus ring but do still receive focus */ +html:focus, body:focus, input[readonly]:focus { + outline: none +} + +embed:focus, iframe:focus, object:focus { + outline: none +} + +input:focus, textarea:focus, select:focus { + outline-offset: -2px +} + +input[type="button"]:focus, +input[type="checkbox"]:focus, +input[type="file"]:focus, +input[type="hidden"]:focus, +input[type="image"]:focus, +input[type="radio"]:focus, +input[type="reset"]:focus, +input[type="search"]:focus, +input[type="submit"]:focus { + outline-offset: 0 +} + +/* HTML5 ruby elements */ + +ruby, rt { + text-indent: 0; /* blocks used for ruby rendering should not trigger this */ +} + +rt { + line-height: normal; + -webkit-text-emphasis: none; +} + +ruby > rt { + display: block; + font-size: 50%; + text-align: start; +} + +ruby > rp { + display: none; +} + +/* other elements */ + +noframes { + display: none +} + +frameset, frame { + display: block +} + +frameset { + border-color: inherit +} + +iframe { + border: 2px inset +} + +details { + display: block +} + +summary { + display: block +} + +template { + display: none +} + +bdi, output { + unicode-bidi: -webkit-isolate; +} + +bdo { + unicode-bidi: bidi-override; +} + +textarea[dir=auto] { + unicode-bidi: -webkit-plaintext; +} + +dialog:not([open]) { + display: none +} + +dialog { + position: absolute; + left: 0; + right: 0; + width: -webkit-fit-content; + height: -webkit-fit-content; + margin: auto; + border: solid; + padding: 1em; + background: white; + color: black +} + +[hidden] { + display: none +} + +/* noscript is handled internally, as it depends on settings. */ + +`; diff --git a/includes/external/school/node_modules/jsdom/lib/jsdom/browser/js-globals.json b/includes/external/school/node_modules/jsdom/lib/jsdom/browser/js-globals.json new file mode 100644 index 0000000..c4de05f --- /dev/null +++ b/includes/external/school/node_modules/jsdom/lib/jsdom/browser/js-globals.json @@ -0,0 +1,307 @@ +{ + "Object": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Function": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Array": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Number": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "parseFloat": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "parseInt": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Infinity": { + "writable": false, + "enumerable": false, + "configurable": false + }, + "NaN": { + "writable": false, + "enumerable": false, + "configurable": false + }, + "undefined": { + "writable": false, + "enumerable": false, + "configurable": false + }, + "Boolean": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "String": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Symbol": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Date": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Promise": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "RegExp": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Error": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "AggregateError": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "EvalError": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "RangeError": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "ReferenceError": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "SyntaxError": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "TypeError": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "URIError": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "globalThis": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "JSON": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Math": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Intl": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "ArrayBuffer": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Uint8Array": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Int8Array": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Uint16Array": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Int16Array": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Uint32Array": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Int32Array": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Float32Array": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Float64Array": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Uint8ClampedArray": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "BigUint64Array": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "BigInt64Array": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "DataView": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Map": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "BigInt": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Set": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "WeakMap": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "WeakSet": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Proxy": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Reflect": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "FinalizationRegistry": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "WeakRef": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "decodeURI": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "decodeURIComponent": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "encodeURI": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "encodeURIComponent": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "escape": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "unescape": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "eval": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "isFinite": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "isNaN": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "SharedArrayBuffer": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "Atomics": { + "writable": true, + "enumerable": false, + "configurable": true + }, + "WebAssembly": { + "writable": true, + "enumerable": false, + "configurable": true + } +} diff --git a/includes/external/school/node_modules/jsdom/lib/jsdom/browser/not-implemented.js b/includes/external/school/node_modules/jsdom/lib/jsdom/browser/not-implemented.js new file mode 100644 index 0000000..a87cc95 --- /dev/null +++ b/includes/external/school/node_modules/jsdom/lib/jsdom/browser/not-implemented.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (nameForErrorMessage, window) { + if (!window) { + // Do nothing for window-less documents. + return; + } + + const error = new Error(`Not implemented: ${nameForErrorMessage}`); + error.type = "not implemented"; + + window._virtualConsole.emit("jsdomError", error); +}; diff --git a/includes/external/school/node_modules/jsdom/lib/jsdom/browser/parser/html.js b/includes/external/school/node_modules/jsdom/lib/jsdom/browser/parser/html.js new file mode 100644 index 0000000..198cc2c --- /dev/null +++ b/includes/external/school/node_modules/jsdom/lib/jsdom/browser/parser/html.js @@ -0,0 +1,223 @@ +"use strict"; + +const parse5 = require("parse5"); + +const { createElement } = require("../../living/helpers/create-element"); +const { HTML_NS } = require("../../living/helpers/namespaces"); + +const DocumentType = require("../../living/generated/DocumentType"); +const DocumentFragment = require("../../living/generated/DocumentFragment"); +const Text = require("../../living/generated/Text"); +const Comment = require("../../living/generated/Comment"); + +const attributes = require("../../living/attributes"); +const nodeTypes = require("../../living/node-type"); + +const serializationAdapter = require("../../living/domparsing/parse5-adapter-serialization"); +const { + customElementReactionsStack, invokeCEReactions, lookupCEDefinition +} = require("../../living/helpers/custom-elements"); + +// Horrible monkey-patch to implement https://github.com/inikulin/parse5/issues/237 and +// https://github.com/inikulin/parse5/issues/285. +const OpenElementStack = require("parse5/lib/parser/open-element-stack"); + +const openElementStackOriginalPush = OpenElementStack.prototype.push; +OpenElementStack.prototype.push = function (...args) { + openElementStackOriginalPush.apply(this, args); + this.treeAdapter._currentElement = this.current; + + const after = this.items[this.stackTop]; + if (after._pushedOnStackOfOpenElements) { + after._pushedOnStackOfOpenElements(); + } +}; + +const openElementStackOriginalPop = OpenElementStack.prototype.pop; +OpenElementStack.prototype.pop = function (...args) { + const before = this.items[this.stackTop]; + + openElementStackOriginalPop.apply(this, args); + this.treeAdapter._currentElement = this.current; + + if (before._poppedOffStackOfOpenElements) { + before._poppedOffStackOfOpenElements(); + } +}; + +class JSDOMParse5Adapter { + constructor(documentImpl, options = {}) { + this._documentImpl = documentImpl; + this._globalObject = documentImpl._globalObject; + this._fragment = options.fragment || false; + + // Since the createElement hook doesn't provide the parent element, we keep track of this using _currentElement: + // https://github.com/inikulin/parse5/issues/285. See above horrible monkey-patch for how this is maintained. + this._currentElement = undefined; + } + + _ownerDocument() { + const { _currentElement } = this; + + // The _currentElement is undefined when parsing elements at the root of the document. + if (_currentElement) { + return _currentElement.localName === "template" && _currentElement.namespaceURI === HTML_NS ? + _currentElement.content._ownerDocument : + _currentElement._ownerDocument; + } + + return this._documentImpl; + } + + createDocument() { + // parse5's model assumes that parse(html) will call into here to create the new Document, then return it. However, + // jsdom's model assumes we can create a Window (and through that create an empty Document), do some other setup + // stuff, and then parse, stuffing nodes into that Document as we go. So to adapt between these two models, we just + // return the already-created Document when asked by parse5 to "create" a Document. + return this._documentImpl; + } + + createDocumentFragment() { + const ownerDocument = this._ownerDocument(); + return DocumentFragment.createImpl(this._globalObject, [], { ownerDocument }); + } + + // https://html.spec.whatwg.org/#create-an-element-for-the-token + createElement(localName, namespace, attrs) { + const ownerDocument = this._ownerDocument(); + + const isAttribute = attrs.find(attr => attr.name === "is"); + const isValue = isAttribute ? isAttribute.value : null; + + const definition = lookupCEDefinition(ownerDocument, namespace, localName); + + let willExecuteScript = false; + if (definition !== null && !this._fragment) { + willExecuteScript = true; + } + + if (willExecuteScript) { + ownerDocument._throwOnDynamicMarkupInsertionCounter++; + customElementReactionsStack.push([]); + } + + const element = createElement(ownerDocument, localName, namespace, null, isValue, willExecuteScript); + this.adoptAttributes(element, attrs); + + if (willExecuteScript) { + const queue = customElementReactionsStack.pop(); + invokeCEReactions(queue); + ownerDocument._throwOnDynamicMarkupInsertionCounter--; + } + + if ("_parserInserted" in element) { + element._parserInserted = true; + } + + return element; + } + + createCommentNode(data) { + const ownerDocument = this._ownerDocument(); + return Comment.createImpl(this._globalObject, [], { data, ownerDocument }); + } + + appendChild(parentNode, newNode) { + parentNode._append(newNode); + } + + insertBefore(parentNode, newNode, referenceNode) { + parentNode._insert(newNode, referenceNode); + } + + setTemplateContent(templateElement, contentFragment) { + // This code makes the glue between jsdom and parse5 HTMLTemplateElement parsing: + // + // * jsdom during the construction of the HTMLTemplateElement (for example when create via + // `document.createElement("template")`), creates a DocumentFragment and set it into _templateContents. + // * parse5 when parsing a