Reset trailing space structure when rewinding due to overflow handling
During the HandleOverflow we consider the possibility of breaking at previous opportunity. The logic for this case is implemented in the BreakTextAtPreviousBreakOpportunity function. In case that there is such suitable previous opportunity, we modify the ItemResult that includes this opportunity in its offset range. We also create a new ShapeResultView associated to this item_result, using the new offset range. However, it's possible that the trailing_collapsible_space_ structure already has this ItemResult instance, that we are now altering as part of the HandleOverflow logic. The problem described in the issue 1131470 is caused by this situation, where an ItemResult instance hold by the trailing_collapsible_space_ is modified. During the computation of the trailing spaces size, as part of the RemoveTrailingCollapsibleSpace function, we avoid calling to the TruncateLineEndResult, which will reshape again, in case the item_result considered is already present in the trailing_collapsible_space_ structure. This causes that we end up with an ItemREsult of a different size than the previously computed collapsed_shape_result. Bug: 1131470 Change-Id: I15b31303fb8ec52b6d7359880f2785d16e1a0c59 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2429411 Commit-Queue: Koji Ishii <kojii@chromium.org> Reviewed-by:Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#811115}
Showing
Please register or sign in to comment