Closed Bug 1581118 Opened 5 years ago Closed 5 years ago

[wpt-sync] Sync PR 19045 - [LayoutNG] Fix may_break_inside in NGLineBreaker

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Koji Ishii <kojii@chromium.org> wrote:

[LayoutNG] Fix may_break_inside in NGLineBreaker

This patch fixes |may_break_inside| in |NGLineBreaker|.

Issue 1002442 revealed an error case in |ShapingLineBreaker|.
In that case, it returns a result whose size is larger than
the available space.

Before this patch, |NGLineBreaker| assumes that the line
overflows if the result size is larger than the available
size, and sets |may_break_inside| to |false|, which
prevents breaking in |HandleOverflow()|. This can cause
rather a large layout error.

crrev.com/c/1797954 tried to fix the error in
|ShapingLineBreaker|, but it looks like some tests is relying
on the behavior and it was reverted.

This patch instead makes |NGLineBreaker| more robust, by
using the actual overflow state from |ShapingLineBreaker| to
compute |may_break_inside|. The error in |ShapingLineBreaker|
is not fixed yet, but with this fix, the worst result is to
not able to fit a word that can fit by less than 1px or so.

Further work for better correctness will be tracked in
issue 1003742.

Bug: 1002442, 1003742
Change-Id: I13a3172abc8a0d2f5f78b2dd0b57b85de593fdff

Reviewed-on: https://chromium-review.googlesource.com/1803019
WPT-Export-Revision: 92c38b2ddb9b40d9e89bfc19eb6056c819e8dac7

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Ran 1 tests and 1 subtests
OK     : 1
PASS   : 1
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d6a67db1a438
[wpt PR 19045] - [LayoutNG] Fix may_break_inside in NGLineBreaker, a=testonly
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.