Improve word-break: break-all and word-wrap: break-word
This patch improves:
1. Performance of "word-wrap: break-word" and "word-break: break-all".
2. "word-wrap: break-word" no longer breaks shaping scripts when it
should not (crbug.com/380667).
This patch does not give a complete support when a shaped word is
broken by these properties. More accurate break using the safe-to-break
feature in HarfBuzz and rendering support will be in future patches.
Before this patch, BreakingContext::handleText() measures all
substrings to measure the correct width of joining scripts. For a
"word", this means it measures "w", "wo", "wor", and "word". This
method does not work when a shaped words can be shorter by adding more
characters.
With this patch, Blink tries normal line breaking. Then at the break
point, Blink rewinds the break point to the largest number of glyphs
that can fit.
BUG=
380667,
591793,
479370
Committed:
https://crrev.com/d12b58ef0005d24dff2047f566f5ff5a5f2e45fb
Cr-Commit-Position: refs/heads/master@{#385693}