Intent to Prototype: canvas placeElement()

529 views
Skip to first unread message

Aaron Krajeski

unread,
Jun 26, 2024, 6:08:29 PM (3 days ago) Jun 26
to blink-dev, Khushal Sagar, Fernando Serboncini, Chris Harrelson
Contact emails

aar...@chromium.org, fs...@chromium.org, khusha...@chromium.org


Explainer

placeElement technical paper [public]


Specification

None


Summary

placeElement() allows users of 2D and 3D canvases to draw arbitrary HTML elements into their canvas rendering contexts. This allows for greater flexibility in text rendering and accessibility for canvases. 


Blink component

Blink>Canvas


Motivation

Text support on canvas is far behind the rest of the web: it is not indexable nor accessible and multiline rendering is challenging and limited. placeElement() proposes an API that allows users to bring the power of HTML/CSS text formatting into canvases by drawing HTML elements within canvas rendering contexts.


This will not only allow webapps that use 2D or 3D canvases to leverage all the text formatting and styling options available to HTML (not to mention the possibility of scrolling, spellcheck, translate, etc.), but makes all of HTML available to canvas! Radio buttons with chromatic aberration! Platformer games with dropdown menus as obstacles! The possibilities are endless.


Initial public proposal

https://logs.csswg.org/irc.w3.org/css/2024-06-12/#e1628190


TAG review

None


TAG review status

Pending


Risks

Interoperability and Compatibility

None


Gecko: No signal


WebKit: No signal


Web developers: Extremely positive. See placeElement Twitter Feedback


WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None


Is this feature fully tested by web-platform-tests?

Tests will be added as we prototype


Flag name on chrome://flags

canvas-place-element


Finch feature name

None


Non-finch justification

The feature will be flag guarded.


Requires code in //chrome?

False


Estimated milestones

No milestones specified


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5172548013916160?gate=6290777780256768


This intent message was generated by Chrome Platform Status.


Jeffrey Yasskin

unread,
Jun 27, 2024, 12:26:14 PM (2 days ago) Jun 27
to Aaron Krajeski, blink-dev, Khushal Sagar, Fernando Serboncini, Chris Harrelson
On Wed, Jun 26, 2024 at 3:08 PM Aaron Krajeski <aar...@chromium.org> wrote:
https://www.chromium.org/blink/launching-features/#start-incubating recommends putting explainers on Github rather than Google Docs, and I think I see an explainer for this at https://github.com/Igalia/explainers/tree/main/canvas-formatted-text#2-html-in-canvas-placeelement. Is that the right place for reviewers to file issues?

Thanks,
Jeffrey

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/a473b17f-def6-4bb7-85ee-344947c5ecabn%40chromium.org.

Stephen Chenney

unread,
Jun 27, 2024, 12:48:51 PM (2 days ago) Jun 27
to Jeffrey Yasskin, Aaron Krajeski, blink-dev, Khushal Sagar, Fernando Serboncini, Chris Harrelson
On Thu, Jun 27, 2024 at 12:26 PM Jeffrey Yasskin <jyas...@chromium.org> wrote:
On Wed, Jun 26, 2024 at 3:08 PM Aaron Krajeski <aar...@chromium.org> wrote:
Contact emails

aar...@chromium.org, fs...@chromium.org, khusha...@chromium.org


Explainer

placeElement technical paper [public]


https://www.chromium.org/blink/launching-features/#start-incubating recommends putting explainers on Github rather than Google Docs, and I think I see an explainer for this at https://github.com/Igalia/explainers/tree/main/canvas-formatted-text#2-html-in-canvas-placeelement. Is that the right place for reviewers to file issues?

Thanks,
Jeffrey

Please file issues at the existing WICG site for this work. https://github.com/WICG/canvas-formatted-text/

That location has not been updated with the latest explainers, which are at the Igalia site Jeffrey linked to. However I am actively working on moving the explainers there and updating the content.

Maybe tag issues with [placeElement] or something like that?

Cheers,
Stephen.
 

Aaron Krajeski

unread,
Jun 27, 2024, 1:35:34 PM (2 days ago) Jun 27
to blink-dev, Stephen Chenney, Aaron Krajeski, blink-dev, Khushal Sagar, Fernando Serboncini, Chris Harrelson, Jeffrey Yasskin

https://www.chromium.org/blink/launching-features/#start-incubating recommends putting explainers on Github rather than Google Docs, and I think I see an explainer for this at https://github.com/Igalia/explainers/tree/main/canvas-formatted-text#2-html-in-canvas-placeelement. Is that the right place for reviewers to file issues?

That looks okay to me, but I'll let Fernando chime in on that. The doc I linked has some newer work (like the separation of drawElement() for 3D contexts), but that can be integrated into the Igalia site.


Please file issues at the existing WICG site for this work. https://github.com/WICG/canvas-formatted-text/

Okay! Will do. 
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
Reply all
Reply to author
Forward
0 new messages