Closed Bug 1665112 Opened 4 years ago Closed 4 years ago

[wpt-sync] Sync PR 25543 - Revert "New TextBreakIterator's default behavior breaks after space run"

Categories

(Core :: Layout: Text and Fonts, task, P4)

task

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

b'Ian Clelland <iclelland@chromium.org>' wrote:

Revert "New TextBreakIterator's default behavior breaks after space run"

This reverts commit 1cb4c9a70836c34cc0d5260902f71d3e8a2f67ec.

Reason for revert: Test failures on MacOS 10.14 and 10.15 bots seem to be caused by this CL.

See https://ci.chromium.org/p/chromium/builders/ci/Mac10.15%20Tests/4038
(https://ci.chromium.org/p/chromium/builders/ci/Mac10.15%20Tests/4037 included the change, but failed for an unrelated reason)
and
https://ci.chromium.org/p/chromium/builders/ci/Mac10.14%20Tests/8410
(and subsequent builds on both bots)

Layout test failure example:
https://test-results.appspot.com/data/layout_results/Mac10_14_Tests/8416/blink_web_tests/layout-test-results/results.html

This looks like it is just a test result that needs to be updated, but it's also possible that the new breaking algorithm is incorrect in this case.
Reverting since the original change landed within the last few hours.

Original change's description:

New TextBreakIterator's default behavior breaks after space run

Before this change, we were considering breaking opportunities before
space runs. This approach allowed us to avoid re-shaping in many cases,
which has an important advantage in terms of performance.

However, the Unicode spec (UAX#14) state that breaking before a space
character is not allowed [1], so we had to implement this logic after
our TextBreakIterator had already determined the best breaking
opportunity. This approach has been working fine so far for regular
spaces (white-space, tabs, ...), but it doesn't work correctly for
other BA [2] class characters; in the CSS Text specification, these are
known as "other space separators" [3].

In order to implement the correct behavior for any kind of space, we
would need to change our TextBreakIterator implementation so that
matches the Unicode rules, considering breaking opportunity after
space runs. This change should also consider the performance impact
of the extra re-shaping operations required to deal with trailing
spaces.

In order to prevent performance regressions, we'll store the position
of the 'end of non-hangable run', which will be used in case of items
with styles dictating rules to collapse trailing spaces.

[1] https://unicode-org.atlassian.net/browse/ICU-20843
[2] https://www.unicode.org/reports/tr14/tr14-39.html#BA
[3] https://drafts.csswg.org/css-text-3/#other-space-separators

Change-Id: Ie4a3890c75a3faff1a0155d4a40bcaa85bc6ac06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2047943
Commit-Queue: Javier Fernandez \<jfernandez@igalia.com>
Reviewed-by: Koji Ishii \<kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806928}

TBR=jfernandez@igalia.com,kojii@chromium.org

Change-Id: I79a3c7f20064ecc4f5c995f35027c730eb7c409d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412131
Reviewed-by: Ian Clelland \<iclelland@chromium.org>
Commit-Queue: Ian Clelland \<iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807019}

PR 25543 applied with additional changes from upstream: 866f0228c9e87b4d2eddb0afcc0c95c38bd95d49
Component: web-platform-tests → Layout: Text and Fonts
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests

Status Summary

Firefox

FAIL: 1

Chrome

FAIL: 1

Safari

PASS: 1

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/css/css-text/white-space/white-space-wrap-after-nowrap-001.html: FAIL (Chrome: FAIL, Safari: PASS)

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/92d111f02a43 [wpt PR 25543] - Revert "New TextBreakIterator's default behavior breaks after space run", a=testonly
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.