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

Ensure the break-offset is greater than the non-hangable run end #27016

Merged
merged 1 commit into from Jan 12, 2021

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Dec 29, 2020

The ShapeLineBreaker::NextBreakOpportunity function determines the
non-hangable run end based on the currently break-offset. This value
is, by definition, always smaller than the break-offset. However, if
the break-offset value exceed the range_end, we use this as the actual
offset.

If we have reached this scenario because there is no breaking
opportunity to prevent the overflow, then we just call ShapeToEnd and
return. Otherwise, we continue processing the text item. In this
situation, we must ensure that the new offset is greater than the
previously computed non-hangable run end, since it's possible that we
end up using it as the final offset, leading to the assert violation
described in the bug, since the used break-offset is smaller than the
item's end.

This CL adds the logic to prevent this situation, clearing the
non-hangable run end and computing it again, if necessary, based on
the new offset.

Bug: 1161793
Change-Id: Ie10ffae3c654aefa626d80abd01bd38e026c9e27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2604908
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842461}

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.

@chromium-wpt-export-bot chromium-wpt-export-bot changed the title Ensure the break-offset is greater than then non-hangable run end Ensure the break-offset is greater than the non-hangable run end Dec 29, 2020
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2604908 branch 2 times, most recently from e54c630 to 1278556 Compare January 3, 2021 23:32
The ShapeLineBreaker::NextBreakOpportunity function determines the
non-hangable run end based on the currently break-offset. This value
is, by definition, always smaller than the break-offset. However, if
the break-offset value exceed the range_end, we use this as the actual
offset.

If we have reached this scenario because there is no breaking
opportunity to prevent the overflow, then we just call ShapeToEnd and
return. Otherwise, we continue processing the text item. In this
situation, we must ensure that the new offset is greater than the
previously computed non-hangable run end, since it's possible that we
end up using it as the final offset, leading to the assert violation
described in the bug, since the used break-offset is smaller than the
item's end.

This CL adds the logic to prevent this situation, clearing the
non-hangable run end and computing it again, if necessary, based on
the new offset.

Bug: 1161793
Change-Id: Ie10ffae3c654aefa626d80abd01bd38e026c9e27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2604908
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842461}
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

4 participants