happy-dom 13.6.2 → 13.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of happy-dom might be problematic. Click here for more details.
- package/cjs/PropertySymbol.cjs +2 -1
- package/cjs/PropertySymbol.cjs.map +1 -1
- package/cjs/PropertySymbol.d.ts +1 -0
- package/cjs/PropertySymbol.d.ts.map +1 -1
- 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 +10 -34
- package/cjs/fetch/Fetch.cjs.map +1 -1
- package/cjs/fetch/Fetch.d.ts +0 -10
- package/cjs/fetch/Fetch.d.ts.map +1 -1
- package/cjs/fetch/Request.cjs +2 -2
- package/cjs/fetch/Request.cjs.map +1 -1
- package/cjs/fetch/Response.cjs +2 -6
- package/cjs/fetch/Response.cjs.map +1 -1
- package/cjs/fetch/Response.d.ts.map +1 -1
- package/cjs/fetch/SyncFetch.cjs +3 -3
- package/cjs/fetch/SyncFetch.cjs.map +1 -1
- package/cjs/fetch/utilities/FetchBodyUtility.cjs +62 -19
- package/cjs/fetch/utilities/FetchBodyUtility.cjs.map +1 -1
- package/cjs/fetch/utilities/FetchBodyUtility.d.ts +24 -12
- package/cjs/fetch/utilities/FetchBodyUtility.d.ts.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/PropertySymbol.d.ts +1 -0
- package/lib/PropertySymbol.d.ts.map +1 -1
- package/lib/PropertySymbol.js +1 -0
- package/lib/PropertySymbol.js.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.d.ts +0 -10
- package/lib/fetch/Fetch.d.ts.map +1 -1
- package/lib/fetch/Fetch.js +10 -34
- 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/Response.d.ts.map +1 -1
- package/lib/fetch/Response.js +2 -6
- package/lib/fetch/Response.js.map +1 -1
- package/lib/fetch/SyncFetch.js +3 -3
- package/lib/fetch/SyncFetch.js.map +1 -1
- package/lib/fetch/utilities/FetchBodyUtility.d.ts +24 -12
- package/lib/fetch/utilities/FetchBodyUtility.d.ts.map +1 -1
- package/lib/fetch/utilities/FetchBodyUtility.js +62 -19
- package/lib/fetch/utilities/FetchBodyUtility.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/PropertySymbol.ts +1 -0
- 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 +151 -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 +28 -37
- package/src/fetch/Request.ts +2 -2
- package/src/fetch/Response.ts +3 -6
- package/src/fetch/SyncFetch.ts +3 -3
- package/src/fetch/utilities/FetchBodyUtility.ts +67 -20
- 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
@@ -34,6 +34,8 @@ import WindowBrowserSettingsReader from '../../window/WindowBrowserSettingsReade
|
|
34
34
|
import BrowserErrorCaptureEnum from '../../browser/enums/BrowserErrorCaptureEnum.js';
|
35
35
|
import NodeFactory from '../NodeFactory.js';
|
36
36
|
import NodeTypeEnum from '../node/NodeTypeEnum.js';
|
37
|
+
import IHTMLElementTagNameMap from '../../config/IHTMLElementTagNameMap.js';
|
38
|
+
import ISVGElementTagNameMap from '../../config/ISVGElementTagNameMap.js';
|
37
39
|
|
38
40
|
/**
|
39
41
|
* Element.
|
@@ -875,6 +877,34 @@ export default class Element extends Node implements IElement {
|
|
875
877
|
* @param selector CSS selector.
|
876
878
|
* @returns Matching elements.
|
877
879
|
*/
|
880
|
+
public querySelectorAll<K extends keyof IHTMLElementTagNameMap>(
|
881
|
+
selector: K
|
882
|
+
): INodeList<IHTMLElementTagNameMap[K]>;
|
883
|
+
|
884
|
+
/**
|
885
|
+
* Query CSS selector to find matching elments.
|
886
|
+
*
|
887
|
+
* @param selector CSS selector.
|
888
|
+
* @returns Matching elements.
|
889
|
+
*/
|
890
|
+
public querySelectorAll<K extends keyof ISVGElementTagNameMap>(
|
891
|
+
selector: K
|
892
|
+
): INodeList<ISVGElementTagNameMap[K]>;
|
893
|
+
|
894
|
+
/**
|
895
|
+
* Query CSS selector to find matching elments.
|
896
|
+
*
|
897
|
+
* @param selector CSS selector.
|
898
|
+
* @returns Matching elements.
|
899
|
+
*/
|
900
|
+
public querySelectorAll(selector: string): INodeList<IElement>;
|
901
|
+
|
902
|
+
/**
|
903
|
+
* Query CSS selector to find matching elments.
|
904
|
+
*
|
905
|
+
* @param selector CSS selector.
|
906
|
+
* @returns Matching elements.
|
907
|
+
*/
|
878
908
|
public querySelectorAll(selector: string): INodeList<IElement> {
|
879
909
|
return QuerySelector.querySelectorAll(this, selector);
|
880
910
|
}
|
@@ -885,7 +915,35 @@ export default class Element extends Node implements IElement {
|
|
885
915
|
* @param selector CSS selector.
|
886
916
|
* @returns Matching element.
|
887
917
|
*/
|
888
|
-
public querySelector
|
918
|
+
public querySelector<K extends keyof IHTMLElementTagNameMap>(
|
919
|
+
selector: K
|
920
|
+
): IHTMLElementTagNameMap[K] | null;
|
921
|
+
|
922
|
+
/**
|
923
|
+
* Query CSS Selector to find matching node.
|
924
|
+
*
|
925
|
+
* @param selector CSS selector.
|
926
|
+
* @returns Matching element.
|
927
|
+
*/
|
928
|
+
public querySelector<K extends keyof ISVGElementTagNameMap>(
|
929
|
+
selector: K
|
930
|
+
): ISVGElementTagNameMap[K] | null;
|
931
|
+
|
932
|
+
/**
|
933
|
+
* Query CSS Selector to find matching node.
|
934
|
+
*
|
935
|
+
* @param selector CSS selector.
|
936
|
+
* @returns Matching element.
|
937
|
+
*/
|
938
|
+
public querySelector(selector: string): IElement | null;
|
939
|
+
|
940
|
+
/**
|
941
|
+
* Query CSS Selector to find matching node.
|
942
|
+
*
|
943
|
+
* @param selector CSS selector.
|
944
|
+
* @returns Matching element.
|
945
|
+
*/
|
946
|
+
public querySelector(selector: string): IElement | null {
|
889
947
|
return QuerySelector.querySelector(this, selector);
|
890
948
|
}
|
891
949
|
|
@@ -899,6 +957,34 @@ export default class Element extends Node implements IElement {
|
|
899
957
|
return ParentNodeUtility.getElementsByClassName(this, className);
|
900
958
|
}
|
901
959
|
|
960
|
+
/**
|
961
|
+
* Returns an elements by tag name.
|
962
|
+
*
|
963
|
+
* @param tagName Tag name.
|
964
|
+
* @returns Matching element.
|
965
|
+
*/
|
966
|
+
public getElementsByTagName<K extends keyof IHTMLElementTagNameMap>(
|
967
|
+
tagName: K
|
968
|
+
): IHTMLCollection<IHTMLElementTagNameMap[K]>;
|
969
|
+
|
970
|
+
/**
|
971
|
+
* Returns an elements by tag name.
|
972
|
+
*
|
973
|
+
* @param tagName Tag name.
|
974
|
+
* @returns Matching element.
|
975
|
+
*/
|
976
|
+
public getElementsByTagName<K extends keyof ISVGElementTagNameMap>(
|
977
|
+
tagName: K
|
978
|
+
): IHTMLCollection<ISVGElementTagNameMap[K]>;
|
979
|
+
|
980
|
+
/**
|
981
|
+
* Returns an elements by tag name.
|
982
|
+
*
|
983
|
+
* @param tagName Tag name.
|
984
|
+
* @returns Matching element.
|
985
|
+
*/
|
986
|
+
public getElementsByTagName(tagName: string): IHTMLCollection<IElement>;
|
987
|
+
|
902
988
|
/**
|
903
989
|
* Returns an elements by tag name.
|
904
990
|
*
|
@@ -909,6 +995,39 @@ export default class Element extends Node implements IElement {
|
|
909
995
|
return ParentNodeUtility.getElementsByTagName(this, tagName);
|
910
996
|
}
|
911
997
|
|
998
|
+
/**
|
999
|
+
* Returns an elements by tag name and namespace.
|
1000
|
+
*
|
1001
|
+
* @param namespaceURI Namespace URI.
|
1002
|
+
* @param tagName Tag name.
|
1003
|
+
* @returns Matching element.
|
1004
|
+
*/
|
1005
|
+
public getElementsByTagNameNS<K extends keyof IHTMLElementTagNameMap>(
|
1006
|
+
namespaceURI: 'http://www.w3.org/1999/xhtml',
|
1007
|
+
tagName: K
|
1008
|
+
): IHTMLCollection<IHTMLElementTagNameMap[K]>;
|
1009
|
+
|
1010
|
+
/**
|
1011
|
+
* Returns an elements by tag name and namespace.
|
1012
|
+
*
|
1013
|
+
* @param namespaceURI Namespace URI.
|
1014
|
+
* @param tagName Tag name.
|
1015
|
+
* @returns Matching element.
|
1016
|
+
*/
|
1017
|
+
public getElementsByTagNameNS<K extends keyof ISVGElementTagNameMap>(
|
1018
|
+
namespaceURI: 'http://www.w3.org/2000/svg',
|
1019
|
+
tagName: K
|
1020
|
+
): IHTMLCollection<ISVGElementTagNameMap[K]>;
|
1021
|
+
|
1022
|
+
/**
|
1023
|
+
* Returns an elements by tag name and namespace.
|
1024
|
+
*
|
1025
|
+
* @param namespaceURI Namespace URI.
|
1026
|
+
* @param tagName Tag name.
|
1027
|
+
* @returns Matching element.
|
1028
|
+
*/
|
1029
|
+
public getElementsByTagNameNS(namespaceURI: string, tagName: string): IHTMLCollection<IElement>;
|
1030
|
+
|
912
1031
|
/**
|
913
1032
|
* Returns an elements by tag name and namespace.
|
914
1033
|
*
|
@@ -81,6 +81,7 @@ export default class HTMLCollection<T> extends Array implements IHTMLCollection<
|
|
81
81
|
*/
|
82
82
|
protected [PropertySymbol.isValidPropertyName](name: string): boolean {
|
83
83
|
return (
|
84
|
+
!!name &&
|
84
85
|
!this.constructor.prototype.hasOwnProperty(name) &&
|
85
86
|
!Array.prototype.hasOwnProperty(name) &&
|
86
87
|
(isNaN(Number(name)) || name.includes('.'))
|
@@ -9,6 +9,7 @@ import INamedNodeMap from '../../named-node-map/INamedNodeMap.js';
|
|
9
9
|
import HTMLAnchorElementNamedNodeMap from './HTMLAnchorElementNamedNodeMap.js';
|
10
10
|
import Event from '../../event/Event.js';
|
11
11
|
import EventPhaseEnum from '../../event/EventPhaseEnum.js';
|
12
|
+
import PointerEvent from '../../event/events/PointerEvent.js';
|
12
13
|
|
13
14
|
/**
|
14
15
|
* HTML Anchor Element.
|
@@ -429,6 +430,7 @@ export default class HTMLAnchorElement extends HTMLElement implements IHTMLAncho
|
|
429
430
|
|
430
431
|
if (
|
431
432
|
event.type === 'click' &&
|
433
|
+
event instanceof PointerEvent &&
|
432
434
|
(event.eventPhase === EventPhaseEnum.atTarget ||
|
433
435
|
event.eventPhase === EventPhaseEnum.bubbling) &&
|
434
436
|
!event.defaultPrevented &&
|
@@ -12,6 +12,8 @@ import INode from '../node/INode.js';
|
|
12
12
|
import INodeList from '../node/INodeList.js';
|
13
13
|
import HTMLButtonElementNamedNodeMap from './HTMLButtonElementNamedNodeMap.js';
|
14
14
|
import IHTMLButtonElement from './IHTMLButtonElement.js';
|
15
|
+
import PointerEvent from '../../event/events/PointerEvent.js';
|
16
|
+
import { URL } from 'url';
|
15
17
|
|
16
18
|
const BUTTON_TYPES = ['submit', 'reset', 'button', 'menu'];
|
17
19
|
|
@@ -122,6 +124,71 @@ export default class HTMLButtonElement extends HTMLElement implements IHTMLButto
|
|
122
124
|
this.setAttribute('type', this.#sanitizeType(v));
|
123
125
|
}
|
124
126
|
|
127
|
+
/**
|
128
|
+
* Returns form action.
|
129
|
+
*
|
130
|
+
* @returns Form action.
|
131
|
+
*/
|
132
|
+
public get formAction(): string {
|
133
|
+
if (!this.hasAttribute('formaction')) {
|
134
|
+
return this[PropertySymbol.ownerDocument].location.href;
|
135
|
+
}
|
136
|
+
|
137
|
+
try {
|
138
|
+
return new URL(
|
139
|
+
this.getAttribute('formaction') || '',
|
140
|
+
this[PropertySymbol.ownerDocument].location.href
|
141
|
+
).href;
|
142
|
+
} catch (e) {
|
143
|
+
return '';
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Sets form action.
|
149
|
+
*
|
150
|
+
* @param formAction Form action.
|
151
|
+
*/
|
152
|
+
public set formAction(formAction: string) {
|
153
|
+
this.setAttribute('formaction', formAction);
|
154
|
+
}
|
155
|
+
|
156
|
+
/**
|
157
|
+
* Returns form enctype.
|
158
|
+
*
|
159
|
+
* @returns Form enctype.
|
160
|
+
*/
|
161
|
+
public get formEnctype(): string {
|
162
|
+
return this.getAttribute('formenctype') || '';
|
163
|
+
}
|
164
|
+
|
165
|
+
/**
|
166
|
+
* Sets form enctype.
|
167
|
+
*
|
168
|
+
* @param formEnctype Form enctype.
|
169
|
+
*/
|
170
|
+
public set formEnctype(formEnctype: string) {
|
171
|
+
this.setAttribute('formenctype', formEnctype);
|
172
|
+
}
|
173
|
+
|
174
|
+
/**
|
175
|
+
* Returns form method.
|
176
|
+
*
|
177
|
+
* @returns Form method.
|
178
|
+
*/
|
179
|
+
public get formMethod(): string {
|
180
|
+
return this.getAttribute('formmethod') || '';
|
181
|
+
}
|
182
|
+
|
183
|
+
/**
|
184
|
+
* Sets form method.
|
185
|
+
*
|
186
|
+
* @param formMethod Form method.
|
187
|
+
*/
|
188
|
+
public set formMethod(formMethod: string) {
|
189
|
+
this.setAttribute('formmethod', formMethod);
|
190
|
+
}
|
191
|
+
|
125
192
|
/**
|
126
193
|
* Returns no validate.
|
127
194
|
*
|
@@ -144,13 +211,40 @@ export default class HTMLButtonElement extends HTMLElement implements IHTMLButto
|
|
144
211
|
}
|
145
212
|
}
|
146
213
|
|
214
|
+
/**
|
215
|
+
* Returns form target.
|
216
|
+
*
|
217
|
+
* @returns Form target.
|
218
|
+
*/
|
219
|
+
public get formTarget(): string {
|
220
|
+
return this.getAttribute('formtarget') || '';
|
221
|
+
}
|
222
|
+
|
223
|
+
/**
|
224
|
+
* Sets form target.
|
225
|
+
*
|
226
|
+
* @param formTarget Form target.
|
227
|
+
*/
|
228
|
+
public set formTarget(formTarget: string) {
|
229
|
+
this.setAttribute('formtarget', formTarget);
|
230
|
+
}
|
231
|
+
|
147
232
|
/**
|
148
233
|
* Returns the parent form element.
|
149
234
|
*
|
150
235
|
* @returns Form.
|
151
236
|
*/
|
152
|
-
public get form(): IHTMLFormElement {
|
153
|
-
|
237
|
+
public get form(): IHTMLFormElement | null {
|
238
|
+
if (this[PropertySymbol.formNode]) {
|
239
|
+
return <IHTMLFormElement>this[PropertySymbol.formNode];
|
240
|
+
}
|
241
|
+
if (!this.isConnected) {
|
242
|
+
return null;
|
243
|
+
}
|
244
|
+
const formID = this.getAttribute('form');
|
245
|
+
return formID
|
246
|
+
? <IHTMLFormElement>this[PropertySymbol.ownerDocument].getElementById(formID)
|
247
|
+
: null;
|
154
248
|
}
|
155
249
|
|
156
250
|
/**
|
@@ -201,7 +295,12 @@ export default class HTMLButtonElement extends HTMLElement implements IHTMLButto
|
|
201
295
|
* @override
|
202
296
|
*/
|
203
297
|
public override dispatchEvent(event: Event): boolean {
|
204
|
-
if (
|
298
|
+
if (
|
299
|
+
event.type === 'click' &&
|
300
|
+
event instanceof PointerEvent &&
|
301
|
+
event.eventPhase === EventPhaseEnum.none &&
|
302
|
+
this.disabled
|
303
|
+
) {
|
205
304
|
return false;
|
206
305
|
}
|
207
306
|
|
@@ -209,12 +308,15 @@ export default class HTMLButtonElement extends HTMLElement implements IHTMLButto
|
|
209
308
|
|
210
309
|
if (
|
211
310
|
event.type === 'click' &&
|
311
|
+
event instanceof PointerEvent &&
|
212
312
|
(event.eventPhase === EventPhaseEnum.atTarget ||
|
213
313
|
event.eventPhase === EventPhaseEnum.bubbling) &&
|
214
|
-
this[PropertySymbol.formNode] &&
|
215
314
|
this[PropertySymbol.isConnected]
|
216
315
|
) {
|
217
|
-
const form =
|
316
|
+
const form = this.form;
|
317
|
+
if (!form) {
|
318
|
+
return returnValue;
|
319
|
+
}
|
218
320
|
switch (this.type) {
|
219
321
|
case 'submit':
|
220
322
|
form.requestSubmit(this);
|
@@ -15,9 +15,13 @@ export default interface IHTMLButtonElement extends IHTMLElement {
|
|
15
15
|
value: string;
|
16
16
|
disabled: boolean;
|
17
17
|
type: string;
|
18
|
+
formAction: string;
|
19
|
+
formEnctype: string;
|
20
|
+
formMethod: string;
|
18
21
|
formNoValidate: boolean;
|
22
|
+
formTarget: string;
|
19
23
|
readonly validity: ValidityState;
|
20
|
-
readonly form: IHTMLFormElement;
|
24
|
+
readonly form: IHTMLFormElement | null;
|
21
25
|
readonly validationMessage: string;
|
22
26
|
readonly labels: INodeList<IHTMLLabelElement>;
|
23
27
|
|
@@ -118,6 +118,7 @@ export default class HTMLFormControlsCollection
|
|
118
118
|
*/
|
119
119
|
protected [PropertySymbol.isValidPropertyName](name: string): boolean {
|
120
120
|
return (
|
121
|
+
!!name &&
|
121
122
|
!this.constructor.prototype.hasOwnProperty(name) &&
|
122
123
|
!Array.prototype.hasOwnProperty(name) &&
|
123
124
|
(isNaN(Number(name)) || name.includes('.'))
|
@@ -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
|
|