Bug 1883213 [wpt PR 44896] - [text-spacing-trim] Stop assuming offset 0 is safe-to...
commit10d2f384e60b5360be750c605aaf07e594f4e071
authorKoji Ishii <kojii@chromium.org>
Mon, 4 Mar 2024 18:16:45 +0000 (4 18:16 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Tue, 12 Mar 2024 07:05:45 +0000 (12 07:05 +0000)
tree7380e766bac105764ff705cd05c558db5282cccb
parent711312f8c4950703d205f3c1dc1caca926f17531
Bug 1883213 [wpt PR 44896] - [text-spacing-trim] Stop assuming offset 0 is safe-to-break, a=testonly

Automatic update from web-platform-tests
[text-spacing-trim] Stop assuming offset 0 is safe-to-break

This patch stops `ShapeResult` to assume the offset 0 is
always safe-to-break.

It was an micro-optimization in the legacy engine, where the
first glyph of an output from HarfBuzz is safe-to-break.

NG shapes across elements and splits a `ShapeResult` into
multiple `ShapeResult`s. In that case, the first glyph of a
`ShapeResult` may not be safe-to-break.

Two relevant fixes:
* Fix `HanKerning` didn't add a synthesized unsafe-t-break for
  the first glyph because it wasn't used.
* Fix how `AddUnsafeToBreak` computes run-local offset when
  the start index isn't 0.

Fixed: 326903564
Change-Id: I66578f6a270a771c3cd974442e1c332a64d9a910
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5334684
Auto-Submit: Koji Ishii <kojii@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1267637}

--

wpt-commits: 71200b77aa8dbd4b13388ba6e5a797d0dd72f1d6
wpt-pr: 44896
testing/web-platform/tests/css/css-text/text-spacing-trim/text-spacing-trim-span-001-ref.html [new file with mode: 0644]
testing/web-platform/tests/css/css-text/text-spacing-trim/text-spacing-trim-span-001.html [new file with mode: 0644]