Skip to content

Add drawable attribute to MathMLElement #341

Open

Description

@schenney-chromium

The HTML -in-Canvas APIs make use of an attribute, drawable, on elements in the canvas subtree to indicate those elements need special treatment to support drawing them into a canvas. The HTML whatwg/html#11588 currently puts that attribute on HTMLElement but to support all content we would like to put it on HTMLOrSVGOrMathMLElement.

This issue is seeking MathML-core approval to add the drawable attribute to HTMLOrSVGOrMathMLElement.

Activity

  1. schenney-chromium commented on Sep 17, 2026

    @schenney-chromium
    Author
  2. lukewarlow commented on Sep 17, 2026

    @lukewarlow
    Member

    I think assuming there's no problems with rendering inner MathML or SVG components in that context (can't think why there would be) this is a good idea. We want to keep the platform as coherent as possible and something only working for HTML would seem rather arbitrary.

  3. fred-wang commented on Sep 18, 2026

    @fred-wang
    Contributor

    Allowing MathML to be drawn in canvas sounds great to create 2D or 3D schemas like https://fred-wang.github.io/TeXZilla/examples/toImageWebGL.html without having to wrap the content into an SVG image and the limitation implied by this trick. It also seems that if HTML-in-canvas gains popularity, we should definitely allow SVG/MathML for platform consistency as Luke commented.

    The only bad thing I'm aware of is the risk of information leakage with :visited style and MathML links described in appendix F but that's something that exists for HTML/SVG too so I expect similar mitigations will apply (e.g. canvas tainting or not matching the :visited selector).

  4. schenney-chromium commented on Sep 18, 2026

    @schenney-chromium
    Author

    The readback-allowed-rendering mode used for HTML-in-Canvas, and hopefully for SVG in canvas, removes visited link styling from all elements. At some point I went through the MathML spec to find all the possible privacy leaks and didn't find any not already discussed in the PR, though we are still pending extensive testing.

  5. davidcarlisle commented on Sep 28, 2026

    @davidcarlisle
    Collaborator

    Meeting on 2026-09-28 appoved adding this

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions