Fix NGLineBreaker::RewindOverflow crash
This patch is a re-fix of r819722 <crrev.com/c/2489730>. It turned out that |NGLineBreaker| hangs the attached test case before r819722, and crashes after. This is because |Rewind| may fail if the line has floats, and in that case, the current item is not a text item. This patch changes it to just setting the state to |kTrailing| and return, so that, if |Rewind| succeeds, |BreakLine| will call |HandleText|, which will call |HandleTrailingSpaces| when the text item starts with spaces. When |Rewind| fails, |BreakLine| can handle non-text items too. Bug: 1141384 Change-Id: I96e428d2c9ff50b3685c2a83eafdcea509749594 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2492700Reviewed-by:Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#820154}
Showing
Please register or sign in to comment