Bug 1693544 [wpt PR 27677] - Consider the hyhen size in the available width when...
commit51187fc8a51514a16ee46896ab47deffe651f38a
authorJavier Fernández García-Boente <jfernandez@igalia.com>
Mon, 22 Feb 2021 21:54:02 +0000 (22 21:54 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Fri, 5 Mar 2021 16:17:33 +0000 (5 16:17 +0000)
tree14302ad32a6adc7bdad9b5d2c89dbdc1219dd688
parent6fc262925a437fc23c8f889df6b5694e226b6770
Bug 1693544 [wpt PR 27677] - Consider the hyhen size in the available width when evaluating overflow, a=testonly

Automatic update from web-platform-tests
Consider the hyhen size in the available width when evaluating overflow

The logic in NGLineBreaker::BreakText completes the algorithm by
evaluating whether the NGInlineItem inline size fits in the available
width, received in the function argument "available_width".

However, when hyphenation is applied, we reduce this initial available
width, subtracting the hyphen inline size, and run another iteration of
the ShapeLine() function. The new item's inline size is evaluated again
to check whether it overflows or not.

The root case of the issue described in the bug is that we are using
the value stored in the available_width variable, which we've just
reduced because of hyphenation. We should use the
available_width_with_hyphens variable instead.

Bug: 1175716
Change-Id: I3ecac2362f7cf9951cd0d323a7b163385d240f89
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2704079
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#855647}

--

wpt-commits: 7550407f4cfcf8368f12858ad0e9800887c8ee22
wpt-pr: 27677
testing/web-platform/tests/css/css-text/hyphens/hyphens-auto-005.html [new file with mode: 0644]
testing/web-platform/tests/css/css-text/hyphens/reference/hyphens-auto-005H-ref.html [new file with mode: 0644]
testing/web-platform/tests/css/css-text/hyphens/reference/hyphens-auto-005M-ref.html [new file with mode: 0644]