[wpt-sync] Sync PR 46833 - Use visual runs and save ShapeResults in TextMetrics
Categories
(Core :: Graphics: Canvas2D, task, P4)
Tracking
()
Tracking | Status | |
---|---|---|
firefox130 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 46833 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/46833
Details from upstream follow.
Andres Ricardo Perez <andresrperez@chromium.org> wrote:
Use visual runs and save ShapeResults in TextMetrics
A previous CL implemented
TextMetrics::getSelectionRects()
by saving
the logical runs produced byBidiParagraph
. This approach can fail
when the direction of text in the canvas is set directly with
ctx.direction
, as the visual order of the runs (and therefore the
correct selection rects) can change without modifying the order in which
the logical runs are processed.This change uses
BidiParagraph::GetVisualRuns()
instead, to iterate the
runs in the visual order. To calculate selection rects from these runs,
it is necessary to save the starting x position and character offset in
the input string.Additionally, in order to avoid shaping the text over and over again,
theShapeResult
cache is only generated the first time the new method
is called. A new struct was created to hold the information needed for
each run. We defer the actual shaping of itsShapeResult
as to not
significantly affect the performance ofctx.measureText()
.Bug: 341213359
Change-Id: Iba4c461cddafa3d00d309f9a48e848b75ca84ff6
Reviewed-on: https://chromium-review.googlesource.com/5593278
WPT-Export-Revision: 0a3e301c2c0cff2d7c47916821618ed3ce428e3a
Assignee | ||
Updated•5 months ago
|
Assignee | ||
Comment 1•4 months ago
|
||
Assignee | ||
Comment 2•4 months ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 8 tests and 24 subtests
Status Summary
Firefox
OK
: 8
FAIL
: 54
Chrome
OK
: 8
PASS
: 18
FAIL
: 36
Safari
OK
: 8
FAIL
: 54
Links
Details
New Tests That Don't Pass
- /html/canvas/element/text/2d.text.measure.selection-rects-baselines.tentative.html [wpt.fyi]
- Check that TextMetrics::getSelectionRects() works correctly with textBaseline.:
FAIL
(Chrome:PASS
, Safari:FAIL
)
- Check that TextMetrics::getSelectionRects() works correctly with textBaseline.:
- /html/canvas/element/text/2d.text.measure.selection-rects-exceptions.tentative.html [wpt.fyi]
- Check that TextMetrics::getSelectionRects() throws when using invalid indexes.:
FAIL
(Chrome:PASS
, Safari:FAIL
)
- Check that TextMetrics::getSelectionRects() throws when using invalid indexes.:
- /html/canvas/element/text/2d.text.measure.selection-rects.tentative.html [wpt.fyi]
- Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align left, 0px letter spacing, and no-directional-override.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align left, 0px letter spacing, and no-directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align center, 0px letter spacing, and no-directional-override.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align center, 0px letter spacing, and no-directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align right, 0px letter spacing, and no-directional-override.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align right, 0px letter spacing, and no-directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align left, 10px letter spacing, and no-directional-override.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align left, 10px letter spacing, and no-directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align center, 10px letter spacing, and no-directional-override.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align center, 10px letter spacing, and no-directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align right, 10px letter spacing, and no-directional-override.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align right, 10px letter spacing, and no-directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align left, 0px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align left, 0px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align center, 0px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align center, 0px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align right, 0px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align right, 0px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align left, 10px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align left, 10px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align center, 10px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align center, 10px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align right, 10px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align right, 10px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
)
- Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align left, 0px letter spacing, and no-directional-override.:
- /html/canvas/offscreen/text/2d.text.measure.selection-rects-baselines.tentative.html [wpt.fyi]
- Check that TextMetrics::getSelectionRects() works correctly with textBaseline.:
FAIL
(Chrome:PASS
, Safari:FAIL
)
- Check that TextMetrics::getSelectionRects() works correctly with textBaseline.:
- /html/canvas/offscreen/text/2d.text.measure.selection-rects-baselines.tentative.worker.html [wpt.fyi]
- Check that TextMetrics::getSelectionRects() works correctly with textBaseline.:
FAIL
(Chrome:PASS
, Safari:FAIL
)
- Check that TextMetrics::getSelectionRects() works correctly with textBaseline.:
- /html/canvas/offscreen/text/2d.text.measure.selection-rects-exceptions.tentative.html [wpt.fyi]
- Check that TextMetrics::getSelectionRects() throws when using invalid indexes.:
FAIL
(Chrome:PASS
, Safari:FAIL
)
- Check that TextMetrics::getSelectionRects() throws when using invalid indexes.:
- /html/canvas/offscreen/text/2d.text.measure.selection-rects-exceptions.tentative.worker.html [wpt.fyi]
- Check that TextMetrics::getSelectionRects() throws when using invalid indexes.:
FAIL
(Chrome:PASS
, Safari:FAIL
)
- Check that TextMetrics::getSelectionRects() throws when using invalid indexes.:
- /html/canvas/offscreen/text/2d.text.measure.selection-rects.tentative.html [wpt.fyi]
- Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align left, 0px letter spacing, and no-directional-override.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align left, 0px letter spacing, and no-directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align center, 0px letter spacing, and no-directional-override.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align center, 0px letter spacing, and no-directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align right, 0px letter spacing, and no-directional-override.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align right, 0px letter spacing, and no-directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align left, 10px letter spacing, and no-directional-override.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align left, 10px letter spacing, and no-directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align center, 10px letter spacing, and no-directional-override.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align center, 10px letter spacing, and no-directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align right, 10px letter spacing, and no-directional-override.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align right, 10px letter spacing, and no-directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align left, 0px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align left, 0px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align center, 0px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align center, 0px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align right, 0px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align right, 0px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align left, 10px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align left, 10px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align center, 10px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align center, 10px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align right, 10px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction rtl, text align right, 10px letter spacing, and directional-override.:
FAIL
(Chrome:FAIL
, Safari:FAIL
)
- Check that TextMetrics::getSelectionRects() matches its DOM equivalent, with direction ltr, text align left, 0px letter spacing, and no-directional-override.:
Comment 4•4 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/aee3605ae92c
https://hg.mozilla.org/mozilla-central/rev/4804dfda8e9f
Description
•