Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#475@minor: Adds support for HTMLMediaElement. #535

Merged
merged 4 commits into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/happy-dom/src/config/ElementTag.ts
Original file line number Diff line number Diff line change
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 '../nodes/html-audio-element/HTMLAudioElement';
import HTMLVideoElement from '../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
};
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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 {}
Original file line number Diff line number Diff line change
@@ -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;