Skip to content

Should HTMLOrSVGImageElement be a mixin? #4345

Open
@vmpstr

Description

@vmpstr

Current HTMLOrSVGImageElement is defined as a typedef:
https://html.spec.whatwg.org/#2dcontext

typedef (HTMLImageElement or
         SVGImageElement) HTMLOrSVGImageElement;

There is desire to have some shared functionality between HTML and SVG image elements, specifically the decode() function (see w3c/svgwg#373).

As proposed in the w3c/svgwg issue by @AmeliaBR I think it makes sense to convert the typedef into a mixin with decode() currently being the only common function.

There is also some discussion about things like intrinsicSize or some notion of an aspect ratio that could likely be a part of the shared interface as well.

Does anyone have any thoughts or objections?
/cc @chrishtr @annevk @domenic

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions