Skip to content

Commit

Permalink
feat: [#1332] Adds basic implementation for remaining HTML elements
Browse files Browse the repository at this point in the history
  • Loading branch information
capricorn86 committed Mar 24, 2024
1 parent 0ee95b7 commit 63fbf5b
Show file tree
Hide file tree
Showing 93 changed files with 1,726 additions and 241 deletions.
124 changes: 53 additions & 71 deletions packages/happy-dom/src/config/HTMLElementConfig.ts

Large diffs are not rendered by default.

162 changes: 106 additions & 56 deletions packages/happy-dom/src/config/IHTMLElementTagNameMap.ts
@@ -1,3 +1,56 @@
import HTMLUListElement from '../nodes/html-u-list-element/HTMLUListElement.js';
import HTMLTrackElement from '../nodes/html-track-element/HTMLTrackElement.js';
import HTMLTableRowElement from '../nodes/html-table-row-element/HTMLTableRowElement.js';
import HTMLTitleElement from '../nodes/html-title-element/HTMLTitleElement.js';
import HTMLTimeElement from '../nodes/html-time-element/HTMLTimeElement.js';
import HTMLTableSectionElement from '../nodes/html-table-section-element/HTMLTableSectionElement.js';
import HTMLTableCellElement from '../nodes/html-table-cell-element/HTMLTableCellElement.js';
import HTMLTableSectionElement from '../nodes/html-table-section-element/HTMLTableSectionElement.js';
import HTMLTableCellElement from '../nodes/html-table-cell-element/HTMLTableCellElement.js';
import HTMLTableSectionElement from '../nodes/html-table-section-element/HTMLTableSectionElement.js';
import HTMLTableElement from '../nodes/html-table-element/HTMLTableElement.js';
import HTMLSpanElement from '../nodes/html-span-element/HTMLSpanElement.js';
import HTMLSourceElement from '../nodes/html-source-element/HTMLSourceElement.js';
import HTMLQuoteElement from '../nodes/html-quote-element/HTMLQuoteElement.js';
import HTMLProgressElement from '../nodes/html-progress-element/HTMLProgressElement.js';
import HTMLPreElement from '../nodes/html-pre-element/HTMLPreElement.js';
import HTMLPictureElement from '../nodes/html-picture-element/HTMLPictureElement.js';
import HTMLParamElement from '../nodes/html-param-element/HTMLParamElement.js';
import HTMLParagraphElement from '../nodes/html-paragraph-element/HTMLParagraphElement.js';
import HTMLOutputElement from '../nodes/html-output-element/HTMLOutputElement.js';
import HTMLOListElement from '../nodes/html-o-list-element/HTMLOListElement.js';
import HTMLObjectElement from '../nodes/html-object-element/HTMLObjectElement.js';
import HTMLMeterElement from '../nodes/html-meter-element/HTMLMeterElement.js';
import HTMLMenuElement from '../nodes/html-menu-element/HTMLMenuElement.js';
import HTMLMapElement from '../nodes/html-map-element/HTMLMapElement.js';
import HTMLLIElement from '../nodes/html-li-element/HTMLLIElement.js';
import HTMLLegendElement from '../nodes/html-legend-element/HTMLLegendElement.js';
import HTMLModElement from '../nodes/html-mod-element/HTMLModElement.js';
import HTMLHtmlElement from '../nodes/html-html-element/HTMLHtmlElement.js';
import HTMLHRElement from '../nodes/html-hr-element/HTMLHRElement.js';
import HTMLHeadElement from '../nodes/html-head-element/HTMLHeadElement.js';
import HTMLHeadingElement from '../nodes/html-heading-element/HTMLHeadingElement.js';
import HTMLHeadingElement from '../nodes/html-heading-element/HTMLHeadingElement.js';
import HTMLHeadingElement from '../nodes/html-heading-element/HTMLHeadingElement.js';
import HTMLHeadingElement from '../nodes/html-heading-element/HTMLHeadingElement.js';
import HTMLHeadingElement from '../nodes/html-heading-element/HTMLHeadingElement.js';
import HTMLHeadingElement from '../nodes/html-heading-element/HTMLHeadingElement.js';
import HTMLFieldSetElement from '../nodes/html-field-set-element/HTMLFieldSetElement.js';
import HTMLEmbedElement from '../nodes/html-embed-element/HTMLEmbedElement.js';
import HTMLDListElement from '../nodes/html-d-list-element/HTMLDListElement.js';
import HTMLDivElement from '../nodes/html-div-element/HTMLDivElement.js';
import HTMLDetailsElement from '../nodes/html-details-element/HTMLDetailsElement.js';
import HTMLModElement from '../nodes/html-mod-element/HTMLModElement.js';
import HTMLDataListElement from '../nodes/html-data-list-element/HTMLDataListElement.js';
import HTMLDataElement from '../nodes/html-data-element/HTMLDataElement.js';
import HTMLTableColElement from '../nodes/html-table-col-element/HTMLTableColElement.js';
import HTMLTableColElement from '../nodes/html-table-col-element/HTMLTableColElement.js';
import HTMLTableCaptionElement from '../nodes/html-table-caption-element/HTMLTableCaptionElement.js';
import HTMLCanvasElement from '../nodes/html-canvas-element/HTMLCanvasElement.js';
import HTMLBRElement from '../nodes/html-br-element/HTMLBRElement.js';
import HTMLQuoteElement from '../nodes/html-quote-element/HTMLQuoteElement.js';
import HTMLBodyElement from '../nodes/html-body-element/HTMLBodyElement.js';
import HTMLAreaElement from '../nodes/html-area-element/HTMLAreaElement.js';
import HTMLAnchorElement from '../nodes/html-anchor-element/HTMLAnchorElement.js';
import HTMLElement from '../nodes/html-element/HTMLElement.js';
import HTMLAudioElement from '../nodes/html-audio-element/HTMLAudioElement.js';
Expand Down Expand Up @@ -34,16 +87,15 @@ export default interface IHTMLElementTagNameMap extends HTMLElementTagNameMap {
a: HTMLAnchorElement;
abbr: HTMLElement;
address: HTMLElement;
area: HTMLElement;
area: HTMLAreaElement;
article: HTMLElement;
aside: HTMLElement;
audio: HTMLAudioElement;
b: HTMLElement;
base: HTMLBaseElement;
bdi: HTMLElement;
bdo: HTMLElement;
blockquaote: HTMLElement;
body: HTMLElement;
body: HTMLBodyElement;
template: HTMLTemplateElement;
form: HTMLFormElement;
input: HTMLInputElement;
Expand All @@ -55,68 +107,66 @@ export default interface IHTMLElementTagNameMap extends HTMLElementTagNameMap {
label: HTMLLabelElement;
slot: HTMLSlotElement;
meta: HTMLMetaElement;
blockquote: HTMLElement;
br: HTMLElement;
blockquote: HTMLQuoteElement;
br: HTMLBRElement;
button: HTMLButtonElement;
canvas: HTMLElement;
caption: HTMLElement;
canvas: HTMLCanvasElement;
caption: HTMLTableCaptionElement;
cite: HTMLElement;
code: HTMLElement;
col: HTMLElement;
colgroup: HTMLElement;
data: HTMLElement;
datalist: HTMLElement;
col: HTMLTableColElement;
colgroup: HTMLTableColElement;
data: HTMLDataElement;
datalist: HTMLDataListElement;
dd: HTMLElement;
del: HTMLElement;
details: HTMLElement;
del: HTMLModElement;
details: HTMLDetailsElement;
dfn: HTMLElement;
dialog: HTMLDialogElement;
div: HTMLElement;
dl: HTMLElement;
div: HTMLDivElement;
dl: HTMLDListElement;
dt: HTMLElement;
em: HTMLElement;
embed: HTMLElement;
fieldset: HTMLElement;
embed: HTMLEmbedElement;
fieldset: HTMLFieldSetElement;
figcaption: HTMLElement;
figure: HTMLElement;
footer: HTMLElement;
h1: HTMLElement;
h2: HTMLElement;
h3: HTMLElement;
h4: HTMLElement;
h5: HTMLElement;
h6: HTMLElement;
head: HTMLElement;
h1: HTMLHeadingElement;
h2: HTMLHeadingElement;
h3: HTMLHeadingElement;
h4: HTMLHeadingElement;
h5: HTMLHeadingElement;
h6: HTMLHeadingElement;
head: HTMLHeadElement;
header: HTMLElement;
hgroup: HTMLElement;
hr: HTMLElement;
html: HTMLElement;
hr: HTMLHRElement;
html: HTMLHtmlElement;
i: HTMLElement;
iframe: HTMLIFrameElement;
ins: HTMLElement;
ins: HTMLModElement;
kbd: HTMLElement;
legend: HTMLElement;
li: HTMLElement;
legend: HTMLLegendElement;
li: HTMLLIElement;
main: HTMLElement;
map: HTMLElement;
map: HTMLMapElement;
mark: HTMLElement;
math: HTMLElement;
menu: HTMLElement;
menuitem: HTMLElement;
meter: HTMLElement;
menu: HTMLMenuElement;
meter: HTMLMeterElement;
nav: HTMLElement;
noscript: HTMLElement;
object: HTMLElement;
ol: HTMLElement;
object: HTMLObjectElement;
ol: HTMLOListElement;
optgroup: HTMLOptGroupElement;
option: HTMLOptionElement;
output: HTMLElement;
p: HTMLElement;
param: HTMLElement;
picture: HTMLElement;
pre: HTMLElement;
progress: HTMLElement;
q: HTMLElement;
output: HTMLOutputElement;
p: HTMLParagraphElement;
param: HTMLParamElement;
picture: HTMLPictureElement;
pre: HTMLPreElement;
progress: HTMLProgressElement;
q: HTMLQuoteElement;
rb: HTMLElement;
rp: HTMLElement;
rt: HTMLElement;
Expand All @@ -127,24 +177,24 @@ export default interface IHTMLElementTagNameMap extends HTMLElementTagNameMap {
section: HTMLElement;
select: HTMLSelectElement;
small: HTMLElement;
source: HTMLElement;
span: HTMLElement;
source: HTMLSourceElement;
span: HTMLSpanElement;
strong: HTMLElement;
sub: HTMLElement;
summary: HTMLElement;
sup: HTMLElement;
table: HTMLElement;
tbody: HTMLElement;
td: HTMLElement;
tfoot: HTMLElement;
th: HTMLElement;
thead: HTMLElement;
time: HTMLElement;
title: HTMLElement;
tr: HTMLElement;
track: HTMLElement;
table: HTMLTableElement;
tbody: HTMLTableSectionElement;
td: HTMLTableCellElement;
tfoot: HTMLTableSectionElement;
th: HTMLTableCellElement;
thead: HTMLTableSectionElement;
time: HTMLTimeElement;
title: HTMLTitleElement;
tr: HTMLTableRowElement;
track: HTMLTrackElement;
u: HTMLElement;
ul: HTMLElement;
ul: HTMLUListElement;
var: HTMLElement;
video: HTMLVideoElement;
wbr: HTMLElement;
Expand Down
134 changes: 87 additions & 47 deletions packages/happy-dom/src/index.ts
@@ -1,3 +1,48 @@
import HTMLUListElement from './nodes/html-u-list-element/HTMLUListElement.js';
import HTMLTrackElement from './nodes/html-track-element/HTMLTrackElement.js';
import HTMLTableRowElement from './nodes/html-table-row-element/HTMLTableRowElement.js';
import HTMLTitleElement from './nodes/html-title-element/HTMLTitleElement.js';
import HTMLTimeElement from './nodes/html-time-element/HTMLTimeElement.js';
import HTMLTableSectionElement from './nodes/html-table-section-element/HTMLTableSectionElement.js';
import HTMLTableCellElement from './nodes/html-table-cell-element/HTMLTableCellElement.js';
import HTMLTableElement from './nodes/html-table-element/HTMLTableElement.js';
import HTMLSpanElement from './nodes/html-span-element/HTMLSpanElement.js';
import HTMLSourceElement from './nodes/html-source-element/HTMLSourceElement.js';
import HTMLQuoteElement from './nodes/html-quote-element/HTMLQuoteElement.js';
import HTMLProgressElement from './nodes/html-progress-element/HTMLProgressElement.js';
import HTMLPreElement from './nodes/html-pre-element/HTMLPreElement.js';
import HTMLPictureElement from './nodes/html-picture-element/HTMLPictureElement.js';
import HTMLParamElement from './nodes/html-param-element/HTMLParamElement.js';
import HTMLParagraphElement from './nodes/html-paragraph-element/HTMLParagraphElement.js';
import HTMLOutputElement from './nodes/html-output-element/HTMLOutputElement.js';
import HTMLOListElement from './nodes/html-o-list-element/HTMLOListElement.js';
import HTMLObjectElement from './nodes/html-object-element/HTMLObjectElement.js';
import HTMLMeterElement from './nodes/html-meter-element/HTMLMeterElement.js';
import HTMLMenuElement from './nodes/html-menu-element/HTMLMenuElement.js';
import HTMLMapElement from './nodes/html-map-element/HTMLMapElement.js';
import HTMLLIElement from './nodes/html-li-element/HTMLLIElement.js';
import HTMLLegendElement from './nodes/html-legend-element/HTMLLegendElement.js';
import HTMLModElement from './nodes/html-mod-element/HTMLModElement.js';
import HTMLHtmlElement from './nodes/html-html-element/HTMLHtmlElement.js';
import HTMLHRElement from './nodes/html-hr-element/HTMLHRElement.js';
import HTMLHeadElement from './nodes/html-head-element/HTMLHeadElement.js';
import HTMLHeadingElement from './nodes/html-heading-element/HTMLHeadingElement.js';
import HTMLFieldSetElement from './nodes/html-field-set-element/HTMLFieldSetElement.js';
import HTMLEmbedElement from './nodes/html-embed-element/HTMLEmbedElement.js';
import HTMLDListElement from './nodes/html-d-list-element/HTMLDListElement.js';
import HTMLDivElement from './nodes/html-div-element/HTMLDivElement.js';
import HTMLDetailsElement from './nodes/html-details-element/HTMLDetailsElement.js';
import HTMLModElement from './nodes/html-mod-element/HTMLModElement.js';
import HTMLDataListElement from './nodes/html-data-list-element/HTMLDataListElement.js';
import HTMLDataElement from './nodes/html-data-element/HTMLDataElement.js';
import HTMLTableColElement from './nodes/html-table-col-element/HTMLTableColElement.js';
import HTMLTableColElement from './nodes/html-table-col-element/HTMLTableColElement.js';
import HTMLTableCaptionElement from './nodes/html-table-caption-element/HTMLTableCaptionElement.js';
import HTMLCanvasElement from './nodes/html-canvas-element/HTMLCanvasElement.js';
import HTMLBRElement from './nodes/html-br-element/HTMLBRElement.js';
import HTMLQuoteElement from './nodes/html-quote-element/HTMLQuoteElement.js';
import HTMLBodyElement from './nodes/html-body-element/HTMLBodyElement.js';
import HTMLAreaElement from './nodes/html-area-element/HTMLAreaElement.js';
import { URLSearchParams } from 'url';
import Browser from './browser/Browser.js';
import BrowserContext from './browser/BrowserContext.js';
Expand Down Expand Up @@ -178,6 +223,48 @@ export type {
};

export {
HTMLUListElement,
HTMLTrackElement,
HTMLTableRowElement,
HTMLTitleElement,
HTMLTimeElement,
HTMLTableSectionElement,
HTMLTableCellElement,
HTMLTableElement,
HTMLSpanElement,
HTMLSourceElement,
HTMLQuoteElement,
HTMLProgressElement,
HTMLPreElement,
HTMLPictureElement,
HTMLParamElement,
HTMLParagraphElement,
HTMLOutputElement,
HTMLOListElement,
HTMLObjectElement,
HTMLMeterElement,
HTMLMenuElement,
HTMLMapElement,
HTMLLIElement,
HTMLLegendElement,
HTMLModElement,
HTMLHtmlElement,
HTMLHRElement,
HTMLHeadElement,
HTMLHeadingElement,
HTMLFieldSetElement,
HTMLEmbedElement,
HTMLDListElement,
HTMLDivElement,
HTMLDetailsElement,
HTMLDataListElement,
HTMLDataElement,
HTMLTableColElement,
HTMLTableCaptionElement,
HTMLCanvasElement,
HTMLBRElement,
HTMLBodyElement,
HTMLAreaElement,
AbortController,
AbortSignal,
AnimationEvent,
Expand Down Expand Up @@ -231,77 +318,30 @@ export {
FormData,
GlobalWindow,
HTMLAnchorElement,
HTMLElement as HTMLAreaElement,
HTMLAudioElement,
HTMLElement as HTMLBRElement,
HTMLBaseElement,
HTMLElement as HTMLBodyElement,
HTMLButtonElement,
HTMLElement as HTMLCanvasElement,
HTMLCollection,
HTMLElement as HTMLDListElement,
HTMLElement as HTMLDataElement,
HTMLElement as HTMLDataListElement,
HTMLElement as HTMLDetailsElement,
HTMLDialogElement,
HTMLElement as HTMLDirectoryElement,
HTMLElement as HTMLDivElement,
HTMLDocument,
HTMLElement,
HTMLElement as HTMLEmbedElement,
HTMLElement as HTMLFieldSetElement,
HTMLElement as HTMLFontElement,
HTMLFormControlsCollection,
HTMLFormElement,
HTMLElement as HTMLFrameElement,
HTMLElement as HTMLFrameSetElement,
HTMLElement as HTMLHRElement,
HTMLElement as HTMLHeadElement,
HTMLElement as HTMLHeadingElement,
HTMLElement as HTMLHtmlElement,
HTMLIFrameElement,
HTMLImageElement,
HTMLInputElement,
HTMLElement as HTMLLElement,
HTMLLabelElement,
HTMLElement as HTMLLegendElement,
HTMLLinkElement,
HTMLElement as HTMLMapElement,
HTMLElement as HTMLMarqueeElement,
HTMLMediaElement,
HTMLElement as HTMLMenuElement,
HTMLMetaElement,
HTMLElement as HTMLMeterElement,
HTMLElement as HTMLModElement,
HTMLElement as HTMLOListElement,
HTMLElement as HTMLObjectElement,
HTMLOptGroupElement,
HTMLOptionElement,
HTMLElement as HTMLOutputElement,
HTMLElement as HTMLParagraphElement,
HTMLElement as HTMLParamElement,
HTMLElement as HTMLPictureElement,
HTMLElement as HTMLPreElement,
HTMLElement as HTMLProgressElement,
HTMLElement as HTMLQuoteElement,
HTMLScriptElement,
HTMLSelectElement,
HTMLSlotElement,
HTMLElement as HTMLSourceElement,
HTMLElement as HTMLSpanElement,
HTMLStyleElement,
HTMLElement as HTMLTableCaptionElement,
HTMLElement as HTMLTableCellElement,
HTMLElement as HTMLTableColElement,
HTMLElement as HTMLTableElement,
HTMLElement as HTMLTableRowElement,
HTMLElement as HTMLTableSectionElement,
HTMLTemplateElement,
HTMLTextAreaElement,
HTMLElement as HTMLTimeElement,
HTMLElement as HTMLTitleElement,
HTMLElement as HTMLTrackElement,
HTMLElement as HTMLUListElement,
HTMLUnknownElement,
HTMLVideoElement,
HashChangeEvent,
Expand Down

0 comments on commit 63fbf5b

Please sign in to comment.