Chromium Code Reviews
Description[LayoutNG] Fix ShapingLineBreaker when the end of range is needed
This patch changes ShapingLineBreaker behavior when there is no break
opportunity within the range, and all glyphs can fit in the available
space.
NGLineBreaker expects the ShapeResult to the end of the range, and
handles breakability between the next item by itself in such case.
It used to expect whether there's a break opportunity at the end or not,
and the mock computed it anyway. The semantics was changed since
ShapingLineBreaker does not produce as part of other computation.
This patch enables ShapingLineBreaker by default, while keeping the mock
under #ifdef to ease the isolation of problems.
Most of test failures are ignorable, crashes turn to failures, minor
differences in measuring widths, or caused by other problems (e.g.,
innerText.)
spelling-huge-text.html looks problematic. ShapingLineBreaker is more
than 10 times slower for long lines (30k characters in single text node
in this case.) I have some hypothesis, but I'd like to defer the perf
until we get more real safe-to-break. Current mock safe-to-break
requires to reshape a lot, which is good to test reshape code, but is
not appropriate to look at the perf problems.
BUG=636993
Review-Url: https://codereview.chromium.org/2879093002
Cr-Commit-Position: refs/heads/master@{#478727}
Committed: https://chromium.googlesource.com/chromium/src/+/2476bc2b498e006eca452652f9436cf4cb7d12c5
Patch Set 1 #Patch Set 2 : Clamp available_width to >= 0 #Patch Set 3 : Rebase #Patch Set 4 : Rebase #Patch Set 5 : Add epsilon #Patch Set 6 : Try to change offsetForPosition #Patch Set 7 : Add a test for failing case #Patch Set 8 : Fix WrapLastWord case #Patch Set 9 : clang build fix #Patch Set 10 : Fixes to ShapeToEnd #Patch Set 11 : Back to Epsilon #Patch Set 12 : break_offset fix when ShapeToEnd, cleanup #Patch Set 13 : Removed epsilon, rebased on offset CL #Patch Set 14 : Fix ShapeToEnd, some cleanup #Patch Set 15 : Minor cleanup, re-test #Patch Set 16 : Fixes and TestExpectations #Patch Set 17 : Fix ShapingLineBreakerTest.ShapeLineRangeEndMidWord #Patch Set 18 : Rebased onto stale ComputedStyle fix #Patch Set 19 : TestExpectation for Mac 1px diff #Patch Set 20 : Rebase #
Total comments: 2
Messages
Total messages: 35 (28 generated)
|