Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset trailing space structure when rewinding due to overflow handling #25795

Merged
merged 1 commit into from Sep 28, 2020

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Sep 25, 2020

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}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants