From 33eb739ee662b002072e84c9d54329d58ae8ccdc Mon Sep 17 00:00:00 2001 From: Daniel Jacobs Date: Wed, 13 Sep 2023 16:00:29 -0400 Subject: [PATCH] web: Add width, height, and type to RufflePlayer (fix #13176) --- web/packages/core/src/ruffle-player.ts | 60 ++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/web/packages/core/src/ruffle-player.ts b/web/packages/core/src/ruffle-player.ts index bfdca72f5..d4fcb8ae2 100644 --- a/web/packages/core/src/ruffle-player.ts +++ b/web/packages/core/src/ruffle-player.ts @@ -453,6 +453,66 @@ export class RufflePlayer extends HTMLElement { ); } + /** + * Polyfill of height getter for HTMLEmbedElement and HTMLObjectElement + * + * @ignore + * @internal + */ + get height(): string { + return this.getAttribute("height") || ""; + } + + /** + * Polyfill of height setter for HTMLEmbedElement and HTMLObjectElement + * + * @ignore + * @internal + */ + set height(height: string) { + this.setAttribute("height", height); + } + + /** + * Polyfill of width getter for HTMLEmbedElement and HTMLObjectElement + * + * @ignore + * @internal + */ + get width(): string { + return this.getAttribute("width") || ""; + } + + /** + * Polyfill of width setter for HTMLEmbedElement and HTMLObjectElement + * + * @ignore + * @internal + */ + set width(widthVal: string) { + this.setAttribute("width", widthVal); + } + + /** + * Polyfill of type getter for HTMLEmbedElement and HTMLObjectElement + * + * @ignore + * @internal + */ + get type(): string { + return this.getAttribute("type") || ""; + } + + /** + * Polyfill of type setter for HTMLEmbedElement and HTMLObjectElement + * + * @ignore + * @internal + */ + set type(typeVal: string) { + this.setAttribute("type", typeVal); + } + /** * @ignore * @internal