Open Bug 1894991 Opened 14 days ago Updated 3 days ago

[wpt-sync] Sync PR 46057 - Implement getSelectionRects feature for TextMetrics

Categories

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

task

Tracking

()

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

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

Implement getSelectionRects feature for TextMetrics

This change creates a new API method for TextMetrics objects in canvas
that uses font data and precalculated text runs, to calculate the
selection rects for an interval of characters. This interval is defined
by character positions in the input text.

The selection rects are calculated using the existing
Font::SelectionRectForText method, but on a logical run by run
basis to ensure correct management of bidi text inputs.

The target is to match the rects that would be obtained by using the DOM
from selecting this same interval using
Selection.getRangeAt(0).getClientRects() after having set the selection
with a range.

The new API was enabled under the ExtendedTextMetrics flag.

Change-Id: Ia05ce8e55e3e73a491354293502b457ad712026e
Reviewed-on: https://chromium-review.googlesource.com/5353031
WPT-Export-Revision: 8c3c3e8d1a3690d821675f6ac0985631b8c84d6b

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

Status Summary

Firefox

OK : 8
FAIL: 8

Chrome

OK : 8
FAIL: 8

Safari

OK : 8
FAIL: 8

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

You need to log in before you can comment on or make changes to this bug.