happy-dom 13.6.2 → 13.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of happy-dom might be problematic. Click here for more details.
- package/cjs/browser/BrowserFrame.cjs +12 -2
- package/cjs/browser/BrowserFrame.cjs.map +1 -1
- package/cjs/browser/BrowserFrame.d.ts.map +1 -1
- package/cjs/browser/detached-browser/DetachedBrowserFrame.cjs +12 -2
- package/cjs/browser/detached-browser/DetachedBrowserFrame.cjs.map +1 -1
- package/cjs/browser/detached-browser/DetachedBrowserFrame.d.ts.map +1 -1
- package/cjs/browser/utilities/BrowserFrameFactory.cjs +5 -0
- package/cjs/browser/utilities/BrowserFrameFactory.cjs.map +1 -1
- package/cjs/browser/utilities/BrowserFrameFactory.d.ts.map +1 -1
- package/cjs/browser/utilities/BrowserFrameNavigator.cjs +20 -13
- package/cjs/browser/utilities/BrowserFrameNavigator.cjs.map +1 -1
- package/cjs/browser/utilities/BrowserFrameNavigator.d.ts +21 -10
- package/cjs/browser/utilities/BrowserFrameNavigator.d.ts.map +1 -1
- package/cjs/browser/utilities/BrowserFrameURL.cjs +2 -2
- package/cjs/browser/utilities/BrowserFrameURL.cjs.map +1 -1
- package/cjs/browser/utilities/BrowserFrameURL.d.ts.map +1 -1
- package/cjs/config/IHTMLElementTagNameMap.cjs +3 -0
- package/cjs/config/IHTMLElementTagNameMap.cjs.map +1 -0
- package/cjs/config/IHTMLElementTagNameMap.d.ts +146 -0
- package/cjs/config/IHTMLElementTagNameMap.d.ts.map +1 -0
- package/cjs/config/ISVGElementTagNameMap.cjs +3 -0
- package/cjs/config/ISVGElementTagNameMap.cjs.map +1 -0
- package/cjs/config/ISVGElementTagNameMap.d.ts +67 -0
- package/cjs/config/ISVGElementTagNameMap.d.ts.map +1 -0
- package/cjs/event/events/HashChangeEvent.cjs +26 -0
- package/cjs/event/events/HashChangeEvent.cjs.map +1 -0
- package/cjs/event/events/HashChangeEvent.d.ts +19 -0
- package/cjs/event/events/HashChangeEvent.d.ts.map +1 -0
- package/cjs/event/events/IHashChangeEventInit.cjs +3 -0
- package/cjs/event/events/IHashChangeEventInit.cjs.map +1 -0
- package/cjs/event/events/IHashChangeEventInit.d.ts +6 -0
- package/cjs/event/events/IHashChangeEventInit.d.ts.map +1 -0
- package/cjs/fetch/Fetch.cjs +3 -3
- package/cjs/fetch/Fetch.cjs.map +1 -1
- package/cjs/fetch/Request.cjs +2 -2
- package/cjs/fetch/Request.cjs.map +1 -1
- package/cjs/fetch/SyncFetch.cjs +3 -3
- package/cjs/fetch/SyncFetch.cjs.map +1 -1
- package/cjs/fetch/utilities/FetchRequestHeaderUtility.cjs +5 -3
- package/cjs/fetch/utilities/FetchRequestHeaderUtility.cjs.map +1 -1
- package/cjs/fetch/utilities/FetchRequestHeaderUtility.d.ts.map +1 -1
- package/cjs/fetch/utilities/FetchRequestReferrerUtility.cjs +1 -1
- package/cjs/fetch/utilities/FetchRequestReferrerUtility.cjs.map +1 -1
- package/cjs/fetch/utilities/FetchRequestReferrerUtility.d.ts.map +1 -1
- package/cjs/form-data/FormData.cjs +1 -1
- package/cjs/form-data/FormData.cjs.map +1 -1
- package/cjs/form-data/FormData.d.ts +1 -1
- package/cjs/form-data/FormData.d.ts.map +1 -1
- package/cjs/index.cjs +7 -3
- package/cjs/index.cjs.map +1 -1
- package/cjs/index.d.ts +7 -3
- package/cjs/index.d.ts.map +1 -1
- package/cjs/location/Location.cjs +270 -0
- package/cjs/location/Location.cjs.map +1 -0
- package/cjs/location/Location.d.ts +144 -0
- package/cjs/location/Location.d.ts.map +1 -0
- package/cjs/named-node-map/NamedNodeMap.cjs +2 -1
- package/cjs/named-node-map/NamedNodeMap.cjs.map +1 -1
- package/cjs/named-node-map/NamedNodeMap.d.ts.map +1 -1
- package/cjs/nodes/document/Document.cjs +4 -4
- package/cjs/nodes/document/Document.cjs.map +1 -1
- package/cjs/nodes/document/Document.d.ts +114 -6
- package/cjs/nodes/document/Document.d.ts.map +1 -1
- package/cjs/nodes/document/IDocument.d.ts +28 -12
- package/cjs/nodes/document/IDocument.d.ts.map +1 -1
- package/cjs/nodes/document-fragment/DocumentFragment.cjs +2 -2
- package/cjs/nodes/document-fragment/DocumentFragment.cjs.map +1 -1
- package/cjs/nodes/document-fragment/DocumentFragment.d.ts +31 -1
- package/cjs/nodes/document-fragment/DocumentFragment.d.ts.map +1 -1
- package/cjs/nodes/document-fragment/IDocumentFragment.d.ts +6 -0
- package/cjs/nodes/document-fragment/IDocumentFragment.d.ts.map +1 -1
- package/cjs/nodes/element/Element.cjs +1 -1
- package/cjs/nodes/element/Element.cjs.map +1 -1
- package/cjs/nodes/element/Element.d.ts +61 -1
- package/cjs/nodes/element/Element.d.ts.map +1 -1
- package/cjs/nodes/element/HTMLCollection.cjs +2 -1
- package/cjs/nodes/element/HTMLCollection.cjs.map +1 -1
- package/cjs/nodes/element/HTMLCollection.d.ts.map +1 -1
- package/cjs/nodes/html-anchor-element/HTMLAnchorElement.cjs +2 -0
- package/cjs/nodes/html-anchor-element/HTMLAnchorElement.cjs.map +1 -1
- package/cjs/nodes/html-anchor-element/HTMLAnchorElement.d.ts.map +1 -1
- package/cjs/nodes/html-button-element/HTMLButtonElement.cjs +93 -4
- package/cjs/nodes/html-button-element/HTMLButtonElement.cjs.map +1 -1
- package/cjs/nodes/html-button-element/HTMLButtonElement.d.ts +49 -1
- package/cjs/nodes/html-button-element/HTMLButtonElement.d.ts.map +1 -1
- package/cjs/nodes/html-button-element/IHTMLButtonElement.d.ts +5 -1
- package/cjs/nodes/html-button-element/IHTMLButtonElement.d.ts.map +1 -1
- package/cjs/nodes/html-form-element/HTMLFormControlsCollection.cjs +2 -1
- package/cjs/nodes/html-form-element/HTMLFormControlsCollection.cjs.map +1 -1
- package/cjs/nodes/html-form-element/HTMLFormControlsCollection.d.ts.map +1 -1
- package/cjs/nodes/html-form-element/HTMLFormElement.cjs +104 -9
- package/cjs/nodes/html-form-element/HTMLFormElement.cjs.map +1 -1
- package/cjs/nodes/html-form-element/HTMLFormElement.d.ts +8 -2
- package/cjs/nodes/html-form-element/HTMLFormElement.d.ts.map +1 -1
- package/cjs/nodes/html-iframe-element/HTMLIFrameElement.cjs +14 -0
- package/cjs/nodes/html-iframe-element/HTMLIFrameElement.cjs.map +1 -1
- package/cjs/nodes/html-iframe-element/HTMLIFrameElement.d.ts +10 -0
- package/cjs/nodes/html-iframe-element/HTMLIFrameElement.d.ts.map +1 -1
- package/cjs/nodes/html-iframe-element/HTMLIFrameElementPageLoader.cjs +4 -1
- package/cjs/nodes/html-iframe-element/HTMLIFrameElementPageLoader.cjs.map +1 -1
- package/cjs/nodes/html-iframe-element/HTMLIFrameElementPageLoader.d.ts.map +1 -1
- package/cjs/nodes/html-iframe-element/IHTMLIFrameElement.d.ts +1 -0
- package/cjs/nodes/html-iframe-element/IHTMLIFrameElement.d.ts.map +1 -1
- package/cjs/nodes/html-input-element/HTMLInputElement.cjs +100 -52
- package/cjs/nodes/html-input-element/HTMLInputElement.cjs.map +1 -1
- package/cjs/nodes/html-input-element/HTMLInputElement.d.ts +49 -23
- package/cjs/nodes/html-input-element/HTMLInputElement.d.ts.map +1 -1
- package/cjs/nodes/html-input-element/IHTMLInputElement.d.ts +2 -0
- package/cjs/nodes/html-input-element/IHTMLInputElement.d.ts.map +1 -1
- package/cjs/nodes/html-label-element/HTMLLabelElement.cjs +1 -0
- package/cjs/nodes/html-label-element/HTMLLabelElement.cjs.map +1 -1
- package/cjs/nodes/html-label-element/HTMLLabelElement.d.ts.map +1 -1
- package/cjs/nodes/html-link-element/HTMLLinkElementStyleSheetLoader.cjs +1 -1
- package/cjs/nodes/html-link-element/HTMLLinkElementStyleSheetLoader.cjs.map +1 -1
- package/cjs/nodes/html-script-element/HTMLScriptElementScriptLoader.cjs +1 -1
- package/cjs/nodes/html-script-element/HTMLScriptElementScriptLoader.cjs.map +1 -1
- package/cjs/nodes/html-select-element/HTMLSelectElement.cjs.map +1 -1
- package/cjs/nodes/html-select-element/HTMLSelectElement.d.ts.map +1 -1
- package/cjs/nodes/node/Node.cjs.map +1 -1
- package/cjs/nodes/node/Node.d.ts.map +1 -1
- package/cjs/nodes/parent-node/IParentNode.d.ts +17 -0
- package/cjs/nodes/parent-node/IParentNode.d.ts.map +1 -1
- package/cjs/nodes/parent-node/ParentNodeUtility.cjs.map +1 -1
- package/cjs/nodes/parent-node/ParentNodeUtility.d.ts.map +1 -1
- package/cjs/query-selector/QuerySelector.cjs.map +1 -1
- package/cjs/query-selector/QuerySelector.d.ts +34 -0
- package/cjs/query-selector/QuerySelector.d.ts.map +1 -1
- package/cjs/version.cjs +1 -1
- package/cjs/window/BrowserWindow.cjs +9 -3
- package/cjs/window/BrowserWindow.cjs.map +1 -1
- package/cjs/window/BrowserWindow.d.ts +5 -4
- package/cjs/window/BrowserWindow.d.ts.map +1 -1
- package/cjs/window/CrossOriginBrowserWindow.d.ts +1 -1
- package/cjs/window/CrossOriginBrowserWindow.d.ts.map +1 -1
- package/cjs/window/IBrowserWindow.d.ts +3 -2
- package/cjs/window/IBrowserWindow.d.ts.map +1 -1
- package/cjs/window/ICrossOriginBrowserWindow.d.ts +1 -1
- package/cjs/window/ICrossOriginBrowserWindow.d.ts.map +1 -1
- package/cjs/window/WindowPageOpenUtility.cjs +4 -2
- package/cjs/window/WindowPageOpenUtility.cjs.map +1 -1
- package/cjs/window/WindowPageOpenUtility.d.ts.map +1 -1
- package/lib/browser/BrowserFrame.d.ts.map +1 -1
- package/lib/browser/BrowserFrame.js +12 -2
- package/lib/browser/BrowserFrame.js.map +1 -1
- package/lib/browser/detached-browser/DetachedBrowserFrame.d.ts.map +1 -1
- package/lib/browser/detached-browser/DetachedBrowserFrame.js +12 -2
- package/lib/browser/detached-browser/DetachedBrowserFrame.js.map +1 -1
- package/lib/browser/utilities/BrowserFrameFactory.d.ts.map +1 -1
- package/lib/browser/utilities/BrowserFrameFactory.js +5 -0
- package/lib/browser/utilities/BrowserFrameFactory.js.map +1 -1
- package/lib/browser/utilities/BrowserFrameNavigator.d.ts +21 -10
- package/lib/browser/utilities/BrowserFrameNavigator.d.ts.map +1 -1
- package/lib/browser/utilities/BrowserFrameNavigator.js +20 -13
- package/lib/browser/utilities/BrowserFrameNavigator.js.map +1 -1
- package/lib/browser/utilities/BrowserFrameURL.d.ts.map +1 -1
- package/lib/browser/utilities/BrowserFrameURL.js +2 -2
- package/lib/browser/utilities/BrowserFrameURL.js.map +1 -1
- package/lib/config/IHTMLElementTagNameMap.d.ts +146 -0
- package/lib/config/IHTMLElementTagNameMap.d.ts.map +1 -0
- package/lib/config/IHTMLElementTagNameMap.js +2 -0
- package/lib/config/IHTMLElementTagNameMap.js.map +1 -0
- package/lib/config/ISVGElementTagNameMap.d.ts +67 -0
- package/lib/config/ISVGElementTagNameMap.d.ts.map +1 -0
- package/lib/config/ISVGElementTagNameMap.js +2 -0
- package/lib/config/ISVGElementTagNameMap.js.map +1 -0
- package/lib/event/events/HashChangeEvent.d.ts +19 -0
- package/lib/event/events/HashChangeEvent.d.ts.map +1 -0
- package/lib/event/events/HashChangeEvent.js +20 -0
- package/lib/event/events/HashChangeEvent.js.map +1 -0
- package/lib/event/events/IHashChangeEventInit.d.ts +6 -0
- package/lib/event/events/IHashChangeEventInit.d.ts.map +1 -0
- package/lib/event/events/IHashChangeEventInit.js +2 -0
- package/lib/event/events/IHashChangeEventInit.js.map +1 -0
- package/lib/fetch/Fetch.js +3 -3
- package/lib/fetch/Fetch.js.map +1 -1
- package/lib/fetch/Request.js +2 -2
- package/lib/fetch/Request.js.map +1 -1
- package/lib/fetch/SyncFetch.js +3 -3
- package/lib/fetch/SyncFetch.js.map +1 -1
- package/lib/fetch/utilities/FetchRequestHeaderUtility.d.ts.map +1 -1
- package/lib/fetch/utilities/FetchRequestHeaderUtility.js +4 -2
- package/lib/fetch/utilities/FetchRequestHeaderUtility.js.map +1 -1
- package/lib/fetch/utilities/FetchRequestReferrerUtility.d.ts.map +1 -1
- package/lib/fetch/utilities/FetchRequestReferrerUtility.js +1 -1
- package/lib/fetch/utilities/FetchRequestReferrerUtility.js.map +1 -1
- package/lib/form-data/FormData.d.ts +1 -1
- package/lib/form-data/FormData.d.ts.map +1 -1
- package/lib/form-data/FormData.js +1 -1
- package/lib/form-data/FormData.js.map +1 -1
- package/lib/index.d.ts +7 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/lib/location/Location.d.ts +144 -0
- package/lib/location/Location.d.ts.map +1 -0
- package/lib/location/Location.js +241 -0
- package/lib/location/Location.js.map +1 -0
- package/lib/named-node-map/NamedNodeMap.d.ts.map +1 -1
- package/lib/named-node-map/NamedNodeMap.js +2 -1
- package/lib/named-node-map/NamedNodeMap.js.map +1 -1
- package/lib/nodes/document/Document.d.ts +114 -6
- package/lib/nodes/document/Document.d.ts.map +1 -1
- package/lib/nodes/document/Document.js +4 -4
- package/lib/nodes/document/Document.js.map +1 -1
- package/lib/nodes/document/IDocument.d.ts +28 -12
- package/lib/nodes/document/IDocument.d.ts.map +1 -1
- package/lib/nodes/document-fragment/DocumentFragment.d.ts +31 -1
- package/lib/nodes/document-fragment/DocumentFragment.d.ts.map +1 -1
- package/lib/nodes/document-fragment/DocumentFragment.js +2 -2
- package/lib/nodes/document-fragment/DocumentFragment.js.map +1 -1
- package/lib/nodes/document-fragment/IDocumentFragment.d.ts +6 -0
- package/lib/nodes/document-fragment/IDocumentFragment.d.ts.map +1 -1
- package/lib/nodes/element/Element.d.ts +61 -1
- package/lib/nodes/element/Element.d.ts.map +1 -1
- package/lib/nodes/element/Element.js +1 -1
- package/lib/nodes/element/Element.js.map +1 -1
- package/lib/nodes/element/HTMLCollection.d.ts.map +1 -1
- package/lib/nodes/element/HTMLCollection.js +2 -1
- package/lib/nodes/element/HTMLCollection.js.map +1 -1
- package/lib/nodes/html-anchor-element/HTMLAnchorElement.d.ts.map +1 -1
- package/lib/nodes/html-anchor-element/HTMLAnchorElement.js +2 -0
- package/lib/nodes/html-anchor-element/HTMLAnchorElement.js.map +1 -1
- package/lib/nodes/html-button-element/HTMLButtonElement.d.ts +49 -1
- package/lib/nodes/html-button-element/HTMLButtonElement.d.ts.map +1 -1
- package/lib/nodes/html-button-element/HTMLButtonElement.js +93 -4
- package/lib/nodes/html-button-element/HTMLButtonElement.js.map +1 -1
- package/lib/nodes/html-button-element/IHTMLButtonElement.d.ts +5 -1
- package/lib/nodes/html-button-element/IHTMLButtonElement.d.ts.map +1 -1
- package/lib/nodes/html-form-element/HTMLFormControlsCollection.d.ts.map +1 -1
- package/lib/nodes/html-form-element/HTMLFormControlsCollection.js +2 -1
- package/lib/nodes/html-form-element/HTMLFormControlsCollection.js.map +1 -1
- package/lib/nodes/html-form-element/HTMLFormElement.d.ts +8 -2
- package/lib/nodes/html-form-element/HTMLFormElement.d.ts.map +1 -1
- package/lib/nodes/html-form-element/HTMLFormElement.js +106 -10
- package/lib/nodes/html-form-element/HTMLFormElement.js.map +1 -1
- package/lib/nodes/html-iframe-element/HTMLIFrameElement.d.ts +10 -0
- package/lib/nodes/html-iframe-element/HTMLIFrameElement.d.ts.map +1 -1
- package/lib/nodes/html-iframe-element/HTMLIFrameElement.js +14 -0
- package/lib/nodes/html-iframe-element/HTMLIFrameElement.js.map +1 -1
- package/lib/nodes/html-iframe-element/HTMLIFrameElementPageLoader.d.ts.map +1 -1
- package/lib/nodes/html-iframe-element/HTMLIFrameElementPageLoader.js +4 -1
- package/lib/nodes/html-iframe-element/HTMLIFrameElementPageLoader.js.map +1 -1
- package/lib/nodes/html-iframe-element/IHTMLIFrameElement.d.ts +1 -0
- package/lib/nodes/html-iframe-element/IHTMLIFrameElement.d.ts.map +1 -1
- package/lib/nodes/html-input-element/HTMLInputElement.d.ts +49 -23
- package/lib/nodes/html-input-element/HTMLInputElement.d.ts.map +1 -1
- package/lib/nodes/html-input-element/HTMLInputElement.js +100 -52
- package/lib/nodes/html-input-element/HTMLInputElement.js.map +1 -1
- package/lib/nodes/html-input-element/IHTMLInputElement.d.ts +2 -0
- package/lib/nodes/html-input-element/IHTMLInputElement.d.ts.map +1 -1
- package/lib/nodes/html-label-element/HTMLLabelElement.d.ts.map +1 -1
- package/lib/nodes/html-label-element/HTMLLabelElement.js +1 -0
- package/lib/nodes/html-label-element/HTMLLabelElement.js.map +1 -1
- package/lib/nodes/html-link-element/HTMLLinkElementStyleSheetLoader.js +1 -1
- package/lib/nodes/html-link-element/HTMLLinkElementStyleSheetLoader.js.map +1 -1
- package/lib/nodes/html-script-element/HTMLScriptElementScriptLoader.js +1 -1
- package/lib/nodes/html-script-element/HTMLScriptElementScriptLoader.js.map +1 -1
- package/lib/nodes/html-select-element/HTMLSelectElement.d.ts.map +1 -1
- package/lib/nodes/html-select-element/HTMLSelectElement.js.map +1 -1
- package/lib/nodes/node/Node.d.ts.map +1 -1
- package/lib/nodes/node/Node.js.map +1 -1
- package/lib/nodes/parent-node/IParentNode.d.ts +17 -0
- package/lib/nodes/parent-node/IParentNode.d.ts.map +1 -1
- package/lib/nodes/parent-node/ParentNodeUtility.d.ts.map +1 -1
- package/lib/nodes/parent-node/ParentNodeUtility.js.map +1 -1
- package/lib/query-selector/QuerySelector.d.ts +34 -0
- package/lib/query-selector/QuerySelector.d.ts.map +1 -1
- package/lib/query-selector/QuerySelector.js.map +1 -1
- package/lib/version.js +1 -1
- package/lib/window/BrowserWindow.d.ts +5 -4
- package/lib/window/BrowserWindow.d.ts.map +1 -1
- package/lib/window/BrowserWindow.js +10 -4
- package/lib/window/BrowserWindow.js.map +1 -1
- package/lib/window/CrossOriginBrowserWindow.d.ts +1 -1
- package/lib/window/CrossOriginBrowserWindow.d.ts.map +1 -1
- package/lib/window/IBrowserWindow.d.ts +3 -2
- package/lib/window/IBrowserWindow.d.ts.map +1 -1
- package/lib/window/ICrossOriginBrowserWindow.d.ts +1 -1
- package/lib/window/ICrossOriginBrowserWindow.d.ts.map +1 -1
- package/lib/window/WindowPageOpenUtility.d.ts.map +1 -1
- package/lib/window/WindowPageOpenUtility.js +4 -2
- package/lib/window/WindowPageOpenUtility.js.map +1 -1
- package/package.json +1 -1
- package/src/browser/BrowserFrame.ts +12 -2
- package/src/browser/detached-browser/DetachedBrowserFrame.ts +12 -7
- package/src/browser/utilities/BrowserFrameFactory.ts +7 -0
- package/src/browser/utilities/BrowserFrameNavigator.ts +28 -18
- package/src/browser/utilities/BrowserFrameURL.ts +2 -2
- package/src/config/IHTMLElementTagNameMap.ts +148 -0
- package/src/config/ISVGElementTagNameMap.ts +67 -0
- package/src/event/events/HashChangeEvent.ts +25 -0
- package/src/event/events/IHashChangeEventInit.ts +6 -0
- package/src/fetch/Fetch.ts +3 -3
- package/src/fetch/Request.ts +2 -2
- package/src/fetch/SyncFetch.ts +3 -3
- package/src/fetch/utilities/FetchRequestHeaderUtility.ts +4 -5
- package/src/fetch/utilities/FetchRequestReferrerUtility.ts +2 -1
- package/src/form-data/FormData.ts +2 -2
- package/src/index.ts +9 -1
- package/src/location/Location.ts +257 -0
- package/src/named-node-map/NamedNodeMap.ts +1 -0
- package/src/nodes/document/Document.ts +224 -17
- package/src/nodes/document/IDocument.ts +33 -11
- package/src/nodes/document-fragment/DocumentFragment.ts +59 -1
- package/src/nodes/document-fragment/IDocumentFragment.ts +14 -0
- package/src/nodes/element/Element.ts +120 -1
- package/src/nodes/element/HTMLCollection.ts +1 -0
- package/src/nodes/html-anchor-element/HTMLAnchorElement.ts +2 -0
- package/src/nodes/html-button-element/HTMLButtonElement.ts +107 -5
- package/src/nodes/html-button-element/IHTMLButtonElement.ts +5 -1
- package/src/nodes/html-form-element/HTMLFormControlsCollection.ts +1 -0
- package/src/nodes/html-form-element/HTMLFormElement.ts +111 -5
- package/src/nodes/html-iframe-element/HTMLIFrameElement.ts +16 -0
- package/src/nodes/html-iframe-element/HTMLIFrameElementPageLoader.ts +5 -1
- package/src/nodes/html-iframe-element/IHTMLIFrameElement.ts +1 -0
- package/src/nodes/html-input-element/HTMLInputElement.ts +111 -57
- package/src/nodes/html-input-element/IHTMLInputElement.ts +2 -0
- package/src/nodes/html-label-element/HTMLLabelElement.ts +1 -0
- package/src/nodes/html-link-element/HTMLLinkElementStyleSheetLoader.ts +1 -1
- package/src/nodes/html-script-element/HTMLScriptElementScriptLoader.ts +1 -1
- package/src/nodes/html-select-element/HTMLSelectElement.ts +1 -2
- package/src/nodes/node/Node.ts +1 -2
- package/src/nodes/parent-node/IParentNode.ts +36 -0
- package/src/nodes/parent-node/ParentNodeUtility.ts +1 -0
- package/src/query-selector/QuerySelector.ts +76 -2
- package/src/window/BrowserWindow.ts +11 -4
- package/src/window/CrossOriginBrowserWindow.ts +1 -1
- package/src/window/IBrowserWindow.ts +3 -2
- package/src/window/ICrossOriginBrowserWindow.ts +1 -1
- package/src/window/WindowPageOpenUtility.ts +4 -2
- package/cjs/url/Location.cjs +0 -111
- package/cjs/url/Location.cjs.map +0 -1
- package/cjs/url/Location.d.ts +0 -48
- package/cjs/url/Location.d.ts.map +0 -1
- package/lib/url/Location.d.ts +0 -48
- package/lib/url/Location.d.ts.map +0 -1
- package/lib/url/Location.js +0 -82
- package/lib/url/Location.js.map +0 -1
- package/src/url/Location.ts +0 -79
@@ -10,6 +10,11 @@ import IHTMLInputElement from '../html-input-element/IHTMLInputElement.js';
|
|
10
10
|
import IHTMLTextAreaElement from '../html-text-area-element/IHTMLTextAreaElement.js';
|
11
11
|
import IHTMLSelectElement from '../html-select-element/IHTMLSelectElement.js';
|
12
12
|
import IHTMLButtonElement from '../html-button-element/IHTMLButtonElement.js';
|
13
|
+
import IBrowserFrame from '../../browser/types/IBrowserFrame.js';
|
14
|
+
import BrowserFrameNavigator from '../../browser/utilities/BrowserFrameNavigator.js';
|
15
|
+
import FormData from '../../form-data/FormData.js';
|
16
|
+
import Element from '../element/Element.js';
|
17
|
+
import Node from '../node/Node.js';
|
13
18
|
|
14
19
|
/**
|
15
20
|
* HTML Form Element.
|
@@ -28,6 +33,19 @@ export default class HTMLFormElement extends HTMLElement implements IHTMLFormEle
|
|
28
33
|
public onreset: (event: Event) => void | null = null;
|
29
34
|
public onsubmit: (event: Event) => void | null = null;
|
30
35
|
|
36
|
+
// Private properties
|
37
|
+
#browserFrame: IBrowserFrame;
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Constructor.
|
41
|
+
*
|
42
|
+
* @param browserFrame Browser frame.
|
43
|
+
*/
|
44
|
+
constructor(browserFrame: IBrowserFrame) {
|
45
|
+
super();
|
46
|
+
this.#browserFrame = browserFrame;
|
47
|
+
}
|
48
|
+
|
31
49
|
/**
|
32
50
|
* Returns elements.
|
33
51
|
*
|
@@ -106,7 +124,18 @@ export default class HTMLFormElement extends HTMLElement implements IHTMLFormEle
|
|
106
124
|
* @returns Action.
|
107
125
|
*/
|
108
126
|
public get action(): string {
|
109
|
-
|
127
|
+
if (!this.hasAttribute('action')) {
|
128
|
+
return this[PropertySymbol.ownerDocument].location.href;
|
129
|
+
}
|
130
|
+
|
131
|
+
try {
|
132
|
+
return new URL(
|
133
|
+
this.getAttribute('action') || '',
|
134
|
+
this[PropertySymbol.ownerDocument].location.href
|
135
|
+
).href;
|
136
|
+
} catch (e) {
|
137
|
+
return '';
|
138
|
+
}
|
110
139
|
}
|
111
140
|
|
112
141
|
/**
|
@@ -214,10 +243,10 @@ export default class HTMLFormElement extends HTMLElement implements IHTMLFormEle
|
|
214
243
|
|
215
244
|
/**
|
216
245
|
* Submits form. No submit event is raised. In particular, the form's "submit" event handler is not run.
|
217
|
-
*
|
218
|
-
* In Happy DOM this means that nothing happens.
|
219
246
|
*/
|
220
|
-
public submit(): void {
|
247
|
+
public submit(): void {
|
248
|
+
this.#submit();
|
249
|
+
}
|
221
250
|
|
222
251
|
/**
|
223
252
|
* Submits form, reports validity and raises submit event.
|
@@ -230,6 +259,7 @@ export default class HTMLFormElement extends HTMLElement implements IHTMLFormEle
|
|
230
259
|
this.dispatchEvent(
|
231
260
|
new SubmitEvent('submit', { bubbles: true, cancelable: true, submitter: submitter || this })
|
232
261
|
);
|
262
|
+
this.#submit(submitter);
|
233
263
|
}
|
234
264
|
}
|
235
265
|
|
@@ -375,8 +405,84 @@ export default class HTMLFormElement extends HTMLElement implements IHTMLFormEle
|
|
375
405
|
*/
|
376
406
|
protected [PropertySymbol.isValidPropertyName](name: string): boolean {
|
377
407
|
return (
|
378
|
-
|
408
|
+
!!name &&
|
409
|
+
!HTMLFormElement.prototype.hasOwnProperty(name) &&
|
410
|
+
!HTMLElement.prototype.hasOwnProperty(name) &&
|
411
|
+
!Element.prototype.hasOwnProperty(name) &&
|
412
|
+
!Node.prototype.hasOwnProperty(name) &&
|
379
413
|
(isNaN(Number(name)) || name.includes('.'))
|
380
414
|
);
|
381
415
|
}
|
416
|
+
|
417
|
+
/**
|
418
|
+
* Submits form.
|
419
|
+
*
|
420
|
+
* @param [submitter] Submitter.
|
421
|
+
*/
|
422
|
+
#submit(submitter?: IHTMLInputElement | IHTMLButtonElement): void {
|
423
|
+
const action = submitter?.hasAttribute('formaction')
|
424
|
+
? submitter?.formAction || this.action
|
425
|
+
: this.action;
|
426
|
+
|
427
|
+
if (!action) {
|
428
|
+
// The URL is invalid when the action is empty.
|
429
|
+
// This is what Chrome does when the URL is invalid.
|
430
|
+
this[PropertySymbol.ownerDocument].location.hash = '#blocked';
|
431
|
+
return;
|
432
|
+
}
|
433
|
+
|
434
|
+
const method = submitter?.formMethod || this.method;
|
435
|
+
const formData = new FormData(this);
|
436
|
+
let targetFrame: IBrowserFrame;
|
437
|
+
|
438
|
+
switch (submitter?.formTarget || this.target) {
|
439
|
+
default:
|
440
|
+
case '_self':
|
441
|
+
targetFrame = this.#browserFrame;
|
442
|
+
break;
|
443
|
+
case '_top':
|
444
|
+
targetFrame = this.#browserFrame.page.mainFrame;
|
445
|
+
break;
|
446
|
+
case '_parent':
|
447
|
+
targetFrame = this.#browserFrame.parentFrame ?? this.#browserFrame;
|
448
|
+
break;
|
449
|
+
case '_blank':
|
450
|
+
const newPage = this.#browserFrame.page.context.newPage();
|
451
|
+
targetFrame = newPage.mainFrame;
|
452
|
+
targetFrame[PropertySymbol.openerFrame] = this.#browserFrame;
|
453
|
+
break;
|
454
|
+
}
|
455
|
+
|
456
|
+
if (method === 'get') {
|
457
|
+
const url = new URL(action);
|
458
|
+
|
459
|
+
for (const [key, value] of formData) {
|
460
|
+
if (typeof value === 'string') {
|
461
|
+
url.searchParams.append(key, value);
|
462
|
+
}
|
463
|
+
}
|
464
|
+
|
465
|
+
BrowserFrameNavigator.navigate({
|
466
|
+
windowClass: this[PropertySymbol.ownerDocument][PropertySymbol.defaultView].constructor,
|
467
|
+
frame: targetFrame,
|
468
|
+
url: url.href,
|
469
|
+
goToOptions: {
|
470
|
+
referrer: this.#browserFrame.page.mainFrame.window.location.origin
|
471
|
+
}
|
472
|
+
});
|
473
|
+
|
474
|
+
return;
|
475
|
+
}
|
476
|
+
|
477
|
+
BrowserFrameNavigator.navigate({
|
478
|
+
windowClass: this[PropertySymbol.ownerDocument][PropertySymbol.defaultView].constructor,
|
479
|
+
frame: targetFrame,
|
480
|
+
method: method,
|
481
|
+
url: action,
|
482
|
+
formData,
|
483
|
+
goToOptions: {
|
484
|
+
referrer: this.#browserFrame.page.mainFrame.window.location.origin
|
485
|
+
}
|
486
|
+
});
|
487
|
+
}
|
382
488
|
}
|
@@ -172,6 +172,22 @@ export default class HTMLIFrameElement extends HTMLElement implements IHTMLIFram
|
|
172
172
|
this.setAttribute('srcdoc', srcdoc);
|
173
173
|
}
|
174
174
|
|
175
|
+
/**
|
176
|
+
* Returns referrer policy.
|
177
|
+
*/
|
178
|
+
public get referrerPolicy(): string {
|
179
|
+
return this.getAttribute('referrerpolicy') || '';
|
180
|
+
}
|
181
|
+
|
182
|
+
/**
|
183
|
+
* Sets referrer policy.
|
184
|
+
*
|
185
|
+
* @param referrerPolicy Referrer policy.
|
186
|
+
*/
|
187
|
+
public set referrerPolicy(referrerPolicy: string) {
|
188
|
+
this.setAttribute('referrerpolicy', referrerPolicy);
|
189
|
+
}
|
190
|
+
|
175
191
|
/**
|
176
192
|
* Returns content document.
|
177
193
|
*
|
@@ -10,6 +10,7 @@ import DOMException from '../../exception/DOMException.js';
|
|
10
10
|
import DOMExceptionNameEnum from '../../exception/DOMExceptionNameEnum.js';
|
11
11
|
import BrowserFrameURL from '../../browser/utilities/BrowserFrameURL.js';
|
12
12
|
import BrowserFrameFactory from '../../browser/utilities/BrowserFrameFactory.js';
|
13
|
+
import IRequestReferrerPolicy from '../../fetch/types/IRequestReferrerPolicy.js';
|
13
14
|
|
14
15
|
/**
|
15
16
|
* HTML Iframe page loader.
|
@@ -84,7 +85,10 @@ export default class HTMLIFrameElementPageLoader {
|
|
84
85
|
parentWindow;
|
85
86
|
|
86
87
|
this.#browserIFrame
|
87
|
-
.goto(targetURL.href
|
88
|
+
.goto(targetURL.href, {
|
89
|
+
referrer: originURL.origin,
|
90
|
+
referrerPolicy: <IRequestReferrerPolicy>this.#element.referrerPolicy
|
91
|
+
})
|
88
92
|
.then(() => this.#element.dispatchEvent(new Event('load')))
|
89
93
|
.catch((error) => WindowErrorUtility.dispatchError(this.#element, error));
|
90
94
|
|
@@ -18,6 +18,7 @@ export default interface IHTMLIFrameElement extends IHTMLElement {
|
|
18
18
|
name: string | null;
|
19
19
|
sandbox: string | null;
|
20
20
|
srcdoc: string | null;
|
21
|
+
referrerPolicy: string | null;
|
21
22
|
readonly contentDocument: IDocument | null;
|
22
23
|
readonly contentWindow: IBrowserWindow | ICrossOriginBrowserWindow | null;
|
23
24
|
|
@@ -23,6 +23,7 @@ import HTMLInputElementDateUtility from './HTMLInputElementDateUtility.js';
|
|
23
23
|
import HTMLLabelElementUtility from '../html-label-element/HTMLLabelElementUtility.js';
|
24
24
|
import INamedNodeMap from '../../named-node-map/INamedNodeMap.js';
|
25
25
|
import HTMLInputElementNamedNodeMap from './HTMLInputElementNamedNodeMap.js';
|
26
|
+
import PointerEvent from '../../event/events/PointerEvent.js';
|
26
27
|
import { URL } from 'url';
|
27
28
|
|
28
29
|
/**
|
@@ -98,48 +99,124 @@ export default class HTMLInputElement extends HTMLElement implements IHTMLInputE
|
|
98
99
|
/**
|
99
100
|
* Returns form action.
|
100
101
|
*
|
101
|
-
* @returns
|
102
|
+
* @returns Form action.
|
102
103
|
*/
|
103
104
|
public get formAction(): string {
|
104
|
-
|
105
|
-
this.
|
106
|
-
|
107
|
-
|
108
|
-
|
105
|
+
if (!this.hasAttribute('formaction')) {
|
106
|
+
return this[PropertySymbol.ownerDocument].location.href;
|
107
|
+
}
|
108
|
+
|
109
|
+
try {
|
110
|
+
return new URL(
|
111
|
+
this.getAttribute('formaction') || '',
|
112
|
+
this[PropertySymbol.ownerDocument].location.href
|
113
|
+
).href;
|
114
|
+
} catch (e) {
|
115
|
+
return '';
|
116
|
+
}
|
109
117
|
}
|
110
118
|
|
111
119
|
/**
|
112
120
|
* Sets form action.
|
113
121
|
*
|
114
|
-
* @param
|
122
|
+
* @param formAction Form action.
|
115
123
|
*/
|
116
|
-
public set formAction(
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
124
|
+
public set formAction(formAction: string) {
|
125
|
+
this.setAttribute('formaction', formAction);
|
126
|
+
}
|
127
|
+
|
128
|
+
/**
|
129
|
+
* Returns form enctype.
|
130
|
+
*
|
131
|
+
* @returns Form enctype.
|
132
|
+
*/
|
133
|
+
public get formEnctype(): string {
|
134
|
+
return this.getAttribute('formenctype') || '';
|
135
|
+
}
|
136
|
+
|
137
|
+
/**
|
138
|
+
* Sets form enctype.
|
139
|
+
*
|
140
|
+
* @param formEnctype Form enctype.
|
141
|
+
*/
|
142
|
+
public set formEnctype(formEnctype: string) {
|
143
|
+
this.setAttribute('formenctype', formEnctype);
|
123
144
|
}
|
124
145
|
|
125
146
|
/**
|
126
147
|
* Returns form method.
|
148
|
+
*
|
149
|
+
* @returns Form method.
|
127
150
|
*/
|
128
151
|
public get formMethod(): string {
|
129
|
-
return (
|
130
|
-
this.getAttribute('formmethod') ||
|
131
|
-
(<IHTMLFormElement>this[PropertySymbol.formNode])?.method ||
|
132
|
-
''
|
133
|
-
);
|
152
|
+
return this.getAttribute('formmethod') || '';
|
134
153
|
}
|
135
154
|
|
136
155
|
/**
|
137
156
|
* Sets form method.
|
138
157
|
*
|
139
|
-
* @param method
|
158
|
+
* @param formMethod Form method.
|
159
|
+
*/
|
160
|
+
public set formMethod(formMethod: string) {
|
161
|
+
this.setAttribute('formmethod', formMethod);
|
162
|
+
}
|
163
|
+
|
164
|
+
/**
|
165
|
+
* Returns no validate.
|
166
|
+
*
|
167
|
+
* @returns No validate.
|
168
|
+
*/
|
169
|
+
public get formNoValidate(): boolean {
|
170
|
+
return this.getAttribute('formnovalidate') !== null;
|
171
|
+
}
|
172
|
+
|
173
|
+
/**
|
174
|
+
* Sets no validate.
|
175
|
+
*
|
176
|
+
* @param formNoValidate No validate.
|
177
|
+
*/
|
178
|
+
public set formNoValidate(formNoValidate: boolean) {
|
179
|
+
if (!formNoValidate) {
|
180
|
+
this.removeAttribute('formnovalidate');
|
181
|
+
} else {
|
182
|
+
this.setAttribute('formnovalidate', '');
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
/**
|
187
|
+
* Returns form target.
|
188
|
+
*
|
189
|
+
* @returns Form target.
|
140
190
|
*/
|
141
|
-
public
|
142
|
-
this.
|
191
|
+
public get formTarget(): string {
|
192
|
+
return this.getAttribute('formtarget') || '';
|
193
|
+
}
|
194
|
+
|
195
|
+
/**
|
196
|
+
* Sets form target.
|
197
|
+
*
|
198
|
+
* @param formTarget Form target.
|
199
|
+
*/
|
200
|
+
public set formTarget(formTarget: string) {
|
201
|
+
this.setAttribute('formtarget', formTarget);
|
202
|
+
}
|
203
|
+
|
204
|
+
/**
|
205
|
+
* Returns the parent form element.
|
206
|
+
*
|
207
|
+
* @returns Form.
|
208
|
+
*/
|
209
|
+
public get form(): IHTMLFormElement | null {
|
210
|
+
if (this[PropertySymbol.formNode]) {
|
211
|
+
return <IHTMLFormElement>this[PropertySymbol.formNode];
|
212
|
+
}
|
213
|
+
if (!this.isConnected) {
|
214
|
+
return null;
|
215
|
+
}
|
216
|
+
const formID = this.getAttribute('form');
|
217
|
+
return formID
|
218
|
+
? <IHTMLFormElement>this[PropertySymbol.ownerDocument].getElementById(formID)
|
219
|
+
: null;
|
143
220
|
}
|
144
221
|
|
145
222
|
/**
|
@@ -834,37 +911,6 @@ export default class HTMLInputElement extends HTMLElement implements IHTMLInputE
|
|
834
911
|
this.setSelectionRange(this.#selectionStart, this.#selectionEnd, direction);
|
835
912
|
}
|
836
913
|
|
837
|
-
/**
|
838
|
-
* Returns no validate.
|
839
|
-
*
|
840
|
-
* @returns No validate.
|
841
|
-
*/
|
842
|
-
public get formNoValidate(): boolean {
|
843
|
-
return this.getAttribute('formnovalidate') !== null;
|
844
|
-
}
|
845
|
-
|
846
|
-
/**
|
847
|
-
* Sets no validate.
|
848
|
-
*
|
849
|
-
* @param formNoValidate No validate.
|
850
|
-
*/
|
851
|
-
public set formNoValidate(formNoValidate: boolean) {
|
852
|
-
if (!formNoValidate) {
|
853
|
-
this.removeAttribute('formnovalidate');
|
854
|
-
} else {
|
855
|
-
this.setAttribute('formnovalidate', '');
|
856
|
-
}
|
857
|
-
}
|
858
|
-
|
859
|
-
/**
|
860
|
-
* Returns the parent form element.
|
861
|
-
*
|
862
|
-
* @returns Form.
|
863
|
-
*/
|
864
|
-
public get form(): IHTMLFormElement {
|
865
|
-
return <IHTMLFormElement>this[PropertySymbol.formNode];
|
866
|
-
}
|
867
|
-
|
868
914
|
/**
|
869
915
|
* Returns "true" if it will validate.
|
870
916
|
*
|
@@ -1263,7 +1309,12 @@ export default class HTMLInputElement extends HTMLElement implements IHTMLInputE
|
|
1263
1309
|
*/
|
1264
1310
|
public override dispatchEvent(event: Event): boolean {
|
1265
1311
|
// Do nothing if the input element is disabled and the event is a click event.
|
1266
|
-
if (
|
1312
|
+
if (
|
1313
|
+
event.type === 'click' &&
|
1314
|
+
event instanceof PointerEvent &&
|
1315
|
+
event.eventPhase === EventPhaseEnum.none &&
|
1316
|
+
this.disabled
|
1317
|
+
) {
|
1267
1318
|
return false;
|
1268
1319
|
}
|
1269
1320
|
|
@@ -1274,7 +1325,8 @@ export default class HTMLInputElement extends HTMLElement implements IHTMLInputE
|
|
1274
1325
|
if (
|
1275
1326
|
(event.eventPhase === EventPhaseEnum.atTarget ||
|
1276
1327
|
event.eventPhase === EventPhaseEnum.bubbling) &&
|
1277
|
-
event.type === 'click'
|
1328
|
+
event.type === 'click' &&
|
1329
|
+
event instanceof PointerEvent
|
1278
1330
|
) {
|
1279
1331
|
const inputType = this.type;
|
1280
1332
|
if (inputType === 'checkbox' || inputType === 'radio') {
|
@@ -1290,6 +1342,7 @@ export default class HTMLInputElement extends HTMLElement implements IHTMLInputE
|
|
1290
1342
|
(event.eventPhase === EventPhaseEnum.atTarget ||
|
1291
1343
|
event.eventPhase === EventPhaseEnum.bubbling) &&
|
1292
1344
|
event.type === 'click' &&
|
1345
|
+
event instanceof PointerEvent &&
|
1293
1346
|
this[PropertySymbol.isConnected]
|
1294
1347
|
) {
|
1295
1348
|
const inputType = this.type;
|
@@ -1298,12 +1351,12 @@ export default class HTMLInputElement extends HTMLElement implements IHTMLInputE
|
|
1298
1351
|
this.dispatchEvent(new Event('input', { bubbles: true, cancelable: true }));
|
1299
1352
|
this.dispatchEvent(new Event('change', { bubbles: true, cancelable: true }));
|
1300
1353
|
} else if (inputType === 'submit') {
|
1301
|
-
const form =
|
1354
|
+
const form = this.form;
|
1302
1355
|
if (form) {
|
1303
1356
|
form.requestSubmit(this);
|
1304
1357
|
}
|
1305
1358
|
} else if (inputType === 'reset' && this[PropertySymbol.isConnected]) {
|
1306
|
-
const form =
|
1359
|
+
const form = this.form;
|
1307
1360
|
if (form) {
|
1308
1361
|
form.reset();
|
1309
1362
|
}
|
@@ -1317,6 +1370,7 @@ export default class HTMLInputElement extends HTMLElement implements IHTMLInputE
|
|
1317
1370
|
(event.eventPhase === EventPhaseEnum.atTarget ||
|
1318
1371
|
event.eventPhase === EventPhaseEnum.bubbling) &&
|
1319
1372
|
event.type === 'click' &&
|
1373
|
+
event instanceof PointerEvent &&
|
1320
1374
|
previousCheckedValue !== null
|
1321
1375
|
) {
|
1322
1376
|
const inputType = this.type;
|
@@ -19,8 +19,10 @@ export default interface IHTMLInputElement extends IHTMLElement {
|
|
19
19
|
readonly labels: INodeList<IHTMLLabelElement>;
|
20
20
|
readonly validity: ValidityState;
|
21
21
|
formAction: string;
|
22
|
+
formEnctype: string;
|
22
23
|
formMethod: string;
|
23
24
|
formNoValidate: boolean;
|
25
|
+
formTarget: string;
|
24
26
|
defaultChecked: boolean;
|
25
27
|
files: IFileList<File>;
|
26
28
|
defaultValue: string;
|
@@ -80,6 +80,7 @@ export default class HTMLLabelElement extends HTMLElement implements IHTMLLabelE
|
|
80
80
|
|
81
81
|
if (
|
82
82
|
event.type === 'click' &&
|
83
|
+
event instanceof PointerEvent &&
|
83
84
|
(event.eventPhase === EventPhaseEnum.atTarget || event.eventPhase === EventPhaseEnum.bubbling)
|
84
85
|
) {
|
85
86
|
const control = this.control;
|
@@ -52,7 +52,7 @@ export default class HTMLLinkElementStyleSheetLoader {
|
|
52
52
|
try {
|
53
53
|
absoluteURL = new URL(
|
54
54
|
url,
|
55
|
-
element[PropertySymbol.ownerDocument][PropertySymbol.ownerWindow].location
|
55
|
+
element[PropertySymbol.ownerDocument][PropertySymbol.ownerWindow].location.href
|
56
56
|
).href;
|
57
57
|
} catch (error) {
|
58
58
|
this.#loadedStyleSheetURL = null;
|
@@ -47,7 +47,7 @@ export default class HTMLScriptElementScriptLoader {
|
|
47
47
|
try {
|
48
48
|
absoluteURL = new URL(
|
49
49
|
url,
|
50
|
-
element[PropertySymbol.ownerDocument][PropertySymbol.ownerWindow].location
|
50
|
+
element[PropertySymbol.ownerDocument][PropertySymbol.ownerWindow].location.href
|
51
51
|
).href;
|
52
52
|
} catch (error) {
|
53
53
|
this.#loadedScriptURL = null;
|
@@ -14,7 +14,6 @@ import IHTMLOptionsCollection from './IHTMLOptionsCollection.js';
|
|
14
14
|
import INode from '../node/INode.js';
|
15
15
|
import NodeTypeEnum from '../node/NodeTypeEnum.js';
|
16
16
|
import HTMLFormElement from '../html-form-element/HTMLFormElement.js';
|
17
|
-
import IHTMLCollection from '../element/IHTMLCollection.js';
|
18
17
|
import HTMLLabelElementUtility from '../html-label-element/HTMLLabelElementUtility.js';
|
19
18
|
import INamedNodeMap from '../../named-node-map/INamedNodeMap.js';
|
20
19
|
import HTMLSelectElementNamedNodeMap from './HTMLSelectElementNamedNodeMap.js';
|
@@ -363,7 +362,7 @@ export default class HTMLSelectElement extends HTMLElement implements IHTMLSelec
|
|
363
362
|
* @param [selectedOption] Selected option.
|
364
363
|
*/
|
365
364
|
public [PropertySymbol.updateOptionItems](selectedOption?: IHTMLOptionElement): void {
|
366
|
-
const optionElements =
|
365
|
+
const optionElements = this.getElementsByTagName('option');
|
367
366
|
|
368
367
|
if (optionElements.length < this[PropertySymbol.options].length) {
|
369
368
|
this[PropertySymbol.options].splice(
|
package/src/nodes/node/Node.ts
CHANGED
@@ -4,7 +4,6 @@ import MutationListener from '../../mutation-observer/MutationListener.js';
|
|
4
4
|
import INode from './INode.js';
|
5
5
|
import IDocument from '../document/IDocument.js';
|
6
6
|
import IElement from '../element/IElement.js';
|
7
|
-
import IHTMLBaseElement from '../html-base-element/IHTMLBaseElement.js';
|
8
7
|
import NodeTypeEnum from './NodeTypeEnum.js';
|
9
8
|
import NodeDocumentPositionEnum from './NodeDocumentPositionEnum.js';
|
10
9
|
import NodeUtility from './NodeUtility.js';
|
@@ -266,7 +265,7 @@ export default class Node extends EventTarget implements INode {
|
|
266
265
|
* @returns Base URI.
|
267
266
|
*/
|
268
267
|
public get baseURI(): string {
|
269
|
-
const base =
|
268
|
+
const base = this[PropertySymbol.ownerDocument].querySelector('base');
|
270
269
|
if (base) {
|
271
270
|
return base.href;
|
272
271
|
}
|
@@ -2,6 +2,8 @@ import IHTMLCollection from '../element/IHTMLCollection.js';
|
|
2
2
|
import IElement from '../element/IElement.js';
|
3
3
|
import INode from '../node/INode.js';
|
4
4
|
import INodeList from '../node/INodeList.js';
|
5
|
+
import IHTMLElementTagNameMap from '../../config/IHTMLElementTagNameMap.js';
|
6
|
+
import ISVGElementTagNameMap from '../../config/ISVGElementTagNameMap.js';
|
5
7
|
|
6
8
|
export default interface IParentNode extends INode {
|
7
9
|
readonly childElementCount: number;
|
@@ -29,8 +31,28 @@ export default interface IParentNode extends INode {
|
|
29
31
|
* @param selector CSS selector.
|
30
32
|
* @returns Matching element.
|
31
33
|
*/
|
34
|
+
querySelector<K extends keyof IHTMLElementTagNameMap>(
|
35
|
+
selector: K
|
36
|
+
): IHTMLElementTagNameMap[K] | null;
|
37
|
+
querySelector<K extends keyof ISVGElementTagNameMap>(
|
38
|
+
selector: K
|
39
|
+
): ISVGElementTagNameMap[K] | null;
|
32
40
|
querySelector(selector: string): IElement | null;
|
33
41
|
|
42
|
+
/**
|
43
|
+
* Query CSS selector to find matching nodes.
|
44
|
+
*
|
45
|
+
* @param selector CSS selector.
|
46
|
+
* @returns Matching elements.
|
47
|
+
*/
|
48
|
+
querySelectorAll<K extends keyof IHTMLElementTagNameMap>(
|
49
|
+
selector: K
|
50
|
+
): INodeList<IHTMLElementTagNameMap[K]>;
|
51
|
+
querySelectorAll<K extends keyof ISVGElementTagNameMap>(
|
52
|
+
selector: K
|
53
|
+
): INodeList<ISVGElementTagNameMap[K]>;
|
54
|
+
querySelectorAll(selector: string): INodeList<IElement>;
|
55
|
+
|
34
56
|
/**
|
35
57
|
* Query CSS selector to find matching nodes.
|
36
58
|
*
|
@@ -53,6 +75,12 @@ export default interface IParentNode extends INode {
|
|
53
75
|
* @param tagName Tag name.
|
54
76
|
* @returns Matching element.
|
55
77
|
*/
|
78
|
+
getElementsByTagName<K extends keyof IHTMLElementTagNameMap>(
|
79
|
+
tagName: K
|
80
|
+
): IHTMLCollection<IHTMLElementTagNameMap[K]>;
|
81
|
+
getElementsByTagName<K extends keyof ISVGElementTagNameMap>(
|
82
|
+
tagName: K
|
83
|
+
): IHTMLCollection<ISVGElementTagNameMap[K]>;
|
56
84
|
getElementsByTagName(tagName: string): IHTMLCollection<IElement>;
|
57
85
|
|
58
86
|
/**
|
@@ -62,6 +90,14 @@ export default interface IParentNode extends INode {
|
|
62
90
|
* @param tagName Tag name.
|
63
91
|
* @returns Matching element.
|
64
92
|
*/
|
93
|
+
getElementsByTagNameNS<K extends keyof IHTMLElementTagNameMap>(
|
94
|
+
namespaceURI: 'http://www.w3.org/1999/xhtml',
|
95
|
+
tagName: K
|
96
|
+
): IHTMLCollection<IHTMLElementTagNameMap[K]>;
|
97
|
+
getElementsByTagNameNS<K extends keyof ISVGElementTagNameMap>(
|
98
|
+
namespaceURI: 'http://www.w3.org/2000/svg',
|
99
|
+
tagName: K
|
100
|
+
): IHTMLCollection<ISVGElementTagNameMap[K]>;
|
65
101
|
getElementsByTagNameNS(namespaceURI: string, tagName: string): IHTMLCollection<IElement>;
|
66
102
|
|
67
103
|
/**
|