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 Jul 23, 2022
1 parent ec5a307 commit de18f41
Show file tree
Hide file tree
Showing 12 changed files with 934 additions and 5 deletions.
6 changes: 4 additions & 2 deletions packages/happy-dom/src/config/ElementTag.ts
Expand Up @@ -17,6 +17,8 @@ import HTMLSelectElement from '../nodes/html-select-element/HTMLSelectElement';
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 HTMLAudioElement from 'src/nodes/html-audio-element/HTMLAudioElement';
import HTMLVideoElement from 'src/nodes/html-video-element/HTMLVideoElement';

export default {
A: HTMLElement,
Expand All @@ -25,7 +27,7 @@ export default {
AREA: HTMLElement,
ARTICLE: HTMLElement,
ASIDE: HTMLElement,
AUDIO: HTMLElement,
AUDIO: HTMLAudioElement,
B: HTMLElement,
BASE: HTMLBaseElement,
BDI: HTMLElement,
Expand Down Expand Up @@ -144,6 +146,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'
];
4 changes: 4 additions & 0 deletions packages/happy-dom/src/index.ts
Expand Up @@ -74,6 +74,8 @@ 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 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 @@ -185,6 +187,8 @@ export {
IHTMLLabelElement,
HTMLMetaElement,
IHTMLMetaElement,
HTMLMediaElement,
IHTMLMediaElement,
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 de18f41

Please sign in to comment.