Skip to content

Commit

Permalink
capricorn86#475@minor: Adds support for HTMLMediaElement.
Browse files Browse the repository at this point in the history
  • Loading branch information
rudywaltz committed Oct 7, 2022
1 parent b759778 commit a618a41
Show file tree
Hide file tree
Showing 12 changed files with 941 additions and 5 deletions.
6 changes: 4 additions & 2 deletions packages/happy-dom/src/config/ElementTag.ts
Expand Up @@ -18,6 +18,8 @@ import HTMLOptionElement from '../nodes/html-option-element/HTMLOptionElement';
import HTMLOptGroupElement from '../nodes/html-opt-group-element/HTMLOptGroupElement';
import HTMLDialogElement from '../nodes/html-dialog-element/HTMLDialogElement';
import HTMLButtonElement from '../nodes/html-button-element/HTMLButtonElement';
import HTMLAudioElement from 'src/nodes/html-audio-element/HTMLAudioElement';
import HTMLVideoElement from 'src/nodes/html-video-element/HTMLVideoElement';

export default {
A: HTMLElement,
Expand All @@ -26,7 +28,7 @@ export default {
AREA: HTMLElement,
ARTICLE: HTMLElement,
ASIDE: HTMLElement,
AUDIO: HTMLElement,
AUDIO: HTMLAudioElement,
B: HTMLElement,
BASE: HTMLBaseElement,
BDI: HTMLElement,
Expand Down Expand Up @@ -145,6 +147,6 @@ export default {
U: HTMLElement,
UL: HTMLElement,
VAR: HTMLElement,
VIDEO: HTMLElement,
VIDEO: HTMLVideoElement,
WBR: HTMLElement
};
Expand Up @@ -28,7 +28,6 @@ export default [
'HTMLLegendElement',
'HTMLMapElement',
'HTMLMarqueeElement',
'HTMLMediaElement',
'HTMLMeterElement',
'HTMLModElement',
'HTMLOutputElement',
Expand All @@ -50,7 +49,5 @@ export default [
'HTMLEmbedElement',
'HTMLObjectElement',
'HTMLParamElement',
'HTMLVideoElement',
'HTMLAudioElement',
'HTMLTrackElement'
];
12 changes: 12 additions & 0 deletions packages/happy-dom/src/index.ts
Expand Up @@ -74,6 +74,12 @@ import HTMLLabelElement from './nodes/html-label-element/HTMLLabelElement';
import IHTMLLabelElement from './nodes/html-label-element/IHTMLLabelElement';
import HTMLMetaElement from './nodes/html-meta-element/HTMLMetaElement';
import IHTMLMetaElement from './nodes/html-meta-element/IHTMLMetaElement';
import IHTMLMediaElement from './nodes/html-media-element/IHTMLMediaElement';
import HTMLMediaElement from './nodes/html-media-element/HTMLMediaElement';
import HTMLAudioElement from './nodes/html-audio-element/HTMLAudioElement';
import IHTMLAudioElement from './nodes/html-audio-element/IHTMLAudioElement';
import HTMLVideoElement from './nodes/html-video-element/HTMLVideoElement';
import IHTMLVideoElement from './nodes/html-video-element/IHTMLVideoElement';
import HTMLBaseElement from './nodes/html-base-element/HTMLBaseElement';
import IHTMLBaseElement from './nodes/html-base-element/IHTMLBaseElement';
import SVGElement from './nodes/svg-element/SVGElement';
Expand Down Expand Up @@ -192,6 +198,12 @@ export {
IHTMLLabelElement,
HTMLMetaElement,
IHTMLMetaElement,
HTMLMediaElement,
IHTMLMediaElement,
HTMLAudioElement,
IHTMLAudioElement,
HTMLVideoElement,
IHTMLVideoElement,
HTMLBaseElement,
IHTMLBaseElement,
SVGElement,
Expand Down
@@ -0,0 +1,11 @@
import HTMLMediaElement from '../html-media-element/HTMLMediaElement';
import IHTMLAudioElement from './IHTMLAudioElement';

/**
* HTML Audio Element.
*
* Reference:
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement.
*
*/
export default class HTMLAudioElement extends HTMLMediaElement implements IHTMLAudioElement {}
@@ -0,0 +1,11 @@
import IHTMLMediaElement from '../html-media-element/IHTMLMediaElement';

/**
* HTML Audio Element.
*
* Reference:
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement.
*/

type IHTMLAudioElement = IHTMLMediaElement;
export default IHTMLAudioElement;

0 comments on commit a618a41

Please sign in to comment.