@dooboostore/dom-parser 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.MD +369 -6
- package/dist/cjs/DomParser.js +11 -1
- package/dist/cjs/DomParser.js.map +2 -2
- package/dist/cjs/bundle-entry.js +36 -0
- package/dist/cjs/bundle-entry.js.map +7 -0
- package/dist/cjs/factory/ElementFactory.js +31 -7
- package/dist/cjs/factory/ElementFactory.js.map +2 -2
- package/dist/cjs/index.js +26 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/node/CharacterData.js.map +1 -1
- package/dist/cjs/node/ChildNode.js +0 -15
- package/dist/cjs/node/ChildNode.js.map +3 -3
- package/dist/cjs/node/ChildNodeBase.js +20 -0
- package/dist/cjs/node/ChildNodeBase.js.map +2 -2
- package/dist/cjs/node/Comment.js.map +2 -2
- package/dist/cjs/node/Document.js +0 -27
- package/dist/cjs/node/Document.js.map +4 -4
- package/dist/cjs/node/DocumentBase.js +168 -205
- package/dist/cjs/node/DocumentBase.js.map +2 -2
- package/dist/cjs/node/DocumentFragment.js +0 -15
- package/dist/cjs/node/DocumentFragment.js.map +3 -3
- package/dist/cjs/node/DocumentFragmentBase.js.map +2 -2
- package/dist/cjs/node/Node.js.map +1 -1
- package/dist/cjs/node/NodeBase.js +44 -2
- package/dist/cjs/node/NodeBase.js.map +2 -2
- package/dist/cjs/node/NodeFilter.js +43 -0
- package/dist/cjs/node/NodeFilter.js.map +7 -0
- package/dist/cjs/node/NodeIterator.js +1 -28
- package/dist/cjs/node/NodeIterator.js.map +2 -2
- package/dist/cjs/node/ParentNode.js +0 -15
- package/dist/cjs/node/ParentNode.js.map +3 -3
- package/dist/cjs/node/ParentNodeBase.js +10 -10
- package/dist/cjs/node/ParentNodeBase.js.map +3 -3
- package/dist/cjs/node/ShadowRootBase.js +79 -0
- package/dist/cjs/node/ShadowRootBase.js.map +7 -0
- package/dist/cjs/node/Text.js +0 -15
- package/dist/cjs/node/Text.js.map +3 -3
- package/dist/cjs/node/TextBase.js +0 -3
- package/dist/cjs/node/TextBase.js.map +2 -2
- package/dist/cjs/node/TreeWalker.js +272 -0
- package/dist/cjs/node/TreeWalker.js.map +7 -0
- package/dist/cjs/node/collection/{HTMLCollection.js → HTMLCollectionImp.js} +7 -6
- package/dist/cjs/node/collection/HTMLCollectionImp.js.map +7 -0
- package/dist/cjs/node/collection/HTMLCollectionOfImp.js +26 -0
- package/dist/cjs/node/collection/HTMLCollectionOfImp.js.map +7 -0
- package/dist/cjs/node/collection/NodeList.js.map +1 -1
- package/dist/cjs/node/collection/{NodeListOf.js → NodeListOfImp.js} +6 -6
- package/dist/cjs/node/collection/NodeListOfImp.js.map +7 -0
- package/dist/cjs/node/collection/StylePropertyMapImpl.js +65 -0
- package/dist/cjs/node/collection/StylePropertyMapImpl.js.map +7 -0
- package/dist/cjs/node/collection/index.js +6 -6
- package/dist/cjs/node/collection/index.js.map +2 -2
- package/dist/cjs/node/elements/Element.js +0 -15
- package/dist/cjs/node/elements/Element.js.map +3 -3
- package/dist/cjs/node/elements/ElementBase.js +163 -331
- package/dist/cjs/node/elements/ElementBase.js.map +3 -3
- package/dist/cjs/node/elements/HTMLAnchorElement.js +2 -2
- package/dist/cjs/node/elements/HTMLAnchorElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLAreaElement.js +2 -2
- package/dist/cjs/node/elements/HTMLAreaElement.js.map +2 -2
- package/dist/cjs/node/elements/{HTMLGenericElement.js → HTMLAudioElement.js} +8 -11
- package/dist/cjs/node/elements/HTMLAudioElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLBaseElement.js +2 -2
- package/dist/cjs/node/elements/HTMLBaseElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLBodyElement.js +2 -2
- package/dist/cjs/node/elements/HTMLBodyElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLButtonElement.js +3 -3
- package/dist/cjs/node/elements/HTMLButtonElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLCanvasElement.js +2 -2
- package/dist/cjs/node/elements/HTMLCanvasElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLCaptionElement.js +2 -2
- package/dist/cjs/node/elements/HTMLCaptionElement.js.map +2 -2
- package/dist/cjs/node/{collection/HTMLCollectionOf.js → elements/HTMLDListElement.js} +9 -16
- package/dist/cjs/node/elements/HTMLDListElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLDataElement.js +29 -0
- package/dist/cjs/node/elements/HTMLDataElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLDataListElement.js +29 -0
- package/dist/cjs/node/elements/HTMLDataListElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLDetailsElement.js +29 -0
- package/dist/cjs/node/elements/HTMLDetailsElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLDialogElement.js +29 -0
- package/dist/cjs/node/elements/HTMLDialogElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLDivElement.js +2 -2
- package/dist/cjs/node/elements/HTMLDivElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLElement.js +13 -0
- package/dist/cjs/node/elements/HTMLElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLElementBase.js +44 -44
- package/dist/cjs/node/elements/HTMLElementBase.js.map +2 -2
- package/dist/cjs/node/elements/HTMLEmbedElement.js +2 -2
- package/dist/cjs/node/elements/HTMLEmbedElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLFieldSetElement.js +29 -0
- package/dist/cjs/node/elements/HTMLFieldSetElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLFormElement.js +2 -2
- package/dist/cjs/node/elements/HTMLFormElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLH1Element.js +2 -2
- package/dist/cjs/node/elements/HTMLH1Element.js.map +2 -2
- package/dist/cjs/node/elements/HTMLHRElement.js +29 -0
- package/dist/cjs/node/elements/HTMLHRElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLHeadElement.js +2 -2
- package/dist/cjs/node/elements/HTMLHeadElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLHtmlElement.js +2 -2
- package/dist/cjs/node/elements/HTMLHtmlElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLIFrameElement.js +29 -0
- package/dist/cjs/node/elements/HTMLIFrameElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLImgElement.js +2 -2
- package/dist/cjs/node/elements/HTMLImgElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLInputElement.js +2 -2
- package/dist/cjs/node/elements/HTMLInputElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLLIElement.js +2 -2
- package/dist/cjs/node/elements/HTMLLIElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLLabelElement.js +29 -0
- package/dist/cjs/node/elements/HTMLLabelElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLLegendElement.js +29 -0
- package/dist/cjs/node/elements/HTMLLegendElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLLinkElement.js +2 -2
- package/dist/cjs/node/elements/HTMLLinkElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLMapElement.js +29 -0
- package/dist/cjs/node/elements/HTMLMapElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLMetaElement.js +2 -2
- package/dist/cjs/node/elements/HTMLMetaElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLMeterElement.js +29 -0
- package/dist/cjs/node/elements/HTMLMeterElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLModElement.js +29 -0
- package/dist/cjs/node/elements/HTMLModElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLOListElement.js +2 -2
- package/dist/cjs/node/elements/HTMLOListElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLObjectElement.js +29 -0
- package/dist/cjs/node/elements/HTMLObjectElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLOptGroupElement.js +29 -0
- package/dist/cjs/node/elements/HTMLOptGroupElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLOptionElement.js +29 -0
- package/dist/cjs/node/elements/HTMLOptionElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLOutputElement.js +29 -0
- package/dist/cjs/node/elements/HTMLOutputElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLPElement.js +2 -2
- package/dist/cjs/node/elements/HTMLPElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLParamElement.js +29 -0
- package/dist/cjs/node/elements/HTMLParamElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLPictureElement.js +29 -0
- package/dist/cjs/node/elements/HTMLPictureElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLPreElement.js +29 -0
- package/dist/cjs/node/elements/HTMLPreElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLProgressElement.js +29 -0
- package/dist/cjs/node/elements/HTMLProgressElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLQuoteElement.js +29 -0
- package/dist/cjs/node/elements/HTMLQuoteElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLScriptElement.js +2 -2
- package/dist/cjs/node/elements/HTMLScriptElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLSelectElement.js +29 -0
- package/dist/cjs/node/elements/HTMLSelectElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLSlotElement.js +29 -0
- package/dist/cjs/node/elements/HTMLSlotElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLSourceElement.js +29 -0
- package/dist/cjs/node/elements/HTMLSourceElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLSpanElement.js +2 -2
- package/dist/cjs/node/elements/HTMLSpanElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLStyleElement.js +2 -2
- package/dist/cjs/node/elements/HTMLStyleElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLTableElement.js +2 -2
- package/dist/cjs/node/elements/HTMLTableElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLTbodyElement.js +2 -2
- package/dist/cjs/node/elements/HTMLTbodyElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLTdElement.js +2 -2
- package/dist/cjs/node/elements/HTMLTdElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLTemplateElement.js +2 -2
- package/dist/cjs/node/elements/HTMLTemplateElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLTextAreaElement.js +29 -0
- package/dist/cjs/node/elements/HTMLTextAreaElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLTfootElement.js +2 -2
- package/dist/cjs/node/elements/HTMLTfootElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLThElement.js +2 -2
- package/dist/cjs/node/elements/HTMLThElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLTheadElement.js +2 -2
- package/dist/cjs/node/elements/HTMLTheadElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLTimeElement.js +29 -0
- package/dist/cjs/node/elements/HTMLTimeElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLTitleElement.js +2 -2
- package/dist/cjs/node/elements/HTMLTitleElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLTrElement.js +2 -2
- package/dist/cjs/node/elements/HTMLTrElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLTrackElement.js +29 -0
- package/dist/cjs/node/elements/HTMLTrackElement.js.map +7 -0
- package/dist/cjs/node/elements/HTMLUListElement.js +2 -2
- package/dist/cjs/node/elements/HTMLUListElement.js.map +2 -2
- package/dist/cjs/node/elements/HTMLVideoElement.js +29 -0
- package/dist/cjs/node/elements/HTMLVideoElement.js.map +7 -0
- package/dist/cjs/node/elements/MathMLElement.js +2 -2
- package/dist/cjs/node/elements/MathMLElement.js.map +2 -2
- package/dist/cjs/node/elements/SVGElement.js +2 -2
- package/dist/cjs/node/elements/SVGElement.js.map +2 -2
- package/dist/cjs/node/elements/index.js +181 -94
- package/dist/cjs/node/elements/index.js.map +2 -2
- package/dist/cjs/node/index.js +6 -16
- package/dist/cjs/node/index.js.map +2 -2
- package/dist/cjs/utils/CSSSelector.js.map +2 -2
- package/dist/cjs/window/CustomElementRegistryImp.js +113 -0
- package/dist/cjs/window/CustomElementRegistryImp.js.map +7 -0
- package/dist/cjs/window/Window.js +0 -15
- package/dist/cjs/window/Window.js.map +3 -3
- package/dist/cjs/window/WindowBase.js +210 -613
- package/dist/cjs/window/WindowBase.js.map +2 -2
- package/dist/cjs/window/index.js +0 -5
- package/dist/cjs/window/index.js.map +2 -2
- package/dist/esm/DomParser.js +11 -1
- package/dist/esm/DomParser.js.map +2 -2
- package/dist/esm/bundle-entry.js +6 -0
- package/dist/esm/bundle-entry.js.map +7 -0
- package/dist/esm/factory/ElementFactory.js +32 -8
- package/dist/esm/factory/ElementFactory.js.map +2 -2
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/node/ChildNodeBase.js +20 -0
- package/dist/esm/node/ChildNodeBase.js.map +2 -2
- package/dist/esm/node/Comment.js.map +2 -2
- package/dist/esm/node/Document.js +0 -8
- package/dist/esm/node/Document.js.map +4 -4
- package/dist/esm/node/DocumentBase.js +165 -202
- package/dist/esm/node/DocumentBase.js.map +2 -2
- package/dist/esm/node/DocumentFragmentBase.js.map +2 -2
- package/dist/esm/node/Node.js.map +1 -1
- package/dist/esm/node/NodeBase.js +45 -22
- package/dist/esm/node/NodeBase.js.map +2 -2
- package/dist/esm/node/NodeFilter.js +24 -0
- package/dist/esm/node/NodeFilter.js.map +7 -0
- package/dist/esm/node/NodeIterator.js +1 -28
- package/dist/esm/node/NodeIterator.js.map +2 -2
- package/dist/esm/node/ParentNodeBase.js +4 -4
- package/dist/esm/node/ParentNodeBase.js.map +2 -2
- package/dist/esm/node/ShadowRootBase.js +60 -0
- package/dist/esm/node/ShadowRootBase.js.map +7 -0
- package/dist/esm/node/TextBase.js +0 -3
- package/dist/esm/node/TextBase.js.map +2 -2
- package/dist/esm/node/TreeWalker.js +253 -0
- package/dist/esm/node/TreeWalker.js.map +7 -0
- package/dist/esm/node/collection/{HTMLCollection.js → HTMLCollectionImp.js} +4 -3
- package/dist/esm/node/collection/HTMLCollectionImp.js.map +7 -0
- package/dist/esm/node/collection/HTMLCollectionOfImp.js +7 -0
- package/dist/esm/node/collection/HTMLCollectionOfImp.js.map +7 -0
- package/dist/esm/node/collection/NodeList.js.map +1 -1
- package/dist/esm/node/collection/{NodeListOf.js → NodeListOfImp.js} +3 -3
- package/dist/esm/node/collection/NodeListOfImp.js.map +7 -0
- package/dist/esm/node/collection/StylePropertyMapImpl.js +46 -0
- package/dist/esm/node/collection/StylePropertyMapImpl.js.map +7 -0
- package/dist/esm/node/collection/index.js +6 -6
- package/dist/esm/node/collection/index.js.map +2 -2
- package/dist/esm/node/elements/ElementBase.js +163 -331
- package/dist/esm/node/elements/ElementBase.js.map +3 -3
- package/dist/esm/node/elements/HTMLAnchorElement.js +2 -2
- package/dist/esm/node/elements/HTMLAnchorElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLAreaElement.js +2 -2
- package/dist/esm/node/elements/HTMLAreaElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLAudioElement.js +10 -0
- package/dist/esm/node/elements/HTMLAudioElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLBaseElement.js +2 -2
- package/dist/esm/node/elements/HTMLBaseElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLBodyElement.js +2 -2
- package/dist/esm/node/elements/HTMLBodyElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLButtonElement.js +3 -3
- package/dist/esm/node/elements/HTMLButtonElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLCanvasElement.js +2 -2
- package/dist/esm/node/elements/HTMLCanvasElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLCaptionElement.js +2 -2
- package/dist/esm/node/elements/HTMLCaptionElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLDListElement.js +10 -0
- package/dist/esm/node/elements/HTMLDListElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLDataElement.js +10 -0
- package/dist/esm/node/elements/HTMLDataElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLDataListElement.js +10 -0
- package/dist/esm/node/elements/HTMLDataListElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLDetailsElement.js +10 -0
- package/dist/esm/node/elements/HTMLDetailsElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLDialogElement.js +10 -0
- package/dist/esm/node/elements/HTMLDialogElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLDivElement.js +2 -2
- package/dist/esm/node/elements/HTMLDivElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLElement.js +9 -0
- package/dist/esm/node/elements/HTMLElement.js.map +3 -3
- package/dist/esm/node/elements/HTMLElementBase.js +43 -43
- package/dist/esm/node/elements/HTMLElementBase.js.map +2 -2
- package/dist/esm/node/elements/HTMLEmbedElement.js +2 -2
- package/dist/esm/node/elements/HTMLEmbedElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLFieldSetElement.js +10 -0
- package/dist/esm/node/elements/HTMLFieldSetElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLFormElement.js +2 -2
- package/dist/esm/node/elements/HTMLFormElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLH1Element.js +2 -2
- package/dist/esm/node/elements/HTMLH1Element.js.map +2 -2
- package/dist/esm/node/elements/HTMLHRElement.js +10 -0
- package/dist/esm/node/elements/HTMLHRElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLHeadElement.js +2 -2
- package/dist/esm/node/elements/HTMLHeadElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLHtmlElement.js +2 -2
- package/dist/esm/node/elements/HTMLHtmlElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLIFrameElement.js +10 -0
- package/dist/esm/node/elements/HTMLIFrameElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLImgElement.js +2 -2
- package/dist/esm/node/elements/HTMLImgElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLInputElement.js +2 -2
- package/dist/esm/node/elements/HTMLInputElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLLIElement.js +2 -2
- package/dist/esm/node/elements/HTMLLIElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLLabelElement.js +10 -0
- package/dist/esm/node/elements/HTMLLabelElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLLegendElement.js +10 -0
- package/dist/esm/node/elements/HTMLLegendElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLLinkElement.js +2 -2
- package/dist/esm/node/elements/HTMLLinkElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLMapElement.js +10 -0
- package/dist/esm/node/elements/HTMLMapElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLMetaElement.js +2 -2
- package/dist/esm/node/elements/HTMLMetaElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLMeterElement.js +10 -0
- package/dist/esm/node/elements/HTMLMeterElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLModElement.js +10 -0
- package/dist/esm/node/elements/HTMLModElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLOListElement.js +2 -2
- package/dist/esm/node/elements/HTMLOListElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLObjectElement.js +10 -0
- package/dist/esm/node/elements/HTMLObjectElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLOptGroupElement.js +10 -0
- package/dist/esm/node/elements/HTMLOptGroupElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLOptionElement.js +10 -0
- package/dist/esm/node/elements/HTMLOptionElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLOutputElement.js +10 -0
- package/dist/esm/node/elements/HTMLOutputElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLPElement.js +2 -2
- package/dist/esm/node/elements/HTMLPElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLParamElement.js +10 -0
- package/dist/esm/node/elements/HTMLParamElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLPictureElement.js +10 -0
- package/dist/esm/node/elements/HTMLPictureElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLPreElement.js +10 -0
- package/dist/esm/node/elements/HTMLPreElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLProgressElement.js +10 -0
- package/dist/esm/node/elements/HTMLProgressElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLQuoteElement.js +10 -0
- package/dist/esm/node/elements/HTMLQuoteElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLScriptElement.js +2 -2
- package/dist/esm/node/elements/HTMLScriptElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLSelectElement.js +10 -0
- package/dist/esm/node/elements/HTMLSelectElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLSlotElement.js +10 -0
- package/dist/esm/node/elements/HTMLSlotElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLSourceElement.js +10 -0
- package/dist/esm/node/elements/HTMLSourceElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLSpanElement.js +2 -2
- package/dist/esm/node/elements/HTMLSpanElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLStyleElement.js +2 -2
- package/dist/esm/node/elements/HTMLStyleElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLTableElement.js +2 -2
- package/dist/esm/node/elements/HTMLTableElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLTbodyElement.js +2 -2
- package/dist/esm/node/elements/HTMLTbodyElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLTdElement.js +2 -2
- package/dist/esm/node/elements/HTMLTdElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLTemplateElement.js +2 -2
- package/dist/esm/node/elements/HTMLTemplateElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLTextAreaElement.js +10 -0
- package/dist/esm/node/elements/HTMLTextAreaElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLTfootElement.js +2 -2
- package/dist/esm/node/elements/HTMLTfootElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLThElement.js +2 -2
- package/dist/esm/node/elements/HTMLThElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLTheadElement.js +2 -2
- package/dist/esm/node/elements/HTMLTheadElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLTimeElement.js +10 -0
- package/dist/esm/node/elements/HTMLTimeElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLTitleElement.js +2 -2
- package/dist/esm/node/elements/HTMLTitleElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLTrElement.js +2 -2
- package/dist/esm/node/elements/HTMLTrElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLTrackElement.js +10 -0
- package/dist/esm/node/elements/HTMLTrackElement.js.map +7 -0
- package/dist/esm/node/elements/HTMLUListElement.js +2 -2
- package/dist/esm/node/elements/HTMLUListElement.js.map +2 -2
- package/dist/esm/node/elements/HTMLVideoElement.js +10 -0
- package/dist/esm/node/elements/HTMLVideoElement.js.map +7 -0
- package/dist/esm/node/elements/MathMLElement.js +2 -2
- package/dist/esm/node/elements/MathMLElement.js.map +2 -2
- package/dist/esm/node/elements/SVGElement.js +2 -2
- package/dist/esm/node/elements/SVGElement.js.map +2 -2
- package/dist/esm/node/elements/index.js +182 -95
- package/dist/esm/node/elements/index.js.map +2 -2
- package/dist/esm/node/index.js +7 -17
- package/dist/esm/node/index.js.map +2 -2
- package/dist/esm/utils/CSSSelector.js.map +2 -2
- package/dist/esm/window/CustomElementRegistryImp.js +94 -0
- package/dist/esm/window/CustomElementRegistryImp.js.map +7 -0
- package/dist/esm/window/WindowBase.js +259 -597
- package/dist/esm/window/WindowBase.js.map +2 -2
- package/dist/esm/window/index.js +0 -5
- package/dist/esm/window/index.js.map +2 -2
- package/dist/esm-bundle/dooboostore-dom-parser.esm.js +3477 -3558
- package/dist/esm-bundle/dooboostore-dom-parser.esm.js.map +4 -4
- package/dist/types/DomParser.d.ts.map +1 -1
- package/dist/types/bundle-entry.d.ts +3 -0
- package/dist/types/bundle-entry.d.ts.map +1 -0
- package/dist/types/factory/ElementFactory.d.ts +1 -1
- package/dist/types/factory/ElementFactory.d.ts.map +1 -1
- package/dist/types/index.d.ts +14 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/node/CharacterData.d.ts +0 -2
- package/dist/types/node/CharacterData.d.ts.map +1 -1
- package/dist/types/node/ChildNode.d.ts +0 -38
- package/dist/types/node/ChildNode.d.ts.map +1 -1
- package/dist/types/node/ChildNodeBase.d.ts +6 -4
- package/dist/types/node/ChildNodeBase.d.ts.map +1 -1
- package/dist/types/node/Comment.d.ts +1 -1
- package/dist/types/node/Comment.d.ts.map +1 -1
- package/dist/types/node/Document.d.ts +0 -856
- package/dist/types/node/Document.d.ts.map +1 -1
- package/dist/types/node/DocumentBase.d.ts +68 -110
- package/dist/types/node/DocumentBase.d.ts.map +1 -1
- package/dist/types/node/DocumentFragment.d.ts +0 -38
- package/dist/types/node/DocumentFragment.d.ts.map +1 -1
- package/dist/types/node/DocumentFragmentBase.d.ts +1 -8
- package/dist/types/node/DocumentFragmentBase.d.ts.map +1 -1
- package/dist/types/node/Node.d.ts +0 -213
- package/dist/types/node/Node.d.ts.map +1 -1
- package/dist/types/node/NodeBase.d.ts +11 -8
- package/dist/types/node/NodeBase.d.ts.map +1 -1
- package/dist/types/node/NodeFilter.d.ts +25 -0
- package/dist/types/node/NodeFilter.d.ts.map +1 -0
- package/dist/types/node/NodeIterator.d.ts +0 -34
- package/dist/types/node/NodeIterator.d.ts.map +1 -1
- package/dist/types/node/ParentNode.d.ts +0 -84
- package/dist/types/node/ParentNode.d.ts.map +1 -1
- package/dist/types/node/ParentNodeBase.d.ts +0 -5
- package/dist/types/node/ParentNodeBase.d.ts.map +1 -1
- package/dist/types/node/ShadowRootBase.d.ts +36 -0
- package/dist/types/node/ShadowRootBase.d.ts.map +1 -0
- package/dist/types/node/Text.d.ts +0 -24
- package/dist/types/node/Text.d.ts.map +1 -1
- package/dist/types/node/TextBase.d.ts +2 -3
- package/dist/types/node/TextBase.d.ts.map +1 -1
- package/dist/types/node/TreeWalker.d.ts +48 -0
- package/dist/types/node/TreeWalker.d.ts.map +1 -0
- package/dist/types/node/collection/{HTMLCollection.d.ts → HTMLCollectionImp.d.ts} +2 -3
- package/dist/types/node/collection/HTMLCollectionImp.d.ts.map +1 -0
- package/dist/types/node/collection/HTMLCollectionOfImp.d.ts +9 -0
- package/dist/types/node/collection/HTMLCollectionOfImp.d.ts.map +1 -0
- package/dist/types/node/collection/NodeList.d.ts +0 -1
- package/dist/types/node/collection/NodeList.d.ts.map +1 -1
- package/dist/types/node/collection/{NodeListOf.d.ts → NodeListOfImp.d.ts} +3 -4
- package/dist/types/node/collection/NodeListOfImp.d.ts.map +1 -0
- package/dist/types/node/collection/StylePropertyMapImpl.d.ts +20 -0
- package/dist/types/node/collection/StylePropertyMapImpl.d.ts.map +1 -0
- package/dist/types/node/collection/index.d.ts +3 -3
- package/dist/types/node/collection/index.d.ts.map +1 -1
- package/dist/types/node/elements/Element.d.ts +0 -687
- package/dist/types/node/elements/Element.d.ts.map +1 -1
- package/dist/types/node/elements/ElementBase.d.ts +98 -74
- package/dist/types/node/elements/ElementBase.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLAnchorElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLAnchorElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLAreaElement.d.ts +2 -3
- package/dist/types/node/elements/HTMLAreaElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLAudioElement.d.ts +8 -0
- package/dist/types/node/elements/HTMLAudioElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLBaseElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLBaseElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLBodyElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLBodyElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLButtonElement.d.ts +3 -3
- package/dist/types/node/elements/HTMLButtonElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLCanvasElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLCanvasElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLCaptionElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLCaptionElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLDListElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLDListElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLDataElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLDataElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLDataListElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLDataListElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLDetailsElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLDetailsElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLDialogElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLDialogElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLDivElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLDivElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLElement.d.ts +3 -119
- package/dist/types/node/elements/HTMLElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLElementBase.d.ts +126 -5
- package/dist/types/node/elements/HTMLElementBase.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLEmbedElement.d.ts +2 -3
- package/dist/types/node/elements/HTMLEmbedElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLFieldSetElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLFieldSetElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLFormElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLFormElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLH1Element.d.ts +2 -2
- package/dist/types/node/elements/HTMLH1Element.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLHRElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLHRElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLHeadElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLHeadElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLHtmlElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLHtmlElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLIFrameElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLIFrameElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLImgElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLImgElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLInputElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLInputElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLLIElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLLIElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLLabelElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLLabelElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLLegendElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLLegendElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLLinkElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLLinkElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLMapElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLMapElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLMetaElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLMetaElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLMeterElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLMeterElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLModElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLModElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLOListElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLOListElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLObjectElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLObjectElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLOptGroupElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLOptGroupElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLOptionElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLOptionElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLOutputElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLOutputElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLPElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLPElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLParamElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLParamElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLPictureElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLPictureElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLPreElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLPreElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLProgressElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLProgressElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLQuoteElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLQuoteElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLScriptElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLScriptElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLSelectElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLSelectElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLSlotElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLSlotElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLSourceElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLSourceElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLSpanElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLSpanElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLStyleElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLStyleElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLTableElement.d.ts +5 -6
- package/dist/types/node/elements/HTMLTableElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLTbodyElement.d.ts +3 -4
- package/dist/types/node/elements/HTMLTbodyElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLTdElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLTdElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLTemplateElement.d.ts +2 -3
- package/dist/types/node/elements/HTMLTemplateElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLTextAreaElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLTextAreaElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLTfootElement.d.ts +4 -5
- package/dist/types/node/elements/HTMLTfootElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLThElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLThElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLTheadElement.d.ts +4 -5
- package/dist/types/node/elements/HTMLTheadElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLTimeElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLTimeElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLTitleElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLTitleElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLTrElement.d.ts +4 -5
- package/dist/types/node/elements/HTMLTrElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLTrackElement.d.ts +5 -0
- package/dist/types/node/elements/HTMLTrackElement.d.ts.map +1 -0
- package/dist/types/node/elements/HTMLUListElement.d.ts +2 -2
- package/dist/types/node/elements/HTMLUListElement.d.ts.map +1 -1
- package/dist/types/node/elements/HTMLVideoElement.d.ts +8 -0
- package/dist/types/node/elements/HTMLVideoElement.d.ts.map +1 -0
- package/dist/types/node/elements/MathMLElement.d.ts +2 -2
- package/dist/types/node/elements/MathMLElement.d.ts.map +1 -1
- package/dist/types/node/elements/SVGElement.d.ts +2 -2
- package/dist/types/node/elements/SVGElement.d.ts.map +1 -1
- package/dist/types/node/elements/index.d.ts +108 -55
- package/dist/types/node/elements/index.d.ts.map +1 -1
- package/dist/types/node/index.d.ts +4 -7
- package/dist/types/node/index.d.ts.map +1 -1
- package/dist/types/utils/CSSSelector.d.ts +0 -1
- package/dist/types/utils/CSSSelector.d.ts.map +1 -1
- package/dist/types/window/CustomElementRegistryImp.d.ts +19 -0
- package/dist/types/window/CustomElementRegistryImp.d.ts.map +1 -0
- package/dist/types/window/Window.d.ts +0 -619
- package/dist/types/window/Window.d.ts.map +1 -1
- package/dist/types/window/WindowBase.d.ts +253 -286
- package/dist/types/window/WindowBase.d.ts.map +1 -1
- package/dist/types/window/index.d.ts +0 -1
- package/dist/types/window/index.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-dom-parser.umd.js +3482 -3563
- package/dist/umd-bundle/dooboostore-dom-parser.umd.js.map +4 -4
- package/package.json +6 -1
- package/src/DomParser.ts +29 -20
- package/src/bundle-entry.ts +2 -0
- package/src/factory/ElementFactory.ts +87 -54
- package/src/index.ts +22 -10
- package/src/node/CharacterData.ts +0 -2
- package/src/node/ChildNode.ts +42 -42
- package/src/node/ChildNodeBase.ts +60 -39
- package/src/node/Comment.ts +60 -60
- package/src/node/Document.ts +129 -882
- package/src/node/DocumentBase.ts +371 -467
- package/src/node/DocumentFragment.ts +38 -44
- package/src/node/DocumentFragmentBase.ts +4 -9
- package/src/node/Node.ts +231 -224
- package/src/node/NodeBase.ts +469 -443
- package/src/node/NodeFilter.ts +50 -0
- package/src/node/NodeIterator.ts +117 -172
- package/src/node/ParentNode.ts +93 -93
- package/src/node/ParentNodeBase.ts +7 -10
- package/src/node/ShadowRootBase.ts +87 -0
- package/src/node/Text.ts +30 -30
- package/src/node/TextBase.ts +92 -94
- package/src/node/TreeWalker.ts +280 -0
- package/src/node/collection/{HTMLCollection.ts → HTMLCollectionImp.ts} +3 -2
- package/src/node/collection/HTMLCollectionOfImp.ts +12 -0
- package/src/node/collection/NodeList.ts +1 -1
- package/src/node/collection/{NodeListOf.ts → NodeListOfImp.ts} +3 -3
- package/src/node/collection/StylePropertyMapImpl.ts +60 -0
- package/src/node/collection/index.ts +3 -3
- package/src/node/elements/Element.ts +212 -772
- package/src/node/elements/ElementBase.ts +840 -1204
- package/src/node/elements/HTMLAnchorElement.ts +2 -1
- package/src/node/elements/HTMLAreaElement.ts +2 -2
- package/src/node/elements/HTMLAudioElement.ts +11 -0
- package/src/node/elements/HTMLBaseElement.ts +2 -1
- package/src/node/elements/HTMLBodyElement.ts +2 -1
- package/src/node/elements/HTMLButtonElement.ts +65 -64
- package/src/node/elements/HTMLCanvasElement.ts +2 -1
- package/src/node/elements/HTMLCaptionElement.ts +2 -1
- package/src/node/elements/HTMLDListElement.ts +8 -0
- package/src/node/elements/HTMLDataElement.ts +7 -0
- package/src/node/elements/HTMLDataListElement.ts +8 -0
- package/src/node/elements/HTMLDetailsElement.ts +8 -0
- package/src/node/elements/HTMLDialogElement.ts +8 -0
- package/src/node/elements/HTMLDivElement.ts +2 -1
- package/src/node/elements/HTMLElement.ts +6 -137
- package/src/node/elements/HTMLElementBase.ts +472 -355
- package/src/node/elements/HTMLEmbedElement.ts +2 -2
- package/src/node/elements/HTMLFieldSetElement.ts +8 -0
- package/src/node/elements/HTMLFormElement.ts +2 -1
- package/src/node/elements/HTMLH1Element.ts +2 -1
- package/src/node/elements/HTMLHRElement.ts +8 -0
- package/src/node/elements/HTMLHeadElement.ts +2 -1
- package/src/node/elements/HTMLHtmlElement.ts +2 -1
- package/src/node/elements/HTMLIFrameElement.ts +8 -0
- package/src/node/elements/HTMLImgElement.ts +2 -1
- package/src/node/elements/HTMLInputElement.ts +2 -1
- package/src/node/elements/HTMLLIElement.ts +2 -1
- package/src/node/elements/HTMLLabelElement.ts +3 -0
- package/src/node/elements/HTMLLegendElement.ts +3 -0
- package/src/node/elements/HTMLLinkElement.ts +2 -1
- package/src/node/elements/HTMLMapElement.ts +3 -0
- package/src/node/elements/HTMLMetaElement.ts +2 -1
- package/src/node/elements/HTMLMeterElement.ts +3 -0
- package/src/node/elements/HTMLModElement.ts +3 -0
- package/src/node/elements/HTMLOListElement.ts +2 -1
- package/src/node/elements/HTMLObjectElement.ts +3 -0
- package/src/node/elements/HTMLOptGroupElement.ts +3 -0
- package/src/node/elements/HTMLOptionElement.ts +3 -0
- package/src/node/elements/HTMLOutputElement.ts +3 -0
- package/src/node/elements/HTMLPElement.ts +2 -1
- package/src/node/elements/HTMLParamElement.ts +3 -0
- package/src/node/elements/HTMLPictureElement.ts +3 -0
- package/src/node/elements/HTMLPreElement.ts +3 -0
- package/src/node/elements/HTMLProgressElement.ts +3 -0
- package/src/node/elements/HTMLQuoteElement.ts +3 -0
- package/src/node/elements/HTMLScriptElement.ts +2 -1
- package/src/node/elements/HTMLSelectElement.ts +3 -0
- package/src/node/elements/HTMLSlotElement.ts +3 -0
- package/src/node/elements/HTMLSourceElement.ts +3 -0
- package/src/node/elements/HTMLSpanElement.ts +2 -1
- package/src/node/elements/HTMLStyleElement.ts +2 -1
- package/src/node/elements/HTMLTableElement.ts +5 -8
- package/src/node/elements/HTMLTbodyElement.ts +4 -4
- package/src/node/elements/HTMLTdElement.ts +3 -2
- package/src/node/elements/HTMLTemplateElement.ts +5 -7
- package/src/node/elements/HTMLTextAreaElement.ts +3 -0
- package/src/node/elements/HTMLTfootElement.ts +4 -4
- package/src/node/elements/HTMLThElement.ts +2 -1
- package/src/node/elements/HTMLTheadElement.ts +5 -5
- package/src/node/elements/HTMLTimeElement.ts +3 -0
- package/src/node/elements/HTMLTitleElement.ts +2 -1
- package/src/node/elements/HTMLTrElement.ts +7 -5
- package/src/node/elements/HTMLTrackElement.ts +3 -0
- package/src/node/elements/HTMLUListElement.ts +2 -1
- package/src/node/elements/HTMLVideoElement.ts +11 -0
- package/src/node/elements/MathMLElement.ts +2 -1
- package/src/node/elements/SVGElement.ts +2 -1
- package/src/node/elements/index.ts +231 -153
- package/src/node/index.ts +8 -8
- package/src/utils/CSSSelector.ts +0 -1
- package/src/window/CustomElementRegistryImp.ts +138 -0
- package/src/window/Window.ts +716 -715
- package/src/window/WindowBase.ts +482 -847
- package/src/window/index.ts +0 -1
- package/tsconfig.json +1 -0
- package/dist/cjs/node/collection/HTMLCollection.js.map +0 -7
- package/dist/cjs/node/collection/HTMLCollectionOf.js.map +0 -7
- package/dist/cjs/node/collection/NodeListOf.js.map +0 -7
- package/dist/cjs/node/elements/HTMLGenericElement.js.map +0 -7
- package/dist/esm/node/collection/HTMLCollection.js.map +0 -7
- package/dist/esm/node/collection/HTMLCollectionOf.js +0 -17
- package/dist/esm/node/collection/HTMLCollectionOf.js.map +0 -7
- package/dist/esm/node/collection/NodeListOf.js.map +0 -7
- package/dist/esm/node/elements/HTMLGenericElement.js +0 -13
- package/dist/esm/node/elements/HTMLGenericElement.js.map +0 -7
- package/dist/types/node/collection/HTMLCollection.d.ts.map +0 -1
- package/dist/types/node/collection/HTMLCollectionOf.d.ts +0 -14
- package/dist/types/node/collection/HTMLCollectionOf.d.ts.map +0 -1
- package/dist/types/node/collection/NodeListOf.d.ts.map +0 -1
- package/dist/types/node/elements/HTMLGenericElement.d.ts +0 -6
- package/dist/types/node/elements/HTMLGenericElement.d.ts.map +0 -1
- package/src/node/collection/HTMLCollectionOf.ts +0 -26
- package/src/node/elements/HTMLGenericElement.ts +0 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/node/DocumentFragmentBase.ts"],
|
|
4
|
-
"sourcesContent": ["import { ParentNodeBase } from './ParentNodeBase';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;
|
|
4
|
+
"sourcesContent": ["import { ParentNodeBase } from './ParentNodeBase';\nimport {DOCUMENT_FRAGMENT_NODE, ELEMENT_NODE} from './Node';\nimport { NodeBase } from './NodeBase';\nimport { NodeListOfImp } from './collection/NodeListOfImp';\n\n/**\n * The **`DocumentFragmentBase`** class is the concrete implementation of the DocumentFragment interface.\n * \n * DocumentFragment is a minimal document object that has no parent. It is used as a lightweight version of Document\n * that stores a segment of a document structure comprised of nodes just like a standard document.\n */\nexport class DocumentFragmentBase extends ParentNodeBase implements DocumentFragment {\n constructor(ownerDocument?: Document) {\n super(DOCUMENT_FRAGMENT_NODE, '#document-fragment', ownerDocument); // DOCUMENT_FRAGMENT_NODE = 11\n }\n\n /**\n * Returns the number of child elements of this DocumentFragment.\n */\n get childElementCount(): number {\n let count = 0;\n for (const child of this._childNodesInternal) {\n if (child && child.nodeType === ELEMENT_NODE) { // ELEMENT_NODE\n count++;\n }\n }\n return count;\n }\n\n /**\n * Returns the first Element node within the DocumentFragment that matches the specified selectors.\n */\n querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;\n querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;\n querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;\n querySelector<E extends Element = Element>(selectors: string): E | null;\n querySelector(selectors: string): Element | null;\n querySelector(selectors: string): Element | null {\n const elements = this.querySelectorAll(selectors);\n return elements.length > 0 ? elements.item(0) : null;\n }\n\n /**\n * Returns all Element nodes within the DocumentFragment that match the specified selectors.\n */\n querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;\n querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;\n querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;\n querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;\n querySelectorAll(selectors: string): NodeListOf<Element>;\n querySelectorAll(selectors: string): NodeListOf<Element> {\n // Use the inherited querySelectorAll from ParentNodeBase\n return super.querySelectorAll(selectors);\n }\n\n /**\n * Returns the Element within the DocumentFragment that has the specified ID.\n */\n getElementById(elementId: string): HTMLElement | null {\n const element = this.querySelector(`#${elementId}`);\n return element as HTMLElement | null;\n }\n\n /**\n * Override cloneNode to return DocumentFragment\n */\n cloneNode(deep?: boolean): DocumentFragment {\n const clone = new DocumentFragmentBase(this._ownerDocument as Document) as unknown as DocumentFragment;\n \n if (deep) {\n for (const child of this._childNodesInternal) {\n if (child && 'cloneNode' in child) {\n clone.appendChild((child as any).cloneNode(true));\n }\n }\n }\n \n return clone;\n }\n\n /**\n * Override appendChild to handle DocumentFragment behavior\n * When a DocumentFragment is appended to another node, its children are moved, not the fragment itself\n */\n appendChild<T extends Node>(node: T): T {\n // If the node being appended is a DocumentFragment, move its children instead\n if (node.nodeType === DOCUMENT_FRAGMENT_NODE) {\n const fragment = node as any;\n \n // Move all children from fragment to this node\n while (fragment._childNodesInternal && fragment._childNodesInternal.length > 0) {\n const child = fragment._childNodesInternal[0];\n if (child) {\n fragment.removeChild(child);\n super.appendChild(child);\n }\n }\n \n return node;\n }\n \n return super.appendChild(node);\n }\n}"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAC/B,kBAAmD;AAU5C,MAAM,6BAA6B,qCAA2C;AAAA,EACjF,YAAY,eAA0B;AAClC,UAAM,oCAAwB,sBAAsB,aAAa;AAAA,EACrE;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,oBAA4B;AAC5B,QAAI,QAAQ;AACZ,eAAW,SAAS,KAAK,qBAAqB;AAC1C,UAAI,SAAS,MAAM,aAAa,0BAAc;AAC1C;AAAA,MACJ;AAAA,IACJ;AACA,WAAO;AAAA,EACX;AAAA,EAUA,cAAc,WAAmC;AAC7C,UAAM,WAAW,KAAK,iBAAiB,SAAS;AAChD,WAAO,SAAS,SAAS,IAAI,SAAS,KAAK,CAAC,IAAI;AAAA,EACpD;AAAA,EAUA,iBAAiB,WAAwC;AAErD,WAAO,MAAM,iBAAiB,SAAS;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA,EAKA,eAAe,WAAuC;AAClD,UAAM,UAAU,KAAK,cAAc,IAAI,SAAS,EAAE;AAClD,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU,MAAkC;AACxC,UAAM,QAAQ,IAAI,qBAAqB,KAAK,cAA0B;AAEtE,QAAI,MAAM;AACN,iBAAW,SAAS,KAAK,qBAAqB;AAC1C,YAAI,SAAS,eAAe,OAAO;AAC/B,gBAAM,YAAa,MAAc,UAAU,IAAI,CAAC;AAAA,QACpD;AAAA,MACJ;AAAA,IACJ;AAEA,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAA4B,MAAY;AAEpC,QAAI,KAAK,aAAa,oCAAwB;AAC1C,YAAM,WAAW;AAGjB,aAAO,SAAS,uBAAuB,SAAS,oBAAoB,SAAS,GAAG;AAC5E,cAAM,QAAQ,SAAS,oBAAoB,CAAC;AAC5C,YAAI,OAAO;AACP,mBAAS,YAAY,KAAK;AAC1B,gBAAM,YAAY,KAAK;AAAA,QAC3B;AAAA,MACJ;AAEA,aAAO;AAAA,IACX;AAEA,WAAO,MAAM,YAAY,IAAI;AAAA,EACjC;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/node/Node.ts"],
|
|
4
|
-
"sourcesContent": ["import { type NodeListOf } from './collection/NodeListOf';\nimport { NodeList } from './collection/NodeList';\nimport { type ChildNode } from './ChildNode';\nimport { type ParentNode } from './ParentNode';\nimport { type Document } from './Document';\nimport { type HTMLElement } from './elements/HTMLElement';\nimport { type GetRootNodeOptions } from './GetRootNodeOptions';\n// Node \uC0C1\uC218\uB4E4\uC744 \uBCC4\uB3C4\uB85C export\nexport const ELEMENT_NODE = 1 as const;\nexport const ATTRIBUTE_NODE = 2 as const;\nexport const TEXT_NODE = 3 as const;\nexport const CDATA_SECTION_NODE = 4 as const;\nexport const ENTITY_REFERENCE_NODE = 5 as const;\nexport const ENTITY_NODE = 6 as const;\nexport const PROCESSING_INSTRUCTION_NODE = 7 as const;\nexport const COMMENT_NODE = 8 as const;\nexport const DOCUMENT_NODE = 9 as const;\nexport const DOCUMENT_TYPE_NODE = 10 as const;\nexport const DOCUMENT_FRAGMENT_NODE = 11 as const;\nexport const NOTATION_NODE = 12 as const;\nexport const DOCUMENT_POSITION_DISCONNECTED = 0x01 as const;\nexport const DOCUMENT_POSITION_PRECEDING = 0x02 as const;\nexport const DOCUMENT_POSITION_FOLLOWING = 0x04 as const;\nexport const DOCUMENT_POSITION_CONTAINS = 0x08 as const;\nexport const DOCUMENT_POSITION_CONTAINED_BY = 0x10 as const;\nexport const DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20 as const;\n\n// Forward declarations for circular dependencies\n// interface ChildNode extends Node {}\n// interface ParentNode extends Node {}\n// interface Document extends Node {}\n// interface HTMLElement {}\n// interface GetRootNodeOptions {\n// composed?: boolean;\n// }\n\nexport interface Node {\n /** node is an element. */\n readonly ELEMENT_NODE: 1;\n readonly ATTRIBUTE_NODE: 2;\n /** node is a Text node. */\n readonly TEXT_NODE: 3;\n /** node is a CDATASection node. */\n readonly CDATA_SECTION_NODE: 4;\n readonly ENTITY_REFERENCE_NODE: 5;\n readonly ENTITY_NODE: 6;\n /** node is a ProcessingInstruction node. */\n readonly PROCESSING_INSTRUCTION_NODE: 7;\n /** node is a Comment node. */\n readonly COMMENT_NODE: 8;\n /** node is a document. */\n readonly DOCUMENT_NODE: 9;\n /** node is a doctype. */\n readonly DOCUMENT_TYPE_NODE: 10;\n /** node is a DocumentFragment node. */\n readonly DOCUMENT_FRAGMENT_NODE: 11;\n readonly NOTATION_NODE: 12;\n /** Set when node and other are not in the same tree. */\n readonly DOCUMENT_POSITION_DISCONNECTED: 0x01;\n /** Set when other is preceding node. */\n readonly DOCUMENT_POSITION_PRECEDING: 0x02;\n /** Set when other is following node. */\n readonly DOCUMENT_POSITION_FOLLOWING: 0x04;\n /** Set when other is an ancestor of node. */\n readonly DOCUMENT_POSITION_CONTAINS: 0x08;\n /** Set when other is a descendant of node. */\n readonly DOCUMENT_POSITION_CONTAINED_BY: 0x10;\n readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 0x20;\n\n\n /**\n * The read-only **`baseURI`** property of the Node interface returns the absolute base URL of the document containing the node.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/baseURI)\n */\n readonly baseURI: string;\n /**\n * The read-only **`childNodes`** property of the Node interface returns a live the first child node is assigned index `0`.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/childNodes)\n */\n readonly childNodes: NodeListOf<ChildNode>;\n /**\n * The read-only **`firstChild`** property of the Node interface returns the node's first child in the tree, or `null` if the node has no children.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/firstChild)\n */\n readonly firstChild: ChildNode | null;\n /**\n * The read-only **`isConnected`** property of the Node interface returns a boolean indicating whether the node is connected (directly or indirectly) to a Document object.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isConnected)\n */\n readonly isConnected: boolean;\n /**\n * The read-only **`lastChild`** property of the Node interface returns the last child of the node, or `null` if there are no child nodes.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/lastChild)\n */\n readonly lastChild: ChildNode | null;\n /**\n * The read-only **`nextSibling`** property of the Node interface returns the node immediately following the specified one in their parent's Node.childNodes, or returns `null` if the specified node is the last child in the parent element.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nextSibling)\n */\n readonly nextSibling: ChildNode | null;\n /**\n * The read-only **`nodeName`** property of Node returns the name of the current node as a string.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeName)\n */\n readonly nodeName: string;\n /**\n * The read-only **`nodeType`** property of a Node interface is an integer that identifies what the node is.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeType)\n */\n readonly nodeType: number;\n /**\n * The **`nodeValue`** property of the Node interface returns or sets the value of the current node.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeValue)\n */\n nodeValue: string | null;\n /**\n * The read-only **`ownerDocument`** property of the Node interface returns the top-level document object of the node.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/ownerDocument)\n */\n readonly ownerDocument: Document | null;\n /**\n * The read-only **`parentElement`** property of Node interface returns the DOM node's parent Element, or `null` if the node either has no parent, or its parent isn't a DOM Element.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/parentElement)\n */\n readonly parentElement: HTMLElement | null;\n /**\n * The read-only **`parentNode`** property of the Node interface returns the parent of the specified node in the DOM tree.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/parentNode)\n */\n readonly parentNode: ParentNode | null;\n /**\n * The read-only **`previousSibling`** property of the Node interface returns the node immediately preceding the specified one in its parent's or `null` if the specified node is the first in that list.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/previousSibling)\n */\n readonly previousSibling: ChildNode | null;\n /**\n * The **`textContent`** property of the Node interface represents the text content of the node and its descendants.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/textContent)\n */\n textContent: string | null;\n /**\n * The **`appendChild()`** method of the Node interface adds a node to the end of the list of children of a specified parent node.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/appendChild)\n */\n appendChild<T extends Node>(node: T): T;\n /**\n * The **`cloneNode()`** method of the Node interface returns a duplicate of the node on which this method was called.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/cloneNode)\n */\n cloneNode(subtree?: boolean): Node;\n /**\n * The **`compareDocumentPosition()`** method of the Node interface reports the position of its argument node relative to the node on which it is called.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition)\n */\n compareDocumentPosition(other: Node): number;\n /**\n * The **`contains()`** method of the Node interface returns a boolean value indicating whether a node is a descendant of a given node, that is the node itself, one of its direct children (Node.childNodes), one of the children's direct children, and so on.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/contains)\n */\n contains(other: Node | null): boolean;\n /**\n * The **`getRootNode()`** method of the Node interface returns the context object's root, which optionally includes the shadow root if it is available.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/getRootNode)\n */\n getRootNode(options?: GetRootNodeOptions): Node;\n /**\n * The **`hasChildNodes()`** method of the Node interface returns a boolean value indicating whether the given Node has child nodes or not.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes)\n */\n hasChildNodes(): boolean;\n /**\n * The **`insertBefore()`** method of the Node interface inserts a node before a _reference node_ as a child of a specified _parent node_.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/insertBefore)\n */\n insertBefore<T extends Node>(node: T, child: Node | null): T;\n /**\n * The **`isDefaultNamespace()`** method of the Node interface accepts a namespace URI as an argument.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace)\n */\n isDefaultNamespace(namespace: string | null): boolean;\n /**\n * The **`isEqualNode()`** method of the Node interface tests whether two nodes are equal.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode)\n */\n isEqualNode(otherNode: Node | null): boolean;\n /**\n * The **`isSameNode()`** method of the Node interface is a legacy alias the for the `===` strict equality operator.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isSameNode)\n */\n isSameNode(otherNode: Node | null): boolean;\n /**\n * The **`lookupNamespaceURI()`** method of the Node interface takes a prefix as parameter and returns the namespace URI associated with it on the given node if found (and `null` if not).\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI)\n */\n lookupNamespaceURI(prefix: string | null): string | null;\n /**\n * The **`lookupPrefix()`** method of the Node interface returns a string containing the prefix for a given namespace URI, if present, and `null` if not.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix)\n */\n lookupPrefix(namespace: string | null): string | null;\n /**\n * The **`normalize()`** method of the Node interface puts the specified node and all of its sub-tree into a _normalized_ form.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/normalize)\n */\n normalize(): void;\n /**\n * The **`removeChild()`** method of the Node interface removes a child node from the DOM and returns the removed node.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/removeChild)\n */\n removeChild<T extends Node>(child: T): T;\n /**\n * The **`replaceChild()`** method of the Node interface replaces a child node within the given (parent) node.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/replaceChild)\n */\n replaceChild<T extends Node>(node: Node, child: T): T;\n}"],
|
|
4
|
+
"sourcesContent": ["// import { type NodeListOf } from './collection/NodeListOf';\n// import { NodeList } from './collection/NodeList';\n// import { type ChildNode } from './ChildNode';\n// import { type ParentNode } from './ParentNode';\n// import { type Document } from './Document';\n// import { type HTMLElement } from './elements/HTMLElement';\n// import { type GetRootNodeOptions } from './GetRootNodeOptions';\n// Node \uC0C1\uC218\uB4E4\uC744 \uBCC4\uB3C4\uB85C export\nexport const ELEMENT_NODE = 1 as const;\nexport const ATTRIBUTE_NODE = 2 as const;\nexport const TEXT_NODE = 3 as const;\nexport const CDATA_SECTION_NODE = 4 as const;\nexport const ENTITY_REFERENCE_NODE = 5 as const;\nexport const ENTITY_NODE = 6 as const;\nexport const PROCESSING_INSTRUCTION_NODE = 7 as const;\nexport const COMMENT_NODE = 8 as const;\nexport const DOCUMENT_NODE = 9 as const;\nexport const DOCUMENT_TYPE_NODE = 10 as const;\nexport const DOCUMENT_FRAGMENT_NODE = 11 as const;\nexport const NOTATION_NODE = 12 as const;\nexport const DOCUMENT_POSITION_DISCONNECTED = 0x01 as const;\nexport const DOCUMENT_POSITION_PRECEDING = 0x02 as const;\nexport const DOCUMENT_POSITION_FOLLOWING = 0x04 as const;\nexport const DOCUMENT_POSITION_CONTAINS = 0x08 as const;\nexport const DOCUMENT_POSITION_CONTAINED_BY = 0x10 as const;\nexport const DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20 as const;\n\n// export interface Event {\n// readonly type: string;\n// readonly target: any;\n// readonly currentTarget: any;\n// readonly bubbles: boolean;\n// readonly cancelable: boolean;\n// readonly defaultPrevented: boolean;\n// preventDefault(): void;\n// stopPropagation(): void;\n// stopImmediatePropagation(): void;\n// }\n//\n// export interface Node {\n// /** node is an element. */\n// readonly ELEMENT_NODE: 1;\n// readonly ATTRIBUTE_NODE: 2;\n// /** node is a Text node. */\n// readonly TEXT_NODE: 3;\n// /** node is a CDATASection node. */\n// readonly CDATA_SECTION_NODE: 4;\n// readonly ENTITY_REFERENCE_NODE: 5;\n// readonly ENTITY_NODE: 6;\n// /** node is a ProcessingInstruction node. */\n// readonly PROCESSING_INSTRUCTION_NODE: 7;\n// /** node is a Comment node. */\n// readonly COMMENT_NODE: 8;\n// /** node is a document. */\n// readonly DOCUMENT_NODE: 9;\n// /** node is a doctype. */\n// readonly DOCUMENT_TYPE_NODE: 10;\n// /** node is a DocumentFragment node. */\n// readonly DOCUMENT_FRAGMENT_NODE: 11;\n// readonly NOTATION_NODE: 12;\n// /** Set when node and other are not in the same tree. */\n// readonly DOCUMENT_POSITION_DISCONNECTED: 0x01;\n// /** Set when other is preceding node. */\n// readonly DOCUMENT_POSITION_PRECEDING: 0x02;\n// /** Set when other is following node. */\n// readonly DOCUMENT_POSITION_FOLLOWING: 0x04;\n// /** Set when other is an ancestor of node. */\n// readonly DOCUMENT_POSITION_CONTAINS: 0x08;\n// /** Set when other is a descendant of node. */\n// readonly DOCUMENT_POSITION_CONTAINED_BY: 0x10;\n// readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 0x20;\n//\n// /**\n// * The read-only **`baseURI`** property of the Node interface returns the absolute base URL of the document containing the node.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/baseURI)\n// */\n// readonly baseURI: string;\n// /**\n// * The read-only **`childNodes`** property of the Node interface returns a live the first child node is assigned index `0`.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/childNodes)\n// */\n// readonly childNodes: NodeListOf<ChildNode>;\n// /**\n// * The read-only **`firstChild`** property of the Node interface returns the node's first child in the tree, or `null` if the node has no children.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/firstChild)\n// */\n// readonly firstChild: ChildNode | null;\n// /**\n// * The read-only **`isConnected`** property of the Node interface returns a boolean indicating whether the node is connected (directly or indirectly) to a Document object.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isConnected)\n// */\n// readonly isConnected: boolean;\n// /**\n// * The read-only **`lastChild`** property of the Node interface returns the last child of the node, or `null` if there are no child nodes.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/lastChild)\n// */\n// readonly lastChild: ChildNode | null;\n// /**\n// * The read-only **`nextSibling`** property of the Node interface returns the node immediately following the specified one in their parent's Node.childNodes, or returns `null` if the specified node is the last child in the parent element.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nextSibling)\n// */\n// readonly nextSibling: ChildNode | null;\n// /**\n// * The read-only **`nodeName`** property of Node returns the name of the current node as a string.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeName)\n// */\n// readonly nodeName: string;\n// /**\n// * The read-only **`nodeType`** property of a Node interface is an integer that identifies what the node is.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeType)\n// */\n// readonly nodeType: number;\n// /**\n// * The **`nodeValue`** property of the Node interface returns or sets the value of the current node.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeValue)\n// */\n// nodeValue: string | null;\n// /**\n// * The read-only **`ownerDocument`** property of the Node interface returns the top-level document object of the node.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/ownerDocument)\n// */\n// readonly ownerDocument: Document | null;\n// /**\n// * The read-only **`parentElement`** property of Node interface returns the DOM node's parent Element, or `null` if the node either has no parent, or its parent isn't a DOM Element.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/parentElement)\n// */\n// readonly parentElement: HTMLElement | null;\n// /**\n// * The read-only **`parentNode`** property of the Node interface returns the parent of the specified node in the DOM tree.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/parentNode)\n// */\n// readonly parentNode: ParentNode | null;\n// /**\n// * The read-only **`previousSibling`** property of the Node interface returns the node immediately preceding the specified one in its parent's or `null` if the specified node is the first in that list.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/previousSibling)\n// */\n// readonly previousSibling: ChildNode | null;\n// /**\n// * The **`textContent`** property of the Node interface represents the text content of the node and its descendants.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/textContent)\n// */\n// textContent: string | null;\n// /**\n// * The **`appendChild()`** method of the Node interface adds a node to the end of the list of children of a specified parent node.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/appendChild)\n// */\n// appendChild<T extends Node>(node: T): T;\n// /**\n// * The **`cloneNode()`** method of the Node interface returns a duplicate of the node on which this method was called.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/cloneNode)\n// */\n// cloneNode(subtree?: boolean): Node;\n// /**\n// * The **`compareDocumentPosition()`** method of the Node interface reports the position of its argument node relative to the node on which it is called.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition)\n// */\n// compareDocumentPosition(other: Node): number;\n// /**\n// * The **`contains()`** method of the Node interface returns a boolean value indicating whether a node is a descendant of a given node, that is the node itself, one of its direct children (Node.childNodes), one of the children's direct children, and so on.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/contains)\n// */\n// contains(other: Node | null): boolean;\n// /**\n// * The **`getRootNode()`** method of the Node interface returns the context object's root, which optionally includes the shadow root if it is available.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/getRootNode)\n// */\n// getRootNode(options?: GetRootNodeOptions): Node;\n// /**\n// * The **`hasChildNodes()`** method of the Node interface returns a boolean value indicating whether the given Node has child nodes or not.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/hasChildNodes)\n// */\n// hasChildNodes(): boolean;\n// /**\n// * The **`insertBefore()`** method of the Node interface inserts a node before a _reference node_ as a child of a specified _parent node_.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/insertBefore)\n// */\n// insertBefore<T extends Node>(node: T, child: Node | null): T;\n// /**\n// * The **`isDefaultNamespace()`** method of the Node interface accepts a namespace URI as an argument.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isDefaultNamespace)\n// */\n// isDefaultNamespace(namespace: string | null): boolean;\n// /**\n// * The **`isEqualNode()`** method of the Node interface tests whether two nodes are equal.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode)\n// */\n// isEqualNode(otherNode: Node | null): boolean;\n// /**\n// * The **`isSameNode()`** method of the Node interface is a legacy alias the for the `===` strict equality operator.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/isSameNode)\n// */\n// isSameNode(otherNode: Node | null): boolean;\n// /**\n// * The **`lookupNamespaceURI()`** method of the Node interface takes a prefix as parameter and returns the namespace URI associated with it on the given node if found (and `null` if not).\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/lookupNamespaceURI)\n// */\n// lookupNamespaceURI(prefix: string | null): string | null;\n// /**\n// * The **`lookupPrefix()`** method of the Node interface returns a string containing the prefix for a given namespace URI, if present, and `null` if not.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix)\n// */\n// lookupPrefix(namespace: string | null): string | null;\n// /**\n// * The **`normalize()`** method of the Node interface puts the specified node and all of its sub-tree into a _normalized_ form.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/normalize)\n// */\n// normalize(): void;\n// /**\n// * The **`removeChild()`** method of the Node interface removes a child node from the DOM and returns the removed node.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/removeChild)\n// */\n// removeChild<T extends Node>(child: T): T;\n// /**\n// * The **`replaceChild()`** method of the Node interface replaces a child node within the given (parent) node.\n// *\n// * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/replaceChild)\n// */\n// replaceChild<T extends Node>(node: Node, child: T): T;\n//\n// // Add event methods manually to Node interface to avoid conflict with EventTarget\n// addEventListener(type: string, listener: any, options?: any): void;\n// removeEventListener(type: string, listener: any, options?: any): void;\n// dispatchEvent(event: any): boolean;\n// }\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,MAAM,eAAe;AACrB,MAAM,iBAAiB;AACvB,MAAM,YAAY;AAClB,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;AAC9B,MAAM,cAAc;AACpB,MAAM,8BAA8B;AACpC,MAAM,eAAe;AACrB,MAAM,gBAAgB;AACtB,MAAM,qBAAqB;AAC3B,MAAM,yBAAyB;AAC/B,MAAM,gBAAgB;AACtB,MAAM,iCAAiC;AACvC,MAAM,8BAA8B;AACpC,MAAM,8BAA8B;AACpC,MAAM,6BAA6B;AACnC,MAAM,iCAAiC;AACvC,MAAM,4CAA4C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,7 +21,7 @@ __export(NodeBase_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(NodeBase_exports);
|
|
23
23
|
var import_Node = require("./Node");
|
|
24
|
-
var
|
|
24
|
+
var import_NodeListOfImp = require("./collection/NodeListOfImp");
|
|
25
25
|
class NodeBase {
|
|
26
26
|
constructor(nodeType, nodeName, ownerDocument) {
|
|
27
27
|
this.nodeType = nodeType;
|
|
@@ -34,15 +34,46 @@ class NodeBase {
|
|
|
34
34
|
// Made public for ChildNodeBase access
|
|
35
35
|
this._nodeValue = null;
|
|
36
36
|
this._textContent = null;
|
|
37
|
+
this._eventListeners = [];
|
|
37
38
|
this._ownerDocument = ownerDocument || null;
|
|
38
39
|
}
|
|
40
|
+
addEventListener(type, listener, options) {
|
|
41
|
+
this._eventListeners.push({
|
|
42
|
+
type,
|
|
43
|
+
listener: typeof listener === "function" ? listener : listener?.handleEvent,
|
|
44
|
+
options
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
removeEventListener(type, listener, _options) {
|
|
48
|
+
const targetListener = typeof listener === "function" ? listener : listener?.handleEvent;
|
|
49
|
+
this._eventListeners = this._eventListeners.filter((l) => !(l.type === type && l.listener === targetListener));
|
|
50
|
+
}
|
|
51
|
+
dispatchEvent(event) {
|
|
52
|
+
const type = typeof event === "string" ? event : event.type;
|
|
53
|
+
const listeners = this._eventListeners.filter((l) => l.type === type);
|
|
54
|
+
for (const l of listeners) {
|
|
55
|
+
try {
|
|
56
|
+
if (typeof l.listener === "function") {
|
|
57
|
+
l.listener.call(this, event);
|
|
58
|
+
} else if (l.listener && typeof l.listener.handleEvent === "function") {
|
|
59
|
+
l.listener.handleEvent(event);
|
|
60
|
+
}
|
|
61
|
+
if (l.options?.once) {
|
|
62
|
+
this.removeEventListener(type, l.listener, l.options);
|
|
63
|
+
}
|
|
64
|
+
} catch (e) {
|
|
65
|
+
console.error(`Error in event listener for ${type}:`, e);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
39
70
|
// Node interface implementation
|
|
40
71
|
get baseURI() {
|
|
41
72
|
return this._ownerDocument?.URL || "";
|
|
42
73
|
}
|
|
43
74
|
// External interface - returns proper Node interface types
|
|
44
75
|
get childNodes() {
|
|
45
|
-
return new
|
|
76
|
+
return new import_NodeListOfImp.NodeListOfImp(this._childNodesInternal);
|
|
46
77
|
}
|
|
47
78
|
get firstChild() {
|
|
48
79
|
return this._childNodesInternal.length > 0 ? this._childNodesInternal[0] : null;
|
|
@@ -194,6 +225,10 @@ class NodeBase {
|
|
|
194
225
|
this._childNodesInternal.push(nodeBase);
|
|
195
226
|
nodeBase._parentNodeInternal = this;
|
|
196
227
|
nodeBase._ownerDocument = this._ownerDocument;
|
|
228
|
+
if (this.isConnected && nodeBase.connectedCallback) {
|
|
229
|
+
console.log(`[NodeBase] Calling connectedCallback for <${nodeBase.nodeName}>`);
|
|
230
|
+
nodeBase.connectedCallback();
|
|
231
|
+
}
|
|
197
232
|
return node;
|
|
198
233
|
}
|
|
199
234
|
removeChild(child) {
|
|
@@ -202,8 +237,12 @@ class NodeBase {
|
|
|
202
237
|
if (index === -1) {
|
|
203
238
|
throw new Error("Node not found");
|
|
204
239
|
}
|
|
240
|
+
const wasConnected = childBase.isConnected;
|
|
205
241
|
this._childNodesInternal.splice(index, 1);
|
|
206
242
|
childBase._parentNodeInternal = null;
|
|
243
|
+
if (wasConnected && childBase.disconnectedCallback) {
|
|
244
|
+
childBase.disconnectedCallback();
|
|
245
|
+
}
|
|
207
246
|
return child;
|
|
208
247
|
}
|
|
209
248
|
insertBefore(node, child) {
|
|
@@ -235,6 +274,9 @@ class NodeBase {
|
|
|
235
274
|
this._childNodesInternal.splice(index, 0, nodeBase);
|
|
236
275
|
nodeBase._parentNodeInternal = this;
|
|
237
276
|
nodeBase._ownerDocument = this._ownerDocument;
|
|
277
|
+
if (this.isConnected && nodeBase.connectedCallback) {
|
|
278
|
+
nodeBase.connectedCallback();
|
|
279
|
+
}
|
|
238
280
|
return node;
|
|
239
281
|
}
|
|
240
282
|
replaceChild(node, child) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/node/NodeBase.ts"],
|
|
4
|
-
"sourcesContent": ["import { Node,\n ELEMENT_NODE ,\n ATTRIBUTE_NODE ,\n TEXT_NODE ,\n CDATA_SECTION_NODE ,\n ENTITY_REFERENCE_NODE ,\n ENTITY_NODE ,\n PROCESSING_INSTRUCTION_NODE ,\n COMMENT_NODE ,\n DOCUMENT_NODE ,\n DOCUMENT_TYPE_NODE ,\n DOCUMENT_FRAGMENT_NODE ,\n NOTATION_NODE ,\n DOCUMENT_POSITION_DISCONNECTED ,\n DOCUMENT_POSITION_PRECEDING ,\n DOCUMENT_POSITION_FOLLOWING ,\n DOCUMENT_POSITION_CONTAINS ,\n DOCUMENT_POSITION_CONTAINED_BY ,\n DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC\n} from './Node';\nimport { ChildNode } from './ChildNode';\nimport { ParentNode } from './ParentNode';\nimport { NodeListOf } from './collection/NodeListOf';\nimport { GetRootNodeOptions } from './GetRootNodeOptions';\nimport { HTMLElement } from './elements/HTMLElement';\nimport { Document } from './Document';\nimport { Text } from './Text';\n\n/**\n * Base implementation of the Node interface\n */\nexport abstract class NodeBase implements Node {\n // Node constants as instance properties\n static readonly ELEMENT_NODE = ELEMENT_NODE;\n static readonly ATTRIBUTE_NODE = ATTRIBUTE_NODE;\n static readonly TEXT_NODE = TEXT_NODE;\n static readonly CDATA_SECTION_NODE = CDATA_SECTION_NODE;\n static readonly ENTITY_REFERENCE_NODE = ENTITY_REFERENCE_NODE;\n static readonly ENTITY_NODE = ENTITY_NODE;\n static readonly PROCESSING_INSTRUCTION_NODE = PROCESSING_INSTRUCTION_NODE;\n static readonly COMMENT_NODE = COMMENT_NODE;\n static readonly DOCUMENT_NODE = DOCUMENT_NODE;\n static readonly DOCUMENT_TYPE_NODE = DOCUMENT_TYPE_NODE;\n static readonly DOCUMENT_FRAGMENT_NODE = DOCUMENT_FRAGMENT_NODE;\n static readonly NOTATION_NODE = NOTATION_NODE;\n static readonly DOCUMENT_POSITION_DISCONNECTED = DOCUMENT_POSITION_DISCONNECTED;\n static readonly DOCUMENT_POSITION_PRECEDING = DOCUMENT_POSITION_PRECEDING;\n static readonly DOCUMENT_POSITION_FOLLOWING = DOCUMENT_POSITION_FOLLOWING;\n static readonly DOCUMENT_POSITION_CONTAINS = DOCUMENT_POSITION_CONTAINS;\n static readonly DOCUMENT_POSITION_CONTAINED_BY = DOCUMENT_POSITION_CONTAINED_BY;\n static readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;\n\n ELEMENT_NODE: typeof ELEMENT_NODE;\n ATTRIBUTE_NODE: typeof ATTRIBUTE_NODE;\n TEXT_NODE: typeof TEXT_NODE;\n CDATA_SECTION_NODE: typeof CDATA_SECTION_NODE;\n ENTITY_REFERENCE_NODE: typeof ENTITY_REFERENCE_NODE;\n ENTITY_NODE: typeof ENTITY_NODE;\n PROCESSING_INSTRUCTION_NODE: typeof PROCESSING_INSTRUCTION_NODE;\n COMMENT_NODE: typeof COMMENT_NODE;\n DOCUMENT_NODE: typeof DOCUMENT_NODE;\n DOCUMENT_TYPE_NODE: typeof DOCUMENT_TYPE_NODE;\n DOCUMENT_FRAGMENT_NODE: typeof DOCUMENT_FRAGMENT_NODE;\n NOTATION_NODE: typeof NOTATION_NODE;\n DOCUMENT_POSITION_DISCONNECTED: typeof DOCUMENT_POSITION_DISCONNECTED;\n DOCUMENT_POSITION_PRECEDING: typeof DOCUMENT_POSITION_PRECEDING;\n DOCUMENT_POSITION_FOLLOWING: typeof DOCUMENT_POSITION_FOLLOWING;\n DOCUMENT_POSITION_CONTAINS: typeof DOCUMENT_POSITION_CONTAINS;\n DOCUMENT_POSITION_CONTAINED_BY: typeof DOCUMENT_POSITION_CONTAINED_BY;\n DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: typeof DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;\n // Internal properties (for Base class implementations)\n protected _childNodesInternal: NodeBase[] = [];\n public _parentNodeInternal: NodeBase | null = null; // Internal parent reference\n public _ownerDocument: Document | null = null; // Made public for ChildNodeBase access\n protected _nodeValue: string | null = null;\n protected _textContent: string | null = null;\n\n constructor(\n public readonly nodeType: number,\n public readonly nodeName: string,\n ownerDocument?: Document | null\n ) {\n this._ownerDocument = ownerDocument || null;\n }\n\n\n\n // Node interface implementation\n get baseURI(): string {\n return this._ownerDocument?.URL || '';\n }\n\n // External interface - returns proper Node interface types\n get childNodes(): NodeListOf<ChildNode> {\n return new NodeListOf<ChildNode>(this._childNodesInternal as unknown as ChildNode[]);\n }\n\n get firstChild(): ChildNode | null {\n return this._childNodesInternal.length > 0 ? this._childNodesInternal[0] as unknown as ChildNode : null;\n }\n\n get lastChild(): ChildNode | null {\n const length = this._childNodesInternal.length;\n return length > 0 ? this._childNodesInternal[length - 1] as unknown as ChildNode : null;\n }\n\n get nextSibling(): ChildNode | null {\n if (!this._parentNodeInternal) return null;\n const siblings = this._parentNodeInternal._childNodesInternal;\n const index = this._findIndexInParent();\n return index !== -1 && index < siblings.length - 1 ? siblings[index + 1] as unknown as ChildNode : null;\n }\n\n get previousSibling(): ChildNode | null {\n if (!this._parentNodeInternal) return null;\n const siblings = this._parentNodeInternal._childNodesInternal;\n const index = this._findIndexInParent();\n return index > 0 ? siblings[index - 1] as unknown as ChildNode : null;\n }\n\n get parentNode(): ParentNode | null {\n return this._parentNodeInternal as unknown as ParentNode | null;\n }\n\n get parentElement(): HTMLElement | null {\n return this._parentNodeInternal && this._parentNodeInternal.nodeType === ELEMENT_NODE\n ? this._parentNodeInternal as unknown as HTMLElement\n : null;\n }\n\n get ownerDocument(): Document | null {\n return this._ownerDocument;\n }\n\n get isConnected(): boolean {\n let node: Node | null = this;\n while (node) {\n if (node.nodeType === DOCUMENT_NODE) return true;\n node = node.parentNode;\n }\n return false;\n }\n\n get nodeValue(): string | null {\n return this._nodeValue;\n }\n\n set nodeValue(value: string | null) {\n this._nodeValue = value;\n }\n\n get textContent(): string | null {\n if (this.nodeType === TEXT_NODE || this.nodeType === COMMENT_NODE) {\n // For text nodes, decode HTML entities to return original text\n return this._nodeValue ? this.decodeHTMLEntities(this._nodeValue) : this._nodeValue;\n }\n\n // For elements, return the stored original text content if available\n if (this._textContent !== undefined && this._textContent !== null) {\n return this._textContent;\n }\n\n // Fallback: collect from children (for HTML parsed content)\n let text = '';\n for (const child of this._childNodesInternal) {\n const childText = child.textContent;\n if (childText !== null && childText !== undefined) {\n text += childText;\n }\n }\n return text.length > 0 ? text : null;\n }\n\n set textContent(value: string | null) {\n // Convert to string (including null and undefined)\n const stringValue = String(value);\n // Store original text content\n this._textContent = stringValue;\n // Clear all children and add a single text node\n this._childNodesInternal = [];\n if (stringValue) {\n // Create text node implementation with escaped value for innerHTML\n const escapedValue = this.escapeHTMLEntities(stringValue);\n const { TextBase } = require('./TextBase');\n const textNode = new TextBase(escapedValue, this._ownerDocument);\n this._childNodesInternal.push(textNode);\n textNode._parentNodeInternal = this;\n }\n }\n\n /**\n * Escape HTML entities in a string to prevent XSS\n */\n protected escapeHTMLEntities(str: string): string {\n const entityMap: { [key: string]: string } = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n return str.replace(/[&<>\"']/g, (char) => {\n return entityMap[char] || char;\n });\n }\n\n /**\n * Decode HTML entities in a string\n */\n protected decodeHTMLEntities(str: string): string {\n const entityMap: { [key: string]: string } = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n '"': '\"',\n ''': \"'\",\n '©': '\u00A9',\n '®': '\u00AE',\n '™': '\u2122',\n ' ': ' ',\n '…': '\u2026',\n '—': '\u2014',\n '–': '\u2013',\n '‘': '\\u2018',\n '’': '\\u2019',\n '“': '\"',\n '”': '\"'\n };\n\n return str.replace(/&[a-zA-Z0-9#]+;/g, (entity) => {\n // Handle named entities\n if (entityMap[entity]) {\n return entityMap[entity];\n }\n \n // Handle numeric entities like ' "\n if (entity.startsWith('&#') && entity.endsWith(';')) {\n const numStr = entity.slice(2, -1);\n const num = parseInt(numStr, 10);\n if (!isNaN(num)) {\n return String.fromCharCode(num);\n }\n }\n \n // Handle hex entities like '\n if (entity.startsWith('&#x') && entity.endsWith(';')) {\n const hexStr = entity.slice(3, -1);\n const num = parseInt(hexStr, 16);\n if (!isNaN(num)) {\n return String.fromCharCode(num);\n }\n }\n \n // Return original if not recognized\n return entity;\n });\n }\n\n // Node methods - external interface uses Node types, internal uses NodeBase\n appendChild<T extends Node>(node: T): T {\n const nodeBase = node as any as NodeBase; // Internal cast\n\n // Special handling for DocumentFragment\n if (nodeBase.nodeType === DOCUMENT_FRAGMENT_NODE) {\n // When appending a DocumentFragment, move its children instead\n const fragment = nodeBase;\n \n // Move all children from fragment to this node\n while (fragment._childNodesInternal.length > 0) {\n const child = fragment._childNodesInternal[0];\n if (child) {\n fragment.removeChild(child);\n this.appendChild(child);\n }\n }\n \n return node;\n }\n\n if (nodeBase._parentNodeInternal) {\n nodeBase._parentNodeInternal.removeChild(nodeBase);\n }\n\n this._childNodesInternal.push(nodeBase);\n nodeBase._parentNodeInternal = this;\n nodeBase._ownerDocument = this._ownerDocument;\n\n return node;\n }\n\n removeChild<T extends Node>(child: T): T {\n const childBase = child as any as NodeBase; // Internal cast\n const index = this._findChildIndex(childBase);\n if (index === -1) {\n throw new Error('Node not found');\n }\n\n this._childNodesInternal.splice(index, 1);\n childBase._parentNodeInternal = null;\n\n return child;\n }\n\n insertBefore<T extends Node>(node: T, child: Node | null): T {\n if (child === null) {\n return this.appendChild(node);\n }\n\n const nodeBase = node as any as NodeBase; // Internal cast\n const childBase = child as any as NodeBase; // Internal cast\n const index = this._findChildIndex(childBase);\n if (index === -1) {\n throw new Error('Reference node not found');\n }\n\n // Handle DocumentFragment - move all its children\n if (nodeBase.nodeType === DOCUMENT_FRAGMENT_NODE) {\n const fragment = nodeBase as any;\n const children = [...fragment._childNodesInternal]; // Copy array to avoid modification during iteration\n \n let insertIndex = index;\n for (const fragmentChild of children) {\n // Remove from fragment\n fragment.removeChild(fragmentChild);\n // Insert at the current insert position\n this._childNodesInternal.splice(insertIndex, 0, fragmentChild);\n fragmentChild._parentNodeInternal = this;\n fragmentChild._ownerDocument = this._ownerDocument;\n // Increment insert index for next child to maintain order\n insertIndex++;\n }\n \n return node;\n }\n\n if (nodeBase._parentNodeInternal) {\n nodeBase._parentNodeInternal.removeChild(nodeBase);\n }\n\n this._childNodesInternal.splice(index, 0, nodeBase);\n nodeBase._parentNodeInternal = this;\n nodeBase._ownerDocument = this._ownerDocument;\n\n return node;\n }\n\n replaceChild<T extends Node>(node: Node, child: T): T {\n this.insertBefore(node, child);\n this.removeChild(child);\n return child;\n }\n\n cloneNode(deep?: boolean): Node {\n // Basic clone implementation - would need to be overridden by specific node types\n throw new Error('cloneNode must be implemented by subclasses');\n }\n\n hasChildNodes(): boolean {\n return this._childNodesInternal.length > 0;\n }\n\n contains(other: Node | null): boolean {\n if (!other || other === this) return other === this;\n\n let node: Node | null = other;\n while (node) {\n if (node.parentNode === this as unknown as ParentNode) return true;\n node = node.parentNode;\n }\n return false;\n }\n\n compareDocumentPosition(other: Node): number {\n if (this === other) return 0;\n \n const otherBase = other as any as NodeBase;\n \n // Check if nodes are disconnected (not in same tree)\n const thisRoot = this.getRootNode();\n const otherRoot = otherBase.getRootNode();\n if (thisRoot !== otherRoot) {\n return DOCUMENT_POSITION_DISCONNECTED;\n }\n \n // Check containment relationships\n if (this.contains(other)) return DOCUMENT_POSITION_CONTAINED_BY;\n if (other.contains(this)) return DOCUMENT_POSITION_CONTAINS;\n \n // Find document order by traversing up to common ancestor\n const thisAncestors = this._getAncestors();\n const otherAncestors = otherBase._getAncestors();\n \n // Find common ancestor\n let commonAncestor: NodeBase | null = null;\n for (let i = 0; i < thisAncestors.length; i++) {\n if (otherAncestors.includes(thisAncestors[i])) {\n commonAncestor = thisAncestors[i];\n break;\n }\n }\n \n if (!commonAncestor) {\n return DOCUMENT_POSITION_DISCONNECTED;\n }\n \n // Compare positions within common ancestor\n const thisChild = this._getChildInAncestor(commonAncestor);\n const otherChild = otherBase._getChildInAncestor(commonAncestor);\n \n if (thisChild && otherChild && commonAncestor._childNodesInternal) {\n const thisIndex = commonAncestor._childNodesInternal.indexOf(thisChild);\n const otherIndex = commonAncestor._childNodesInternal.indexOf(otherChild);\n \n if (thisIndex < otherIndex) {\n return DOCUMENT_POSITION_FOLLOWING;\n } else if (thisIndex > otherIndex) {\n return DOCUMENT_POSITION_PRECEDING;\n }\n }\n \n return DOCUMENT_POSITION_DISCONNECTED;\n }\n\n getRootNode(options?: GetRootNodeOptions): Node {\n let root: Node = this;\n while (root.parentNode) {\n root = root.parentNode;\n }\n return root;\n }\n\n isEqualNode(otherNode: Node | null): boolean {\n if (!otherNode) return false;\n if (this === otherNode) return true;\n if (this.nodeType !== otherNode.nodeType) return false;\n if (this.nodeName !== otherNode.nodeName) return false;\n return true; // Simplified comparison\n }\n\n isSameNode(otherNode: Node | null): boolean {\n return this === otherNode;\n }\n\n isDefaultNamespace(namespace: string | null): boolean {\n // Simplified implementation\n return namespace === null || namespace === 'http://www.w3.org/1999/xhtml';\n }\n\n lookupNamespaceURI(prefix: string | null): string | null {\n // Simplified implementation\n if (prefix === null || prefix === '') {\n return 'http://www.w3.org/1999/xhtml';\n }\n return null;\n }\n\n lookupPrefix(namespace: string | null): string | null {\n // Simplified implementation\n return null;\n }\n\n normalize(): void {\n // Merge adjacent text nodes\n for (let i = this._childNodesInternal.length - 1; i >= 0; i--) {\n const child = this._childNodesInternal[i];\n if (child && child.nodeType === TEXT_NODE) {\n const nextSibling = child.nextSibling;\n if (nextSibling && nextSibling.nodeType === TEXT_NODE) {\n child.nodeValue = (child.nodeValue || '') + (nextSibling.nodeValue || '');\n this.removeChild(nextSibling);\n }\n }\n }\n }\n\n // Helper methods\n private _findIndexInParent(): number {\n if (!this._parentNodeInternal) return -1;\n return this._parentNodeInternal._childNodesInternal.indexOf(this);\n }\n\n private _findChildIndex(child: NodeBase): number {\n return this._childNodesInternal.indexOf(child);\n }\n\n private _getAncestors(): NodeBase[] {\n const ancestors: NodeBase[] = [];\n let current: NodeBase | null = this._parentNodeInternal;\n while (current) {\n ancestors.push(current);\n current = current._parentNodeInternal;\n }\n return ancestors;\n }\n\n private _getChildInAncestor(ancestor: NodeBase): NodeBase | null {\n let current: NodeBase = this;\n while (current._parentNodeInternal && current._parentNodeInternal !== ancestor) {\n current = current._parentNodeInternal;\n }\n return current._parentNodeInternal === ancestor ? current : null;\n }\n}"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import { ELEMENT_NODE, ATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, ENTITY_REFERENCE_NODE, ENTITY_NODE, PROCESSING_INSTRUCTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, DOCUMENT_FRAGMENT_NODE, NOTATION_NODE, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_PRECEDING, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC } from './Node';\nimport { NodeListOfImp } from './collection/NodeListOfImp';\nimport { GetRootNodeOptions } from './GetRootNodeOptions';\n\n/**\n * Base implementation of the Node interface\n */\nexport abstract class NodeBase implements Node {\n // Node constants as instance properties\n static readonly ELEMENT_NODE = ELEMENT_NODE;\n static readonly ATTRIBUTE_NODE = ATTRIBUTE_NODE;\n static readonly TEXT_NODE = TEXT_NODE;\n static readonly CDATA_SECTION_NODE = CDATA_SECTION_NODE;\n static readonly ENTITY_REFERENCE_NODE = ENTITY_REFERENCE_NODE;\n static readonly ENTITY_NODE = ENTITY_NODE;\n static readonly PROCESSING_INSTRUCTION_NODE = PROCESSING_INSTRUCTION_NODE;\n static readonly COMMENT_NODE = COMMENT_NODE;\n static readonly DOCUMENT_NODE = DOCUMENT_NODE;\n static readonly DOCUMENT_TYPE_NODE = DOCUMENT_TYPE_NODE;\n static readonly DOCUMENT_FRAGMENT_NODE = DOCUMENT_FRAGMENT_NODE;\n static readonly NOTATION_NODE = NOTATION_NODE;\n static readonly DOCUMENT_POSITION_DISCONNECTED = DOCUMENT_POSITION_DISCONNECTED;\n static readonly DOCUMENT_POSITION_PRECEDING = DOCUMENT_POSITION_PRECEDING;\n static readonly DOCUMENT_POSITION_FOLLOWING = DOCUMENT_POSITION_FOLLOWING;\n static readonly DOCUMENT_POSITION_CONTAINS = DOCUMENT_POSITION_CONTAINS;\n static readonly DOCUMENT_POSITION_CONTAINED_BY = DOCUMENT_POSITION_CONTAINED_BY;\n static readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;\n\n ELEMENT_NODE: typeof ELEMENT_NODE;\n ATTRIBUTE_NODE: typeof ATTRIBUTE_NODE;\n TEXT_NODE: typeof TEXT_NODE;\n CDATA_SECTION_NODE: typeof CDATA_SECTION_NODE;\n ENTITY_REFERENCE_NODE: typeof ENTITY_REFERENCE_NODE;\n ENTITY_NODE: typeof ENTITY_NODE;\n PROCESSING_INSTRUCTION_NODE: typeof PROCESSING_INSTRUCTION_NODE;\n COMMENT_NODE: typeof COMMENT_NODE;\n DOCUMENT_NODE: typeof DOCUMENT_NODE;\n DOCUMENT_TYPE_NODE: typeof DOCUMENT_TYPE_NODE;\n DOCUMENT_FRAGMENT_NODE: typeof DOCUMENT_FRAGMENT_NODE;\n NOTATION_NODE: typeof NOTATION_NODE;\n DOCUMENT_POSITION_DISCONNECTED: typeof DOCUMENT_POSITION_DISCONNECTED;\n DOCUMENT_POSITION_PRECEDING: typeof DOCUMENT_POSITION_PRECEDING;\n DOCUMENT_POSITION_FOLLOWING: typeof DOCUMENT_POSITION_FOLLOWING;\n DOCUMENT_POSITION_CONTAINS: typeof DOCUMENT_POSITION_CONTAINS;\n DOCUMENT_POSITION_CONTAINED_BY: typeof DOCUMENT_POSITION_CONTAINED_BY;\n DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: typeof DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;\n // Internal properties (for Base class implementations)\n protected _childNodesInternal: NodeBase[] = [];\n public _parentNodeInternal: NodeBase | null = null; // Internal parent reference\n public _ownerDocument: Document | null = null; // Made public for ChildNodeBase access\n protected _nodeValue: string | null = null;\n protected _textContent: string | null = null;\n protected _eventListeners: Array<{ type: string; listener: any; options?: any }> = [];\n\n constructor(\n public nodeType: number,\n public nodeName: string,\n ownerDocument?: Document | null\n ) {\n this._ownerDocument = ownerDocument || null;\n }\n\n addEventListener(type: string, listener: any, options?: any): void {\n this._eventListeners.push({\n type,\n listener: typeof listener === 'function' ? listener : listener?.handleEvent,\n options\n });\n }\n\n removeEventListener(type: string, listener: any, _options?: any): void {\n const targetListener = typeof listener === 'function' ? listener : listener?.handleEvent;\n this._eventListeners = this._eventListeners.filter(l => !(l.type === type && l.listener === targetListener));\n }\n\n dispatchEvent(event: any): boolean {\n // Simple implementation: only trigger listeners on this node (no bubbling for now)\n const type = typeof event === 'string' ? event : event.type;\n const listeners = this._eventListeners.filter(l => l.type === type);\n for (const l of listeners) {\n try {\n if (typeof l.listener === 'function') {\n l.listener.call(this, event);\n } else if (l.listener && typeof l.listener.handleEvent === 'function') {\n l.listener.handleEvent(event);\n }\n\n if (l.options?.once) {\n this.removeEventListener(type, l.listener, l.options);\n }\n } catch (e) {\n console.error(`Error in event listener for ${type}:`, e);\n }\n }\n return true;\n }\n\n // Node interface implementation\n get baseURI(): string {\n return this._ownerDocument?.URL || '';\n }\n\n // External interface - returns proper Node interface types\n get childNodes(): NodeListOf<ChildNode> {\n return new NodeListOfImp<ChildNode>(this._childNodesInternal as unknown as ChildNode[]) as unknown as NodeListOf<ChildNode>;\n }\n\n get firstChild(): ChildNode | null {\n return this._childNodesInternal.length > 0 ? (this._childNodesInternal[0] as unknown as ChildNode) : null;\n }\n\n get lastChild(): ChildNode | null {\n const length = this._childNodesInternal.length;\n return length > 0 ? (this._childNodesInternal[length - 1] as unknown as ChildNode) : null;\n }\n\n get nextSibling(): ChildNode | null {\n if (!this._parentNodeInternal) return null;\n const siblings = this._parentNodeInternal._childNodesInternal;\n const index = this._findIndexInParent();\n return index !== -1 && index < siblings.length - 1 ? (siblings[index + 1] as unknown as ChildNode) : null;\n }\n\n get previousSibling(): ChildNode | null {\n if (!this._parentNodeInternal) return null;\n const siblings = this._parentNodeInternal._childNodesInternal;\n const index = this._findIndexInParent();\n return index > 0 ? (siblings[index - 1] as unknown as ChildNode) : null;\n }\n\n get parentNode(): ParentNode | null {\n return this._parentNodeInternal as unknown as ParentNode | null;\n }\n\n get parentElement(): HTMLElement | null {\n return this._parentNodeInternal && this._parentNodeInternal.nodeType === ELEMENT_NODE ? (this._parentNodeInternal as unknown as HTMLElement) : null;\n }\n\n get ownerDocument(): Document | null {\n return this._ownerDocument;\n }\n\n get isConnected(): boolean {\n let node: Node | null = this;\n while (node) {\n if (node.nodeType === DOCUMENT_NODE) return true;\n node = node.parentNode;\n }\n return false;\n }\n\n get nodeValue(): string | null {\n return this._nodeValue;\n }\n\n set nodeValue(value: string | null) {\n this._nodeValue = value;\n }\n\n get textContent(): string | null {\n if (this.nodeType === TEXT_NODE || this.nodeType === COMMENT_NODE) {\n // For text nodes, decode HTML entities to return original text\n return this._nodeValue ? this.decodeHTMLEntities(this._nodeValue) : this._nodeValue;\n }\n\n // For elements, return the stored original text content if available\n if (this._textContent !== undefined && this._textContent !== null) {\n return this._textContent;\n }\n\n // Fallback: collect from children (for HTML parsed content)\n let text = '';\n for (const child of this._childNodesInternal) {\n const childText = child.textContent;\n if (childText !== null && childText !== undefined) {\n text += childText;\n }\n }\n return text.length > 0 ? text : null;\n }\n\n set textContent(value: string | null) {\n // Convert to string (including null and undefined)\n const stringValue = String(value);\n // Store original text content\n this._textContent = stringValue;\n // Clear all children and add a single text node\n this._childNodesInternal = [];\n if (stringValue) {\n // Create text node implementation with escaped value for innerHTML\n const escapedValue = this.escapeHTMLEntities(stringValue);\n const { TextBase } = require('./TextBase');\n const textNode = new TextBase(escapedValue, this._ownerDocument);\n this._childNodesInternal.push(textNode);\n textNode._parentNodeInternal = this;\n }\n }\n\n /**\n * Escape HTML entities in a string to prevent XSS\n */\n protected escapeHTMLEntities(str: string): string {\n const entityMap: { [key: string]: string } = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n return str.replace(/[&<>\"']/g, char => {\n return entityMap[char] || char;\n });\n }\n\n /**\n * Decode HTML entities in a string\n */\n protected decodeHTMLEntities(str: string): string {\n const entityMap: { [key: string]: string } = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n '"': '\"',\n ''': \"'\",\n '©': '\u00A9',\n '®': '\u00AE',\n '™': '\u2122',\n ' ': ' ',\n '…': '\u2026',\n '—': '\u2014',\n '–': '\u2013',\n '‘': '\\u2018',\n '’': '\\u2019',\n '“': '\"',\n '”': '\"'\n };\n\n return str.replace(/&[a-zA-Z0-9#]+;/g, entity => {\n // Handle named entities\n if (entityMap[entity]) {\n return entityMap[entity];\n }\n\n // Handle numeric entities like ' "\n if (entity.startsWith('&#') && entity.endsWith(';')) {\n const numStr = entity.slice(2, -1);\n const num = parseInt(numStr, 10);\n if (!isNaN(num)) {\n return String.fromCharCode(num);\n }\n }\n\n // Handle hex entities like '\n if (entity.startsWith('&#x') && entity.endsWith(';')) {\n const hexStr = entity.slice(3, -1);\n const num = parseInt(hexStr, 16);\n if (!isNaN(num)) {\n return String.fromCharCode(num);\n }\n }\n\n // Return original if not recognized\n return entity;\n });\n }\n\n // Node methods - external interface uses Node types, internal uses NodeBase\n appendChild<T extends Node>(node: T): T {\n const nodeBase = node as any as NodeBase; // Internal cast\n\n // Special handling for DocumentFragment\n if (nodeBase.nodeType === DOCUMENT_FRAGMENT_NODE) {\n // When appending a DocumentFragment, move its children instead\n const fragment = nodeBase;\n\n // Move all children from fragment to this node\n while (fragment._childNodesInternal.length > 0) {\n const child = fragment._childNodesInternal[0];\n if (child) {\n fragment.removeChild(child);\n this.appendChild(child);\n }\n }\n\n return node;\n }\n\n if (nodeBase._parentNodeInternal) {\n nodeBase._parentNodeInternal.removeChild(nodeBase);\n }\n\n this._childNodesInternal.push(nodeBase);\n nodeBase._parentNodeInternal = this;\n nodeBase._ownerDocument = this._ownerDocument;\n\n // Trigger connectedCallback if it's a custom element and connected to document\n if (this.isConnected && (nodeBase as any).connectedCallback) {\n console.log(`[NodeBase] Calling connectedCallback for <${nodeBase.nodeName}>`);\n (nodeBase as any).connectedCallback();\n }\n\n return node;\n }\n\n removeChild<T extends Node>(child: T): T {\n const childBase = child as any as NodeBase; // Internal cast\n const index = this._findChildIndex(childBase);\n if (index === -1) {\n throw new Error('Node not found');\n }\n\n const wasConnected = childBase.isConnected;\n\n this._childNodesInternal.splice(index, 1);\n childBase._parentNodeInternal = null;\n\n // Trigger disconnectedCallback if it was connected\n if (wasConnected && (childBase as any).disconnectedCallback) {\n (childBase as any).disconnectedCallback();\n }\n\n return child;\n }\n\n insertBefore<T extends Node>(node: T, child: Node | null): T {\n if (child === null) {\n return this.appendChild(node);\n }\n\n const nodeBase = node as any as NodeBase; // Internal cast\n const childBase = child as any as NodeBase; // Internal cast\n const index = this._findChildIndex(childBase);\n if (index === -1) {\n throw new Error('Reference node not found');\n }\n\n // Handle DocumentFragment - move all its children\n if (nodeBase.nodeType === DOCUMENT_FRAGMENT_NODE) {\n const fragment = nodeBase as any;\n const children = [...fragment._childNodesInternal]; // Copy array to avoid modification during iteration\n\n let insertIndex = index;\n for (const fragmentChild of children) {\n // Remove from fragment\n fragment.removeChild(fragmentChild);\n // Insert at the current insert position\n this._childNodesInternal.splice(insertIndex, 0, fragmentChild);\n fragmentChild._parentNodeInternal = this;\n fragmentChild._ownerDocument = this._ownerDocument;\n // Increment insert index for next child to maintain order\n insertIndex++;\n }\n\n return node;\n }\n\n if (nodeBase._parentNodeInternal) {\n nodeBase._parentNodeInternal.removeChild(nodeBase);\n }\n\n this._childNodesInternal.splice(index, 0, nodeBase);\n nodeBase._parentNodeInternal = this;\n nodeBase._ownerDocument = this._ownerDocument;\n\n // Trigger connectedCallback if it's a custom element and connected to document\n if (this.isConnected && (nodeBase as any).connectedCallback) {\n (nodeBase as any).connectedCallback();\n }\n\n return node;\n }\n\n replaceChild<T extends Node>(node: Node, child: T): T {\n this.insertBefore(node, child);\n this.removeChild(child);\n return child;\n }\n\n cloneNode(deep?: boolean): Node {\n // Basic clone implementation - would need to be overridden by specific node types\n throw new Error('cloneNode must be implemented by subclasses');\n }\n\n hasChildNodes(): boolean {\n return this._childNodesInternal.length > 0;\n }\n\n contains(other: Node | null): boolean {\n if (!other || other === this) return other === this;\n\n let node: Node | null = other;\n while (node) {\n if (node.parentNode === (this as unknown as ParentNode)) return true;\n node = node.parentNode;\n }\n return false;\n }\n\n compareDocumentPosition(other: Node): number {\n if (this === other) return 0;\n\n const otherBase = other as any as NodeBase;\n\n // Check if nodes are disconnected (not in same tree)\n const thisRoot = this.getRootNode();\n const otherRoot = otherBase.getRootNode();\n if (thisRoot !== otherRoot) {\n return DOCUMENT_POSITION_DISCONNECTED;\n }\n\n // Check containment relationships\n if (this.contains(other)) return DOCUMENT_POSITION_CONTAINED_BY;\n if (other.contains(this)) return DOCUMENT_POSITION_CONTAINS;\n\n // Find document order by traversing up to common ancestor\n const thisAncestors = this._getAncestors();\n const otherAncestors = otherBase._getAncestors();\n\n // Find common ancestor\n let commonAncestor: NodeBase | null = null;\n for (let i = 0; i < thisAncestors.length; i++) {\n if (otherAncestors.includes(thisAncestors[i])) {\n commonAncestor = thisAncestors[i];\n break;\n }\n }\n\n if (!commonAncestor) {\n return DOCUMENT_POSITION_DISCONNECTED;\n }\n\n // Compare positions within common ancestor\n const thisChild = this._getChildInAncestor(commonAncestor);\n const otherChild = otherBase._getChildInAncestor(commonAncestor);\n\n if (thisChild && otherChild && commonAncestor._childNodesInternal) {\n const thisIndex = commonAncestor._childNodesInternal.indexOf(thisChild);\n const otherIndex = commonAncestor._childNodesInternal.indexOf(otherChild);\n\n if (thisIndex < otherIndex) {\n return DOCUMENT_POSITION_FOLLOWING;\n } else if (thisIndex > otherIndex) {\n return DOCUMENT_POSITION_PRECEDING;\n }\n }\n\n return DOCUMENT_POSITION_DISCONNECTED;\n }\n\n getRootNode(options?: GetRootNodeOptions): Node {\n let root: Node = this;\n while (root.parentNode) {\n root = root.parentNode;\n }\n return root;\n }\n\n isEqualNode(otherNode: Node | null): boolean {\n if (!otherNode) return false;\n if (this === otherNode) return true;\n if (this.nodeType !== otherNode.nodeType) return false;\n if (this.nodeName !== otherNode.nodeName) return false;\n return true; // Simplified comparison\n }\n\n isSameNode(otherNode: Node | null): boolean {\n return this === otherNode;\n }\n\n isDefaultNamespace(namespace: string | null): boolean {\n // Simplified implementation\n return namespace === null || namespace === 'http://www.w3.org/1999/xhtml';\n }\n\n lookupNamespaceURI(prefix: string | null): string | null {\n // Simplified implementation\n if (prefix === null || prefix === '') {\n return 'http://www.w3.org/1999/xhtml';\n }\n return null;\n }\n\n lookupPrefix(namespace: string | null): string | null {\n // Simplified implementation\n return null;\n }\n\n normalize(): void {\n // Merge adjacent text nodes\n for (let i = this._childNodesInternal.length - 1; i >= 0; i--) {\n const child = this._childNodesInternal[i];\n if (child && child.nodeType === TEXT_NODE) {\n const nextSibling = child.nextSibling;\n if (nextSibling && nextSibling.nodeType === TEXT_NODE) {\n child.nodeValue = (child.nodeValue || '') + (nextSibling.nodeValue || '');\n this.removeChild(nextSibling);\n }\n }\n }\n }\n\n // Helper methods\n private _findIndexInParent(): number {\n if (!this._parentNodeInternal) return -1;\n return this._parentNodeInternal._childNodesInternal.indexOf(this);\n }\n\n private _findChildIndex(child: NodeBase): number {\n return this._childNodesInternal.indexOf(child);\n }\n\n private _getAncestors(): NodeBase[] {\n const ancestors: NodeBase[] = [];\n let current: NodeBase | null = this._parentNodeInternal;\n while (current) {\n ancestors.push(current);\n current = current._parentNodeInternal;\n }\n return ancestors;\n }\n\n private _getChildInAncestor(ancestor: NodeBase): NodeBase | null {\n let current: NodeBase = this;\n while (current._parentNodeInternal && current._parentNodeInternal !== ancestor) {\n current = current._parentNodeInternal;\n }\n return current._parentNodeInternal === ancestor ? current : null;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAua;AACva,2BAA8B;AAMvB,MAAe,SAAyB;AAAA,EA+C7C,YACS,UACA,UACP,eACA;AAHO;AACA;AATT;AAAA,SAAU,sBAAkC,CAAC;AAC7C,SAAO,sBAAuC;AAC9C;AAAA,SAAO,iBAAkC;AACzC;AAAA,SAAU,aAA4B;AACtC,SAAU,eAA8B;AACxC,SAAU,kBAAyE,CAAC;AAOlF,SAAK,iBAAiB,iBAAiB;AAAA,EACzC;AAAA,EAEA,iBAAiB,MAAc,UAAe,SAAqB;AACjE,SAAK,gBAAgB,KAAK;AAAA,MACxB;AAAA,MACA,UAAU,OAAO,aAAa,aAAa,WAAW,UAAU;AAAA,MAChE;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,oBAAoB,MAAc,UAAe,UAAsB;AACrE,UAAM,iBAAiB,OAAO,aAAa,aAAa,WAAW,UAAU;AAC7E,SAAK,kBAAkB,KAAK,gBAAgB,OAAO,OAAK,EAAE,EAAE,SAAS,QAAQ,EAAE,aAAa,eAAe;AAAA,EAC7G;AAAA,EAEA,cAAc,OAAqB;AAEjC,UAAM,OAAO,OAAO,UAAU,WAAW,QAAQ,MAAM;AACvD,UAAM,YAAY,KAAK,gBAAgB,OAAO,OAAK,EAAE,SAAS,IAAI;AAClE,eAAW,KAAK,WAAW;AACzB,UAAI;AACF,YAAI,OAAO,EAAE,aAAa,YAAY;AACpC,YAAE,SAAS,KAAK,MAAM,KAAK;AAAA,QAC7B,WAAW,EAAE,YAAY,OAA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
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var NodeFilter_exports = {};
|
|
19
|
+
__export(NodeFilter_exports, {
|
|
20
|
+
NodeFilter: () => NodeFilter
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(NodeFilter_exports);
|
|
23
|
+
const NodeFilter = {
|
|
24
|
+
// Constants for acceptNode return values
|
|
25
|
+
FILTER_ACCEPT: 1,
|
|
26
|
+
FILTER_REJECT: 2,
|
|
27
|
+
FILTER_SKIP: 3,
|
|
28
|
+
// Constants for whatToShow
|
|
29
|
+
SHOW_ALL: 4294967295,
|
|
30
|
+
SHOW_ELEMENT: 1,
|
|
31
|
+
SHOW_ATTRIBUTE: 2,
|
|
32
|
+
SHOW_TEXT: 4,
|
|
33
|
+
SHOW_CDATA_SECTION: 8,
|
|
34
|
+
SHOW_ENTITY_REFERENCE: 16,
|
|
35
|
+
SHOW_ENTITY: 32,
|
|
36
|
+
SHOW_PROCESSING_INSTRUCTION: 64,
|
|
37
|
+
SHOW_COMMENT: 128,
|
|
38
|
+
SHOW_DOCUMENT: 256,
|
|
39
|
+
SHOW_DOCUMENT_TYPE: 512,
|
|
40
|
+
SHOW_DOCUMENT_FRAGMENT: 1024,
|
|
41
|
+
SHOW_NOTATION: 2048
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=NodeFilter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/node/NodeFilter.ts"],
|
|
4
|
+
"sourcesContent": ["// import { Node } from './Node';\n\n/**\n * NodeFilter interface for filtering nodes in NodeIterator and TreeWalker\n */\n// export interface NodeFilter {\n// acceptNode(node: Node): number;\n// }\n\n/**\n * NodeFilter constants and static methods\n */\nexport const NodeFilter: {\n readonly FILTER_ACCEPT: number;\n readonly FILTER_REJECT: number;\n readonly FILTER_SKIP: number;\n readonly SHOW_ALL: number;\n readonly SHOW_ELEMENT: number;\n readonly SHOW_ATTRIBUTE: number;\n readonly SHOW_TEXT: number;\n readonly SHOW_CDATA_SECTION: number;\n readonly SHOW_ENTITY_REFERENCE: number;\n readonly SHOW_ENTITY: number;\n readonly SHOW_PROCESSING_INSTRUCTION: number;\n readonly SHOW_COMMENT: number;\n readonly SHOW_DOCUMENT: number;\n readonly SHOW_DOCUMENT_TYPE: number;\n readonly SHOW_DOCUMENT_FRAGMENT: number;\n readonly SHOW_NOTATION: number;\n} = {\n // Constants for acceptNode return values\n FILTER_ACCEPT: 1,\n FILTER_REJECT: 2,\n FILTER_SKIP: 3,\n\n // Constants for whatToShow\n SHOW_ALL: 0xffffffff,\n SHOW_ELEMENT: 0x1,\n SHOW_ATTRIBUTE: 0x2,\n SHOW_TEXT: 0x4,\n SHOW_CDATA_SECTION: 0x8,\n SHOW_ENTITY_REFERENCE: 0x10,\n SHOW_ENTITY: 0x20,\n SHOW_PROCESSING_INSTRUCTION: 0x40,\n SHOW_COMMENT: 0x80,\n SHOW_DOCUMENT: 0x100,\n SHOW_DOCUMENT_TYPE: 0x200,\n SHOW_DOCUMENT_FRAGMENT: 0x400,\n SHOW_NOTATION: 0x800\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,MAAM,aAiBT;AAAA;AAAA,EAEF,eAAe;AAAA,EACf,eAAe;AAAA,EACf,aAAa;AAAA;AAAA,EAGb,UAAU;AAAA,EACV,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,aAAa;AAAA,EACb,6BAA6B;AAAA,EAC7B,cAAc;AAAA,EACd,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,eAAe;AACjB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -17,30 +17,9 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
var NodeIterator_exports = {};
|
|
19
19
|
__export(NodeIterator_exports, {
|
|
20
|
-
NodeFilter: () => NodeFilter,
|
|
21
20
|
NodeIterator: () => NodeIterator
|
|
22
21
|
});
|
|
23
22
|
module.exports = __toCommonJS(NodeIterator_exports);
|
|
24
|
-
const NodeFilter = {
|
|
25
|
-
// Constants for acceptNode return values
|
|
26
|
-
FILTER_ACCEPT: 1,
|
|
27
|
-
FILTER_REJECT: 2,
|
|
28
|
-
FILTER_SKIP: 3,
|
|
29
|
-
// Constants for whatToShow
|
|
30
|
-
SHOW_ALL: 4294967295,
|
|
31
|
-
SHOW_ELEMENT: 1,
|
|
32
|
-
SHOW_ATTRIBUTE: 2,
|
|
33
|
-
SHOW_TEXT: 4,
|
|
34
|
-
SHOW_CDATA_SECTION: 8,
|
|
35
|
-
SHOW_ENTITY_REFERENCE: 16,
|
|
36
|
-
SHOW_ENTITY: 32,
|
|
37
|
-
SHOW_PROCESSING_INSTRUCTION: 64,
|
|
38
|
-
SHOW_COMMENT: 128,
|
|
39
|
-
SHOW_DOCUMENT: 256,
|
|
40
|
-
SHOW_DOCUMENT_TYPE: 512,
|
|
41
|
-
SHOW_DOCUMENT_FRAGMENT: 1024,
|
|
42
|
-
SHOW_NOTATION: 2048
|
|
43
|
-
};
|
|
44
23
|
class NodeIterator {
|
|
45
24
|
constructor(root, whatToShow = NodeFilter.SHOW_ALL, filter = null) {
|
|
46
25
|
this._beforeReferenceNode = true;
|
|
@@ -137,14 +116,8 @@ class NodeIterator {
|
|
|
137
116
|
}
|
|
138
117
|
return null;
|
|
139
118
|
}
|
|
140
|
-
/**
|
|
141
|
-
* Detach the iterator (no-op in this implementation)
|
|
142
|
-
*/
|
|
143
119
|
detach() {
|
|
144
120
|
}
|
|
145
|
-
/**
|
|
146
|
-
* Check if a node should be accepted based on whatToShow and filter
|
|
147
|
-
*/
|
|
148
121
|
_acceptNode(node) {
|
|
149
122
|
if (!node) {
|
|
150
123
|
return false;
|
|
@@ -154,7 +127,7 @@ class NodeIterator {
|
|
|
154
127
|
return false;
|
|
155
128
|
}
|
|
156
129
|
if (this._filter) {
|
|
157
|
-
const result = this._filter.acceptNode(node);
|
|
130
|
+
const result = "acceptNode" in this._filter ? this._filter.acceptNode(node) : this._filter(node);
|
|
158
131
|
return result === NodeFilter.FILTER_ACCEPT;
|
|
159
132
|
}
|
|
160
133
|
return true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/node/NodeIterator.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["\n/**\n * NodeIterator implementation for traversing DOM nodes\n */\nexport class NodeIterator {\n private _root: Node;\n private _whatToShow: number;\n private _filter: NodeFilter | null;\n private _currentNode: Node;\n private _beforeReferenceNode: boolean = true;\n\n constructor(root: Node, whatToShow: number = NodeFilter.SHOW_ALL, filter: NodeFilter | null = null) {\n this._root = root;\n this._whatToShow = whatToShow;\n this._filter = filter;\n this._currentNode = root;\n }\n\n get root(): Node {\n return this._root;\n }\n\n get whatToShow(): number {\n return this._whatToShow;\n }\n\n get filter(): NodeFilter | null {\n return this._filter;\n }\n\n get referenceNode(): Node {\n return this._currentNode;\n }\n\n get pointerBeforeReferenceNode(): boolean {\n return this._beforeReferenceNode;\n }\n\n /**\n * Move to the next node in document order\n */\n nextNode(): Node | null {\n let node = this._currentNode;\n\n if (this._beforeReferenceNode) {\n this._beforeReferenceNode = false;\n if (this._acceptNode(node)) {\n return node;\n }\n }\n\n while (node) {\n const firstChild = (node as any).firstChild;\n if (firstChild) {\n node = firstChild;\n if (this._acceptNode(node)) {\n this._currentNode = node;\n return node;\n }\n continue;\n }\n\n while (node && !(node as any).nextSibling) {\n node = (node as any).parentNode;\n if (!node || node === (this._root as any).parentNode) {\n return null;\n }\n }\n\n if (!node) {\n return null;\n }\n\n node = (node as any).nextSibling;\n if (this._acceptNode(node)) {\n this._currentNode = node;\n return node;\n }\n }\n\n return null;\n }\n\n /**\n * Move to the previous node in document order\n */\n previousNode(): Node | null {\n let node = this._currentNode;\n\n if (!this._beforeReferenceNode) {\n this._beforeReferenceNode = true;\n if (this._acceptNode(node)) {\n return node;\n }\n }\n\n while (node && node !== this._root) {\n const prevSibling = (node as any).previousSibling;\n if (prevSibling) {\n node = prevSibling;\n while ((node as any).lastChild) {\n node = (node as any).lastChild;\n }\n\n if (this._acceptNode(node)) {\n this._currentNode = node;\n return node;\n }\n continue;\n }\n\n node = (node as any).parentNode;\n if (!node || node === (this._root as any).parentNode) {\n return null;\n }\n\n if (this._acceptNode(node)) {\n this._currentNode = node;\n return node;\n }\n }\n\n return null;\n }\n\n detach(): void {}\n\n private _acceptNode(node: Node | null): boolean {\n if (!node) {\n return false;\n }\n\n const nodeTypeMask = 1 << (node.nodeType - 1);\n if (!(this._whatToShow & nodeTypeMask)) {\n return false;\n }\n\n if (this._filter) {\n const result = ('acceptNode' in this._filter) ? this._filter.acceptNode(node) : this._filter(node);\n return result === NodeFilter.FILTER_ACCEPT;\n }\n\n return true;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,aAAa;AAAA,EAOxB,YAAY,MAAY,aAAqB,WAAW,UAAU,SAA4B,MAAM;AAFpG,SAAQ,uBAAgC;AAGtC,SAAK,QAAQ;AACb,SAAK,cAAc;AACnB,SAAK,UAAU;AACf,SAAK,eAAe;AAAA,EACtB;AAAA,EAEA,IAAI,OAAa;AACf,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,aAAqB;AACvB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,SAA4B;AAC9B,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,gBAAsB;AACxB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,6BAAsC;AACxC,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,WAAwB;AACtB,QAAI,OAAO,KAAK;AAEhB,QAAI,KAAK,sBAAsB;AAC7B,WAAK,uBAAuB;AAC5B,UAAI,KAAK,YAAY,IAAI,GAAG;AAC1B,eAAO;AAAA,MACT;AAAA,IACF;AAEA,WAAO,MAAM;AACX,YAAM,aAAc,KAAa;AACjC,UAAI,YAAY;AACd,eAAO;AACP,YAAI,KAAK,YAAY,IAAI,GAAG;AAC1B,eAAK,eAAe;AACpB,iBAAO;AAAA,QACT;AACA;AAAA,MACF;AAEA,aAAO,QAAQ,CAAE,KAAa,aAAa;AACzC,eAAQ,KAAa;AACrB,YAAI,CAAC,QAAQ,SAAU,KAAK,MAAc,YAAY;AACpD,iBAAO;AAAA,QACT;AAAA,MACF;AAEA,UAAI,CAAC,MAAM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|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
-
var ParentNode_exports = {};
|
|
15
|
-
module.exports = __toCommonJS(ParentNode_exports);
|
|
16
1
|
//# sourceMappingURL=ParentNode.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"mappings": "
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,9 +21,9 @@ __export(ParentNodeBase_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(ParentNodeBase_exports);
|
|
23
23
|
var import_ChildNodeBase = require("./ChildNodeBase");
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
24
|
+
var import_HTMLCollectionImp = require("./collection/HTMLCollectionImp");
|
|
25
|
+
var import_NodeListOfImp = require("./collection/NodeListOfImp");
|
|
26
|
+
var import_Node = require("./Node");
|
|
27
27
|
var import_TextBase = require("./TextBase");
|
|
28
28
|
var import_CSSSelector = require("../utils/CSSSelector");
|
|
29
29
|
class ParentNodeBase extends import_ChildNodeBase.ChildNodeBase {
|
|
@@ -31,7 +31,7 @@ class ParentNodeBase extends import_ChildNodeBase.ChildNodeBase {
|
|
|
31
31
|
get childElementCount() {
|
|
32
32
|
let count = 0;
|
|
33
33
|
for (const child of this._childNodesInternal) {
|
|
34
|
-
if (child && child.nodeType ===
|
|
34
|
+
if (child && child.nodeType === import_Node.ELEMENT_NODE) {
|
|
35
35
|
count++;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -40,15 +40,15 @@ class ParentNodeBase extends import_ChildNodeBase.ChildNodeBase {
|
|
|
40
40
|
get children() {
|
|
41
41
|
const elements = [];
|
|
42
42
|
for (const child of this._childNodesInternal) {
|
|
43
|
-
if (child && child.nodeType ===
|
|
43
|
+
if (child && child.nodeType === import_Node.ELEMENT_NODE) {
|
|
44
44
|
elements.push(child);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
return new
|
|
47
|
+
return new import_HTMLCollectionImp.HTMLCollectionImp(elements);
|
|
48
48
|
}
|
|
49
49
|
get firstElementChild() {
|
|
50
50
|
for (const child of this._childNodesInternal) {
|
|
51
|
-
if (child && child.nodeType ===
|
|
51
|
+
if (child && child.nodeType === import_Node.ELEMENT_NODE) {
|
|
52
52
|
return child;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -57,7 +57,7 @@ class ParentNodeBase extends import_ChildNodeBase.ChildNodeBase {
|
|
|
57
57
|
get lastElementChild() {
|
|
58
58
|
for (let i = this._childNodesInternal.length - 1; i >= 0; i--) {
|
|
59
59
|
const child = this._childNodesInternal[i];
|
|
60
|
-
if (child && child.nodeType ===
|
|
60
|
+
if (child && child.nodeType === import_Node.ELEMENT_NODE) {
|
|
61
61
|
return child;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -114,12 +114,12 @@ class ParentNodeBase extends import_ChildNodeBase.ChildNodeBase {
|
|
|
114
114
|
uniqueResults.push(element);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
return new
|
|
117
|
+
return new import_NodeListOfImp.NodeListOfImp(uniqueResults);
|
|
118
118
|
}
|
|
119
119
|
// Private helper methods for querySelector
|
|
120
120
|
_querySelectorAllRecursive(selectors, results) {
|
|
121
121
|
for (const child of this._childNodesInternal) {
|
|
122
|
-
if (child && child.nodeType ===
|
|
122
|
+
if (child && child.nodeType === import_Node.ELEMENT_NODE) {
|
|
123
123
|
const element = child;
|
|
124
124
|
if (import_CSSSelector.CSSSelector.matches(element, selectors)) {
|
|
125
125
|
results.push(element);
|