[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/c/chromium/src/+/1803019Reviewed-by:Emil A Eklund <eae@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#696621}
Showing
Please register or sign in to comment