[LayoutNG] Interaction of trailing spaces and floats |
||
Issue descriptionWhen floats need to determine whether it can fit into the line or not, it needs to know the width if the line was broken there. To do this, it eliminates trailing spaces if the float is at "trailing" position, but scanning the rest of items can detect only block trailing position, and thus does not eliminate trailing spaces if the line wraps there. Line breaker needs to give a way to measure the line width if the line was broken there, without actually breaking the line for this purpose. Following tests fail due to this problem: external/wpt/css/css-writing-modes/float-vlr-013.xht external/wpt/css/css-writing-modes/float-vrl-012.xht
,
Jul 18
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/09223a462874b6cab6bfdcaf0497b390f6b62b12 commit 09223a462874b6cab6bfdcaf0497b390f6b62b12 Author: Koji Ishii <kojii@chromium.org> Date: Wed Jul 18 19:33:32 2018 [LayoutNG] Fix float fitting logic when there are trailing spaces When computing whether a float can fit in the line or not, NGLineBreaker needs to know the current width after trailing spaces are collapsed. The current logic removes trailing spaces before computing it, but only at the end of the block. To compute this correctly on each wrapped line, this patch adds TrailingCollapsibleSpaceWidth() that computes without removing it, so that it can be removed only when the float fits. This allows us to check whether the float can fit or not for each wrapped line. In many cases, the computed trailing spaces will be removed. This patch also adds a cache to avoid computint it twice, because it may involve re-shaping. Rather large refactoring in order to split computing and removing, to avoid computing twice, and to avoid failures due to rewinding positioned floats. Bug: 862066 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: Ica6ce94fca63d5bdcf7784eead53dba6e680e177 Reviewed-on: https://chromium-review.googlesource.com/1133599 Commit-Queue: Koji Ishii <kojii@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/master@{#576165} [modify] https://crrev.com/09223a462874b6cab6bfdcaf0497b390f6b62b12/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG [modify] https://crrev.com/09223a462874b6cab6bfdcaf0497b390f6b62b12/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc [modify] https://crrev.com/09223a462874b6cab6bfdcaf0497b390f6b62b12/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.h
,
Jul 19
|
||
►
Sign in to add a comment |
||
Comment 1 by kojii@chromium.org
, Jul 11