Closed Bug 1925130 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 48654 - Remove TextCluster caching in TextMetrics

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 48654 into mozilla-central (this bug is closed when the sync is complete).

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

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

Remove TextCluster caching in TextMetrics

In a previous CL, the getTextClusters() API was implemented with a cache
for the created TextCluster objects. This API may include as a parameter
a dictionary with text align and baseline options. Since the cache is
used if it was already calculated, subsequent calls with different
options return clusters in the wrong positions.

This CL removes this cache to guarantee that the results are always
calculated from scratch taking into account the current options passed

Tests were added using the CanvasTest font to check that the positions
are coherent with the options passed.

A future CL with reincorporate this cache in a way that allows
offsetting the stored clusters following the current align and
baseline options passed.

Bug: 341213359
Change-Id: I4cabdb62d05a9c8763300c0d268d7794ca9f160b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5933690
Reviewed-by: Jean-Philippe Gravel \<jpgravel@chromium.org>
Commit-Queue: Andres Ricardo Perez \<andresrperez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1369650}

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

CI Results

Ran 0 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

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/dbf91baafef2 [wpt PR 48654] - Remove TextCluster caching in TextMetrics, a=testonly https://hg.mozilla.org/integration/autoland/rev/25e88b73966f [wpt PR 48654] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
You need to log in before you can comment on or make changes to this bug.