Skip to content

[css-paint-api] Converting a URL to a CanvasImageSource? #416

Closed
@asajeffrey

Description

@asajeffrey

PaintRenderingContext2D (https://drafts.css-houdini.org/css-paint-api/#2d-rendering-context) implements CanvasDrawImage (https://html.spec.whatwg.org/multipage/canvas.html#canvasdrawimage), which uses CanvasImageSource as the type of its image argument (https://html.spec.whatwg.org/multipage/canvas.html#canvasimagesource).

In examples such as https://github.com/w3c/web-platform-tests/blob/740aba06484bcb174c692175493fa591d29feedd/css-paint-api/paint2d-image.html#L20, the image is a URL. It is not obvious from the spec how this should be converted to a CanvasImageSource. In particular, paint worklets do not have access to the HTMLImageElement class, as it is not marked Exposed=(Window,PaintWorklet).

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