Closed Bug 1667142 Opened 5 years ago Closed 5 years ago

[wpt-sync] Sync PR 25776 - Consider the case of an unsafe start when truncating line-end results

Categories

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

task

Tracking

()

RESOLVED INVALID

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

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

Consider the case of an unsafe start when truncating line-end results

The function TruncateLineEndResult is used to generate a new shape
result when we have collapsible trailing spaces that need to be removed.
We were considering only the case of unsafe positions, determined by the
end_offset function's argument, to force a re-shape of the line-end
result.

However, it's possible that the source_result had already different
parts, mainly due an unsafe break. If we don't consider this case, we
can generate a new ShapeResultView instance with just one segment, using
just the ItemResults's start and end offsets.

The DCHECK violation detected in the issue 1130153 is originated by the
scenario described above. This specific problem happens when we compare
tge result of the ShapeResult::OffsetToFit, based on the result's
segments, with the original offset's length, obtained from the item's
TextOffset range.

This CL tries to solve the issue by adding a new logic in the
TruncateLineEndResult function for detecting unsafe start_offset and
re-shape this segment as part of the new line-end result.

Bug: 1130153, 1131470
Change-Id: I0e4bc044dcbe9ea5bbe67888f39f00bae877aa8b
Reviewed-on: https://chromium-review.googlesource.com/2424188
WPT-Export-Revision: bbce21c2a159f979ae8a63dd645b9e83e1458db7

Component: web-platform-tests → Layout: Text and Fonts
Product: Testing → Core
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.