Prevent hyphenation break 'offset' to be equal to 'start'
When looking for the previous/next breaking opportunity, we might need to evaluate hyphenation options, if enabled. The hyphenation logic expects the words without trailing spaces. However, since our change in r807457 we only consider breaking opportunities after spaces. We have adapted the code in the ShapingLineBreaker that was intended to evaluate the hyphenation opportunities and prepare the words to be hyphenated. Basically, we decided to use the non-hangable-run-end when required. However, this non-hangable-run-end position might be equal or smaller than the 'start' position we are considering. This might lead to a an invalid result when invoking CheckBreakOffset. We also have another DCHECK that might be violated in this scenario; it's ensuring that if we are under an overflow case, either we are processing a 'break-spaces' CSS value or the 'candidate' is not a breakable space. In any case, we mist ensure that the 'word_end', when used as the non-hangable-run-end, is always greater than the 'start' value. Bug: 1133254 Change-Id: I085102c6c0576ba26e1d398f51a0fea72a57e599 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2446690 Commit-Queue: Koji Ishii <kojii@chromium.org> Reviewed-by:Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#813583}
Showing
Please register or sign in to comment