Closed Bug 1691651 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 27524 - Ensure hyphen word_end is greater than offset

Categories

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

task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

b'Javier Fern\xc3\xa1ndez Garc\xc3\xada-Boente <jfernandez@igalia.com>' wrote:

Ensure hyphen word_end is greater than offset

In r807457 we've changed the TextBreakIterator's default behavior, so
that break opportunities happen always after spaces. However, for
performance reasons, is convenient to consider also the end of the
non-hangable run for some operations. The hyphenation is one of these
operations.

When computing the word_end for hyphenation, we evaluate the next
opportunity to the passed 'offset', calling to the TextBreakIterator's
NextBreakOpportunity function; we use the FindNonHangableRunEnd method
to determine the final position.

However, the FindNonHangableRunEnd function searches backward from the
candidate until it finds a non-breakable character. This character may
be located before the 'offset' passed to the Hyphenate() function that
we are processing. This could lead to an arithmetic overflow when
computing the hyphenation length, since we have an end smaller than the
initial offset.

In order to prevent this situation, we use the max of the 'offset' and
the non-hangable run end.

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

Component: web-platform-tests → Layout: Text and Fonts
Product: Testing → Core

CI Results

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

Total 3 tests

Status Summary

Firefox

PASS: 1
FAIL: 2

Chrome

PASS: 1
FAIL: 2

Safari

PASS: 1
FAIL: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/css/css-text/hyphens/hyphens-auto-003.html: FAIL (Chrome: FAIL, Safari: FAIL)
/css/css-text/hyphens/hyphens-auto-004.html: FAIL (Chrome: FAIL, Safari: FAIL)

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/90110f38081b
[wpt PR 27524] - Ensure hyphen word_end is greater than offset, a=testonly
https://hg.mozilla.org/integration/autoland/rev/114950954d26
[wpt PR 27524] - Update wpt metadata, a=testonly
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e90c14b08076
[wpt PR 27524] - Ensure hyphen word_end is greater than offset, a=testonly
https://hg.mozilla.org/integration/autoland/rev/5c1504e4e550
[wpt PR 27524] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in before you can comment on or make changes to this bug.