-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CanvasRenderingContext2D API Improvements #627
Comments
Hi @mysteryDate & @fserb! @hober and I took a look at this during a breakout this week. Overall, we're happy to see that each of these additions is being discussed in various WHATWG HTML issues where you've gotten a lot of feedback from other stakeholders. For instance, the ongoing discussion on the reset() function has been fruitful and we look forward to seeing what conclusion everyone comes to. Regarding using CSSColorValue for input, and as @plinss already expressed in the Houdini TF discussion on this, we don't think On the proposed CSS Text Modifiers, we're concerned about the choice to use camelCased names instead of the actual CSS property names. The names currently proposed are not just camelCased versions of their CSS counterparts (e.g. You've gotten strong implementer feedback that perspective transforms aren't feasible in at least one implementation. Perhaps it's best to leave this for the future, in case that stops being the case later on. The syntax proposed for SVG filters is strictly less powerful than SVG filters, as pointed out previously by @smfr. Adding APIs that are very similar to other APIs but different in subtle ways is likely to be confusing to authors. We did not see any issues with any of the other proposed additions. |
Hey @LeaVerou! Thank you so much for the feedback. Very glad to hear that you all are on board with the bulk of these changes. It’s exciting to have the opportunity to make the web platform more expressive and useful! As per your concerns: CSSColorValue as input: TextModifiers: Perspective Transforms: SVG Filters:
This is a rather large change and it made sense to bite off a smaller chunk for the time being. The proposed syntax could be trivially extended to support DAGs in the future, by allowing CanvasFilters as parameters values. One of the major motivations for this feature is to make filters available on WebWorkers with OffscreenCanvas. SVG and CSS are DOM dependent, and not trivially available on WebWorkers and thus a new syntax would already be necessary. This proposal has the advantage of being trivially parseable (as a regular Javascript object) and familiar to Javascript developers. Attribute names are copied verbatim from the SVG implementation also with the goal of being as un-surprising as possible. |
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textWordSpacing. So that thee attribute name wordSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: Ic735c7c4617572511fd37fe0928f8919e7fd3f69
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textLetterSpacing. So that thee attribute name letterSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: I8b37f046f5cdbfb28848ba3930e047203b061982
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textWordSpacing. So that thee attribute name wordSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: Ic735c7c4617572511fd37fe0928f8919e7fd3f69
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textWordSpacing. So that thee attribute name wordSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: Ic735c7c4617572511fd37fe0928f8919e7fd3f69
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textLetterSpacing. So that thee attribute name letterSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: I8b37f046f5cdbfb28848ba3930e047203b061982
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textWordSpacing. So that thee attribute name wordSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: Ic735c7c4617572511fd37fe0928f8919e7fd3f69 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056391 Reviewed-by: Bo <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Commit-Queue: Yi Xu <[email protected]> Cr-Commit-Position: refs/heads/master@{#906470}
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textWordSpacing. So that thee attribute name wordSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: Ic735c7c4617572511fd37fe0928f8919e7fd3f69 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056391 Reviewed-by: Bo <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Commit-Queue: Yi Xu <[email protected]> Cr-Commit-Position: refs/heads/master@{#906470}
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textLetterSpacing. So that thee attribute name letterSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: I8b37f046f5cdbfb28848ba3930e047203b061982
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textWordSpacing. So that thee attribute name wordSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: Ic735c7c4617572511fd37fe0928f8919e7fd3f69 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056391 Reviewed-by: Bo <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Commit-Queue: Yi Xu <[email protected]> Cr-Commit-Position: refs/heads/master@{#906470}
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textLetterSpacing. So that thee attribute name letterSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: I8b37f046f5cdbfb28848ba3930e047203b061982
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textLetterSpacing. So that thee attribute name letterSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: I8b37f046f5cdbfb28848ba3930e047203b061982 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056509 Commit-Queue: Yi Xu <[email protected]> Reviewed-by: Bo <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/master@{#906594}
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textLetterSpacing. So that thee attribute name letterSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: I8b37f046f5cdbfb28848ba3930e047203b061982 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056509 Commit-Queue: Yi Xu <[email protected]> Reviewed-by: Bo <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/master@{#906594}
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textLetterSpacing. So that thee attribute name letterSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: I8b37f046f5cdbfb28848ba3930e047203b061982 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056509 Commit-Queue: Yi Xu <[email protected]> Reviewed-by: Bo <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/master@{#906594}
…s2D.wordSpacing, a=testonly Automatic update from web-platform-tests Rename Canvas2D.textWordSpacing to Canvas2D.wordSpacing Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textWordSpacing. So that thee attribute name wordSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: Ic735c7c4617572511fd37fe0928f8919e7fd3f69 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056391 Reviewed-by: Bo <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Commit-Queue: Yi Xu <[email protected]> Cr-Commit-Position: refs/heads/master@{#906470} -- wpt-commits: 7666067297aef38ba695aac42f703e627d9c6dd9 wpt-pr: 29821
…vas2D.letterSpacing, a=testonly Automatic update from web-platform-tests Rename Canvas2D.textLetterSpacing to Canvas2D.letterSpacing Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textLetterSpacing. So that thee attribute name letterSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: I8b37f046f5cdbfb28848ba3930e047203b061982 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056509 Commit-Queue: Yi Xu <[email protected]> Reviewed-by: Bo <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/master@{#906594} -- wpt-commits: 34cb7e900e12fb6b9dc71b6c78d0aa9915dd18d4 wpt-pr: 29822
…s2D.wordSpacing, a=testonly Automatic update from web-platform-tests Rename Canvas2D.textWordSpacing to Canvas2D.wordSpacing Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textWordSpacing. So that thee attribute name wordSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: Ic735c7c4617572511fd37fe0928f8919e7fd3f69 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056391 Reviewed-by: Bo <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Commit-Queue: Yi Xu <[email protected]> Cr-Commit-Position: refs/heads/master@{#906470} -- wpt-commits: 7666067297aef38ba695aac42f703e627d9c6dd9 wpt-pr: 29821
…vas2D.letterSpacing, a=testonly Automatic update from web-platform-tests Rename Canvas2D.textLetterSpacing to Canvas2D.letterSpacing Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textLetterSpacing. So that thee attribute name letterSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: I8b37f046f5cdbfb28848ba3930e047203b061982 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056509 Commit-Queue: Yi Xu <[email protected]> Reviewed-by: Bo <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/master@{#906594} -- wpt-commits: 34cb7e900e12fb6b9dc71b6c78d0aa9915dd18d4 wpt-pr: 29822
Hi @mysteryDate 👋🏼 @atanassov and I looked at this during a breakout today at our virtual f2f meeting.
It seems like an implementation detail, so we aren't sure a note is needed, but if you want to add one, sure, go ahead.
We saw there was some pushback to that, because these attributes do not have the same syntax as the corresponding CSS properties.
That seems reasonable to us. Thank you for working with us and being receptive to feedback. Good luck, we look forward to seeing this progress! |
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textWordSpacing. So that thee attribute name wordSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: Ic735c7c4617572511fd37fe0928f8919e7fd3f69 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056391 Reviewed-by: Bo <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Commit-Queue: Yi Xu <[email protected]> Cr-Commit-Position: refs/heads/master@{#906470} NOKEYCHECK=True GitOrigin-RevId: 561dd52fd9dd09d1b3c671a08d82f01a98866b1f
Per discussion in w3ctag/design-reviews#627, we have agreed to remove text prefix for attribute textLetterSpacing. So that thee attribute name letterSpacing follows the same naming conversion of other text attributes. Bug: 1233706 Change-Id: I8b37f046f5cdbfb28848ba3930e047203b061982 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056509 Commit-Queue: Yi Xu <[email protected]> Reviewed-by: Bo <[email protected]> Reviewed-by: Aaron Krajeski <[email protected]> Cr-Commit-Position: refs/heads/master@{#906594} NOKEYCHECK=True GitOrigin-RevId: c99f03c7e78a893b79d1d51e30913aefc7e9da2a
I'm requesting a TAG review of nine improvements to the CanvasRenderingContext2D API.
Canvas is the web’s direct mode rendering solution that closely matches traditional programming models. This is particularly targeted for games and full featured apps. Modern 2D developers sometimes have to fallback to GL for features that are expected to be available in 2D but currently aren’t supported by Canvas 2D. There's a always a balance to be struck when adding new APIs to the web. That said, it's important that Canvas2D is able to address developer's use cases in game development and text manipulation.
The current Canvas 2D API was originally proposed in 2013. Since then, a lot of 2D graphics APIs have appeared and changed what developers expect from a good 2D API. This proposal tries to modernize Canvas 2D API, considering current and future usage of Canvas and considering 3 pillars:
Further details:
We'd prefer the TAG provide feedback as:
💬 leave review feedback as a comment in this issue and @-notify mysteryDate and fserb.
The text was updated successfully, but these errors were encountered: