Skip to content

Commit

Permalink
Use IDL enums for all CanvasTextDrawingStyles in Canvas2D
Browse files Browse the repository at this point in the history
Some of the canvas properties that are part of CanvasTextDrawingStyles
(https://html.spec.whatwg.org/#canvastextdrawingstyles) had been
modified to use enums defined from the IDL definition of the rendering
context (fontStretch and textRendering).

This CL creates enums for the rest of the CanvasTextDrawingStyles
properties. Getters and setters had to be modified, as well as a unit
test. Generated tests for setting and getting this properties already
exist in WPT, as defined in text.yaml.

Bug: 341213359
Change-Id: Ic8c30219a039c96cfd83dd078157d9fb60565e03
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6000733
Commit-Queue: Andres Ricardo Perez <andresrperez@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1415577}
  • Loading branch information
AndresRPerez12 authored and chromium-wpt-export-bot committed Feb 4, 2025
1 parent 0792096 commit a685ca6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion html/canvas/element/reset/2d.reset.render.text.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1>2d.reset.render.text</h1>
ctx.letterSpacing = "10px";
ctx.fontKerning = "none";
ctx.fontStretch = "semi-condensed";
ctx.fontVariantCaps = "tilting-caps";
ctx.fontVariantCaps = "titling-caps";
ctx.textRendering = "optimizeLegibility";
ctx.wordSpacing = "20px";

Expand Down
2 changes: 1 addition & 1 deletion html/canvas/offscreen/reset/2d.reset.render.text.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1>2d.reset.render.text</h1>
ctx.letterSpacing = "10px";
ctx.fontKerning = "none";
ctx.fontStretch = "semi-condensed";
ctx.fontVariantCaps = "tilting-caps";
ctx.fontVariantCaps = "titling-caps";
ctx.textRendering = "optimizeLegibility";
ctx.wordSpacing = "20px";

Expand Down
2 changes: 1 addition & 1 deletion html/canvas/offscreen/reset/2d.reset.render.text.w.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1>2d.reset.render.text</h1>
ctx.letterSpacing = "10px";
ctx.fontKerning = "none";
ctx.fontStretch = "semi-condensed";
ctx.fontVariantCaps = "tilting-caps";
ctx.fontVariantCaps = "titling-caps";
ctx.textRendering = "optimizeLegibility";
ctx.wordSpacing = "20px";

Expand Down
2 changes: 1 addition & 1 deletion html/canvas/tools/yaml-new/reset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
ctx.letterSpacing = "10px";
ctx.fontKerning = "none";
ctx.fontStretch = "semi-condensed";
ctx.fontVariantCaps = "tilting-caps";
ctx.fontVariantCaps = "titling-caps";
ctx.textRendering = "optimizeLegibility";
ctx.wordSpacing = "20px";
Expand Down

0 comments on commit a685ca6

Please sign in to comment.