Closed Bug 1936096 Opened 2 months ago Closed 2 months ago

[wpt-sync] Sync PR 49593 - Add options to fillTextCluster to override some cluster values

Categories

(Core :: Graphics: Canvas2D, task, P4)

task

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 49593 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/49593
Details from upstream follow.

Andres Ricardo Perez <andresrperez@chromium.org> wrote:

Add options to fillTextCluster to override some cluster values

The current implementation of ctx.fillTextCluster() always renders the
cluster with the align, baseline, X, and Y values stored in the cluster
itself. This means that once a cluster is generated, there is no way to
render them with a different align or baseline, and that there is no way
to override the stored X and Y values.

This CL adds an options dictionary parameter to ctx.fillTextCluster(),
that enables users to override these values.

For the X and Y values, this means that it is possible use the values
stored in the cluster for calculations (like where on a circle should a
cluster go), and then render them exactly in a specified position by
overriding this values to (0, 0). In practice, this means that calling
ctx.fillTextCluster(cluster, pos_x, pos_y, {x: 0, y:0}) renders the
cluster and exactly (pos_x, pos_y), instead of offsetting it by the
values stored in the cluster.

For align and baseline, this allows to decouple the setting used for
measuring the clusters from the ones used to render if desired.

Bug: 341213359
Change-Id: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
Reviewed-on: https://chromium-review.googlesource.com/6006496
WPT-Export-Revision: cfb90398b3592ba8332a9dbe77a3d7f5e10fdb32

Component: web-platform-tests → Graphics: Canvas2D
Product: Testing → Core

CI Results

Ran 6 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 3 tests and 1 subtests

Status Summary

Firefox

OK : 3
FAIL: 3

Chrome

OK : 3
FAIL: 3

Safari

OK : 3
FAIL: 3

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/27534812d693 [wpt PR 49593] - Add options to fillTextCluster to override some cluster values, a=testonly https://hg.mozilla.org/integration/autoland/rev/b037a59b347e [wpt PR 49593] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.