Closed Bug 1778910 Opened 3 years ago Closed 2 years ago

Implement the fontVariantCaps attribute for Canvas2D text

Categories

(Core :: Graphics: Canvas2D, defect)

defect

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

(Blocks 2 open bugs, Regressed 1 open bug)

Details

Attachments

(3 files)

No description provided.

As for fontKerning, the current Blink implementation (and associated WPT tests) seems wrong to me, in that it treats the keyword value strings as case-insensitive; see bug 1778908 comment 1.

Triage - since this is a defect, it needs severity, I am uncertain how this feature affects the appearance of text on a canvas2D, so I am marking this S4 as a possibly just cosmetic issue - is there an example in the wild?

Severity: -- → S4

Before we do this, I'm seeking clarification of a spec/interop issue -- see https://github.com/whatwg/html/issues/8103 and https://crbug.com/1343549. Basically, the question is how fontVariantCaps should interact with the font attribute, which may specify the small-caps variant (but not other caps variants).

Bumping this to S3; it seems like a pretty normal-level feature, where lack of support could result in a site getting lowercase text where it wanted small-caps. Also, the Interop-2023 offscreen-canvas tests include a couple for fontVariantCaps, which we currently fail.

Blocks: interop-2023
Severity: S4 → S3

Surprisingly, this is sufficient to pass the existing WPT tests for fontVariantCaps.
(They only test setting and reading the attribute, but don't verify that it actually
has any effect on rendering!)

Rendering tests will be added in the next patch, along with hooking up the behavior.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED

The behavior in some of these cases is open to debate, as the spec is quite unclear;
see https://github.com/whatwg/html/issues/8103. What I've implemented here gives the
rendering result as Chrome for these tests, so hopefully we can get this clarified
in the spec as well.

Depends on D182566

Attachment #9341922 - Attachment description: Bug 1778910 - Implement setting/getting the fontVariantCaps attribute on Canvas2D context (note: no rendering support yet). r=#gfx-reviewers → Bug 1778910 - Implement setting/getting the fontVariantCaps attribute on Canvas2D context (note: no rendering support yet). r=#gfx-reviewers,#webidl

Test the same features as the canvas-element reftests, for both a main-thread
OffscreenCanvas and in a worker.

Depends on D182567

Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d87582a5c11f Implement setting/getting the fontVariantCaps attribute on Canvas2D context (note: no rendering support yet). r=gfx-reviewers,webidl,lsalzman,saschanaz https://hg.mozilla.org/integration/autoland/rev/d59f1e7c17c5 Hook up rendering support for canvas2d fontVariantCaps, and add WPT reftests. r=gfx-reviewers,lsalzman https://hg.mozilla.org/integration/autoland/rev/75478b5852a3 Add offscreen-canvas versions of WPT reftests for fontVariantCaps. r=gfx-reviewers,lsalzman
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/40871 for changes under testing/web-platform/tests
Regressions: 1841648
Upstream PR was closed without merging
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c3b75097bc02 Implement setting/getting the fontVariantCaps attribute on Canvas2D context (note: no rendering support yet). r=gfx-reviewers,webidl,lsalzman,saschanaz https://hg.mozilla.org/integration/autoland/rev/def0a0be81f9 Hook up rendering support for canvas2d fontVariantCaps, and add WPT reftests. r=gfx-reviewers,lsalzman https://hg.mozilla.org/integration/autoland/rev/892665cb2eb7 Add offscreen-canvas versions of WPT reftests for fontVariantCaps. r=gfx-reviewers,lsalzman
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
Upstream PR merged by moz-wptsync-bot
Flags: needinfo?(jfkthame)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: