Closed Bug 1897517 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 46355 - Implement getActualBoundingBox feature for TextMetrics

Categories

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

task

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

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

Implement getActualBoundingBox 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
bounding box for an interval of characters. This interval is defined
by character positions in the input text.

The method returns a single rectangle, the actual bounding box of the
substring of the input text defined by the input indexes.

The new API was enabled under the ExtendedTextMetrics flag.

Bug: 341213359
Change-Id: I289a52283d0bd5a0001c5ec7a514cf16abba9611
Reviewed-on: https://chromium-review.googlesource.com/5546024
WPT-Export-Revision: bab6a7940196e2cf6cce680eccefeeb2ca1e762b

PR 46355 applied with additional changes from upstream: 2f33048726a86252b62bf4b63e32fba65985d372, 12f8a9095c895763d4165d93c80f04ae9bcd32a7
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 9 tests and 6 subtests

Status Summary

Firefox

OK : 9
FAIL: 33

Chrome

OK : 9
FAIL: 33

Safari

OK : 9
FAIL: 33

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /html/canvas/element/text/2d.text.measure.getActualBoundingBox-exceptions.tentative.html [wpt.fyi]
    • Check that TextMetrics::getActualBoundingBox() throws when using invalid indexes.: FAIL (Chrome: FAIL, Safari: FAIL)
  • /html/canvas/element/text/2d.text.measure.getActualBoundingBox-full-text.tentative.html [wpt.fyi]
    • Test TextMetrics::getActualBoundingBox() for the full length of the string for some edge cases, with direction ltr and no-directional-override: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox() for the full length of the string for some edge cases, with direction rtl and no-directional-override: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox() for the full length of the string for some edge cases, with direction ltr and directional-override: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox() for the full length of the string for some edge cases, with direction rtl and directional-override: FAIL (Chrome: FAIL, Safari: FAIL)
  • /html/canvas/element/text/2d.text.measure.getActualBoundingBox.tentative.html [wpt.fyi]
    • Test TextMetrics::getActualBoundingBox(), with text align left , and 0px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align center , and 0px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align right , and 0px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align left , and 10px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align center , and 10px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align right , and 10px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
  • /html/canvas/offscreen/text/2d.text.measure.getActualBoundingBox-exceptions.tentative.html [wpt.fyi]
    • Check that TextMetrics::getActualBoundingBox() throws when using invalid indexes.: FAIL (Chrome: FAIL, Safari: FAIL)
  • /html/canvas/offscreen/text/2d.text.measure.getActualBoundingBox-exceptions.tentative.worker.html [wpt.fyi]
    • Check that TextMetrics::getActualBoundingBox() throws when using invalid indexes.: FAIL (Chrome: FAIL, Safari: FAIL)
  • /html/canvas/offscreen/text/2d.text.measure.getActualBoundingBox-full-text.tentative.html [wpt.fyi]
    • Test TextMetrics::getActualBoundingBox() for the full length of the string for some edge cases, with direction ltr and no-directional-override: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox() for the full length of the string for some edge cases, with direction rtl and no-directional-override: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox() for the full length of the string for some edge cases, with direction ltr and directional-override: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox() for the full length of the string for some edge cases, with direction rtl and directional-override: FAIL (Chrome: FAIL, Safari: FAIL)
  • /html/canvas/offscreen/text/2d.text.measure.getActualBoundingBox-full-text.tentative.worker.html [wpt.fyi]
    • Test TextMetrics::getActualBoundingBox() for the full length of the string for some edge cases, with direction ltr and no-directional-override: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox() for the full length of the string for some edge cases, with direction rtl and no-directional-override: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox() for the full length of the string for some edge cases, with direction ltr and directional-override: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox() for the full length of the string for some edge cases, with direction rtl and directional-override: FAIL (Chrome: FAIL, Safari: FAIL)
  • /html/canvas/offscreen/text/2d.text.measure.getActualBoundingBox.tentative.html [wpt.fyi]
    • Test TextMetrics::getActualBoundingBox(), with text align left , and 0px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align center , and 0px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align right , and 0px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align left , and 10px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align center , and 10px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align right , and 10px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
  • /html/canvas/offscreen/text/2d.text.measure.getActualBoundingBox.tentative.worker.html [wpt.fyi]
    • Test TextMetrics::getActualBoundingBox(), with text align left , and 0px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align center , and 0px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align right , and 0px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align left , and 10px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align center , and 10px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test TextMetrics::getActualBoundingBox(), with text align right , and 10px letter spacing.: FAIL (Chrome: FAIL, Safari: FAIL)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bebe9af062b1 [wpt PR 46355] - Implement getActualBoundingBox feature for TextMetrics, a=testonly https://hg.mozilla.org/integration/autoland/rev/72a28e061b13 [wpt PR 46355] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch
You need to log in before you can comment on or make changes to this bug.