Closed Bug 1922284 Opened 2 months ago Closed 1 month ago

[wpt-sync] Sync PR 48420 - Implement TextMetrics::getTextClustersForRange()

Categories

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

task

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

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

Implement TextMetrics::getTextClustersForRange()

This change creates a new API method for TextMetrics objects in Canvas,
that returns the specific ranged split into its minimal grapheme
clusters, i.e. the smallest units that make sense to render separately
from the perspective of the user.

The returned object, named TextCluster, contains all the information
needed for it to be rendered and shaped in the same way as in the input
given to ctx.measureText(). This includes the begin and end indices
on the input string, x and y positions relative to the anchor point of
the Canvas context when the text is measured, and the complete text to
preserve the context needed to reshape the text exactly the same.

The final optional parameter for getTextClustersForRange() is
dictionary to specify the desired anchor point position for each
cluster. This enables the API to adjust the returned x and y positions
to a different align/baseline that the ones used when the text was
measured.

The new API was enabled under the ExtendedTextMetrics flag.

The next CL in the stack creates a new method for the Canvas rendering
context that enables the rending of TextCluster objects.

Bug: 341213359
Change-Id: Ie668ec4a266d4b5a99443125c7099e6f72714f7d
Reviewed-on: https://chromium-review.googlesource.com/5839992
WPT-Export-Revision: 44c2fad655d87fb33ef891e6de6e02603b9c3fde

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 6 tests and 1 subtests

Status Summary

Firefox

OK : 6
FAIL: 6

Chrome

OK : 6
FAIL: 6

Safari

OK : 6
FAIL: 6

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/3582c7e69838 [wpt PR 48420] - Implement TextMetrics::getTextClusters(), a=testonly https://hg.mozilla.org/integration/autoland/rev/8f5bec2a5570 [wpt PR 48420] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
You need to log in before you can comment on or make changes to this bug.