Closed Bug 1602855 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 20708 - [LayoutNG] Fix hyphens when rewinding occurs

Categories

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

task

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox73 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Koji Ishii <kojii@chromium.org> wrote:

[LayoutNG] Fix hyphens when rewinding occurs

This is a re-land of:
https://chromium-review.googlesource.com/c/chromium/src/+/1868534

The original patch caused a regression and was reverted for
crbug.com/1028817. A test was added for the case at:
https://chromium-review.googlesource.com/c/chromium/src/+/1941451

The problem happened when |HandleOverflow| tried to break a
text item but it didn't fit. |NGLineBreaker| looks for
previous opportunities and rewind, but items it tried to
break were modified, which confused |NGLineBreaker|.

The old patch stopped rewinding there. The new approach is to
restore the original item when it failed to break so that it
can always see the original items.

:: The original description follows ::

This patch removes |NGLineInfo::LineEndFragment|, which was
introduced to support hyphens and ellipsis with the single
code. However, ellipsis was changed to use different code,
and |LineEndFragment| ended up with non-optimal way to handle
hyphens.

Although hyphens appear at most once in a line, storing this
to |NGLineInfo| makes harder to keep it in sync with the
hyphenated item. This patch changes it to a field in
|NGInlineItemResult|.

Bug: 1015297
Change-Id: I1dab0dacd8445ed563527bdc90d58b18470725f1
Reviewed-on: https://chromium-review.googlesource.com/1943784
WPT-Export-Revision: f15896834523017b7486b8dae8183d010d5597f6

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

CI Results

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

Total 1 tests

Status Summary

Firefox

PASS: 1

Chrome

FAIL: 1

Safari

PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8804236fbe7a
[wpt PR 20708] - [LayoutNG] Fix hyphens when rewinding occurs, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.