Skip to content

<canvas> width/height attributes can throw? #7798

Closed as duplicate
Closed as duplicate

Description

@annevk

When setting the value of the width or height attribute, if the context mode of the canvas element is set to placeholder, the user agent must throw an "InvalidStateError" DOMException and leave the attribute's value unchanged.

This would mean that canvas.setAttribute("width", x) can throw, which is really weird as setAttribute() cannot throw (except with Trusted Types I suppose, but that's very much opt-in and also not an accepted standard).

(The placeholder mode is a result of calling transferControlToOffscreen().)

cc @whatwg/canvas

Activity

  1. added
    topic: canvas
    on Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: canvas

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions