[wpt-sync] Sync PR 58468 - [Fonts] Fix measureText() actualBoundingBox precision for MeasureRuns
Categories
(Core :: Graphics: Canvas2D, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox151 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Attachments
(1 file)
|
69.87 KB,
text/plain
|
Details |
Sync web-platform-tests PR 58468 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/58468
Details from upstream follow.
Sejal Anand <sejalanand@microsoft.com> wrote:
[Fonts] Fix measureText() actualBoundingBox precision for MeasureRuns
The original fix (crrev.com/c/7564913) added PreciseBoundsForGlyph
for small font sizes but only applied it in GetActualBoundingBox(),
which handles the getActualBoundingBox(start, end) sub-range API.The top-level measureText().actualBoundingBoxLeft/Right/Ascent/Descent
properties are computed via MeasureRuns() → InkBounds(), which still
used integer-precision BoundsForGlyph. This caused the original bug
to remain unfixed for the most commonly used API.Apply PreciseBoundsForGlyph in MeasureRuns() for font sizes \<= 4px.
Also improve the WPT test:
- Move the WPT to the canvas test generator for coverage across
HtmlCanvas, OffscreenCanvas, and Worker contexts.- Switch from pixel-rendering check to direct metric assertions.
- Use glyph 'E' (has ascent + descent) and ±0.25 tolerances so
integer-quantized values are reliably caught.Bug: 479240778
Change-Id: I5e3f332b19ee0b7936a664bff5a87fa4cc780333
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7656848
Reviewed-by: Stephen Chenney \<schenney@chromium.org>
Reviewed-by: Koji Ishii \<kojii@chromium.org>
Commit-Queue: Sejal Anand \<sejalanand@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1599896}
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 1•2 months ago
|
||
| Assignee | ||
Comment 2•2 months ago
|
||
Comment 4•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/65d2d10a5b62
https://hg.mozilla.org/mozilla-central/rev/bfeda36d446f
Description
•