[wpt-sync] Sync PR 48420 - Implement TextMetrics::getTextClustersForRange()
Categories
(Core :: Graphics: Canvas2D, task, P4)
Tracking
()
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 toctx.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
Assignee | ||
Updated•2 months ago
|
Assignee | ||
Comment 1•2 months ago
|
||
Assignee | ||
Comment 2•2 months ago
|
||
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
- /html/canvas/element/text/2d.text.measure.text-clusters-exceptions.tentative.html [wpt.fyi]
- Check that TextMetrics::getTextClusters() throws when using invalid indexes.:
FAIL
(Chrome:FAIL
, Safari:FAIL
)
- Check that TextMetrics::getTextClusters() throws when using invalid indexes.:
- /html/canvas/element/text/2d.text.measure.text-clusters-split.tentative.html [wpt.fyi]
- Test that getTextClusters() splits the input correctly into the minimal clusters, keeping emojis together.:
FAIL
(Chrome:FAIL
, Safari:FAIL
)
- Test that getTextClusters() splits the input correctly into the minimal clusters, keeping emojis together.:
- /html/canvas/offscreen/text/2d.text.measure.text-clusters-exceptions.tentative.html [wpt.fyi]
- Check that TextMetrics::getTextClusters() throws when using invalid indexes.:
FAIL
(Chrome:FAIL
, Safari:FAIL
)
- Check that TextMetrics::getTextClusters() throws when using invalid indexes.:
- /html/canvas/offscreen/text/2d.text.measure.text-clusters-exceptions.tentative.worker.html [wpt.fyi]
- Check that TextMetrics::getTextClusters() throws when using invalid indexes.:
FAIL
(Chrome:FAIL
, Safari:FAIL
)
- Check that TextMetrics::getTextClusters() throws when using invalid indexes.:
- /html/canvas/offscreen/text/2d.text.measure.text-clusters-split.tentative.html [wpt.fyi]
- Test that getTextClusters() splits the input correctly into the minimal clusters, keeping emojis together.:
FAIL
(Chrome:FAIL
, Safari:FAIL
)
- Test that getTextClusters() splits the input correctly into the minimal clusters, keeping emojis together.:
- /html/canvas/offscreen/text/2d.text.measure.text-clusters-split.tentative.worker.html [wpt.fyi]
- Test that getTextClusters() splits the input correctly into the minimal clusters, keeping emojis together.:
FAIL
(Chrome:FAIL
, Safari:FAIL
)
- Test that getTextClusters() splits the input correctly into the minimal clusters, keeping emojis together.:
Comment 4•1 month ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3582c7e69838
https://hg.mozilla.org/mozilla-central/rev/8f5bec2a5570
Description
•