Closed Bug 1624270 Opened 4 years ago Closed 4 years ago

[wpt-sync] Sync PR 22388 - [LayoutNG] Fix text-overflow: ellipsis with scrolling

Categories

(Core :: Layout: Scrolling and Overflow, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Manuel Rego Casasnovas <rego@igalia.com> wrote:

[LayoutNG] Fix text-overflow: ellipsis with scrolling

When we have "text-overflow: ellipsis" on an element we only truncate
the text once (during the layout) and not after a scrolling happens.
So if we perform any kind of scrolling after the initial layout,
the position of the ellipsis doesn't change and we cannot see
the rest of the text.

This patch fixes the issue by forcing a relayout during scrolling
in PaintLayerScrollableArea::UpdateScrollOffset() if the element
has to truncate the overflow.

The patch also modifies NGInlineLayoutAlgorithm::CreateLine()
to take into account the scrolling offset and pass this information to
to NGLineTruncator::TruncateLine().

Apart from the new tests added on this patch, the following one
starts to pass on Linux and Windows: css/css-ui/text-overflow-021.html
(not passing on Mac due to rounding issues related to fonts).

Bug=745905
TEST=external/wpt/css/css-overflow/text-overflow-scroll-001.html
TEST=external/wpt/css/css-overflow/text-overflow-scroll-vertical-lr-001.html
TEST=external/wpt/css/css-overflow/text-overflow-scroll-vertical-rl-001.html

Change-Id: I975ca86dbdfedf92875c08736539fb2f33f68c54
Reviewed-on: https://chromium-review.googlesource.com/2113495
WPT-Export-Revision: e6a6a47d3f2951252364572324ee4119a1793489

Component: web-platform-tests → Layout: Scrolling and Overflow
Product: Testing → Core

CI Results

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

Total 6 tests

Status Summary

Firefox

PASS: 6

Chrome

FAIL: 6

Safari

FAIL: 6

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c5c828b67e00
[wpt PR 22388] - [LayoutNG] Add tests for text-overflow: ellipsis with scrolling, a=testonly
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.