Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reland "New TextBreakIterator's default behavior breaks after space run" #25546

Merged
merged 1 commit into from Sep 16, 2020

Conversation

@chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Sep 15, 2020

This is a reland of 1cb4c9a70836c34cc0d5260902f71d3e8a2f67ec

Rebaselined a few tests for mac 10.14 and 10.15.

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}

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

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2412307 branch 5 times, most recently from 8e4a9fa to 2fd0a9d Sep 15, 2020
This is a reland of 1cb4c9a70836c34cc0d5260902f71d3e8a2f67ec

Rebaselined a few tests for mac 10.14 and 10.15.

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}

Change-Id: I9b5204f0b2e49367ab7d7a2107900763844fd2bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412307
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807457}
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2412307 branch from 2fd0a9d to 8ad7b19 Sep 16, 2020
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 5149942 into master Sep 16, 2020
22 checks passed
22 checks passed
Azure Pipelines Build #20200916.48 succeeded
Details
Azure Pipelines (./wpt test-jobs) ./wpt test-jobs succeeded
Details
Azure Pipelines (affected tests without changes: Safari Technology Preview) affected tests without changes: Safari Technology Preview succeeded
Details
Azure Pipelines (affected tests: Safari Technology Preview) affected tests: Safari Technology Preview succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests) wpt.fyi hook: safari-preview-affected-tests succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests-without-changes) wpt.fyi hook: safari-preview-affected-tests-without-changes succeeded
Details
download-firefox-nightly Community-TC (pull_request)
Details
lint Community-TC (pull_request)
Details
sink-task Community-TC (pull_request)
Details
staging.wpt.fyi - chrome[experimental] Chrome results
Details
staging.wpt.fyi - firefox[experimental] Firefox results
Details
staging.wpt.fyi - safari[experimental] Safari results
Details
wpt-chrome-dev-results Community-TC (pull_request)
Details
wpt-chrome-dev-results-without-changes Community-TC (pull_request)
Details
wpt-chrome-dev-stability Community-TC (pull_request)
Details
wpt-decision-task Community-TC (pull_request)
Details
wpt-firefox-nightly-results Community-TC (pull_request)
Details
wpt-firefox-nightly-results-without-changes Community-TC (pull_request)
Details
wpt-firefox-nightly-stability Community-TC (pull_request)
Details
wpt.fyi - chrome[experimental] Chrome results
Details
wpt.fyi - firefox[experimental] Firefox results
Details
wpt.fyi - safari[experimental] Safari results
Details
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-2412307 branch Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.