• Javier Fernández García-Boente's avatar
    Ensure the break-offset is greater than the non-hangable run end · 0ef4384b
    Javier Fernández García-Boente authored
    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: default avatarKoji Ishii <kojii@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#842461}
    0ef4384b
TestExpectations 497 KB