Closed Bug 1838905 Opened 1 year ago Closed 1 year ago

Values for canvas letterSpacing/wordSpacing attributes should be normalized to lowercase

Categories

(Core :: Graphics: Canvas2D, defect)

defect

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

One reason we fail some letter/word-spacing tests is that they specify a value in uppercase (e.g. ctx.letterSpacing = "1PX"), but on reading back the value, the test expects to see it lowercased.

Currently, we accept such uppercased units (we use a case-insensitive comparison when parsing them), but store them exactly as specified. We should instead normalize them, as the test expects and as is usual for CSS serialization.

The other thing I'm intending to do here is to split out the spacing testcases using font-relative lengths from those that use absolute lengths. Currently in OffscreenCanvas, we only support absolute lengths. Separating the tests will make it easier to keep track of the status.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED

Also adds a few more examples of font-relative lengths. We currently fail those
in OffscreenCanvas (see bug 1832955).

Depends on D181277

Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/950bd58b50e5
patch 1 - Normalize values to lowercase when storing canvas2d letter/word-spacing attributes. r=gfx-reviewers,lsalzman
https://hg.mozilla.org/integration/autoland/rev/ee558fb646d4
patch 2 - Split canvas text spacing tests into separate groups for absolute vs font-relative lengths. r=gfx-reviewers,lsalzman
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/40610 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: