Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Issue 2875933006: [LayoutNG] Misc fixes in ShapingLineBreaker (Closed)

Created:
3 years, 7 months ago by kojii
Modified:
3 years, 7 months ago
Reviewers:
eae
CC:
atotic+reviews_chromium.org, blink-reviews, blink-reviews-layout_chromium.org, blink-reviews-platform-graphics_chromium.org, Rik, cbiesinger, chromium-reviews, dgrogan+ng_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, eae+blinkwatch, fmalita+watch_chromium.org, glebl+reviews_chromium.org, jchaffraix+rendering, Justin Novosad, kinuko+watch, leviw+renderwatch, ojan+watch_chromium.org, pdr+graphicswatchlist_chromium.org, pdr+renderingwatchlist_chromium.org, rwlbuis, Stephen Chennney, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[LayoutNG] Misc fixes in ShapingLineBreaker This patch: 1. Changes ShapingLineBreaker constructor to take LazyLineBreakIterator instead of locale and LineBreakType. LineBreakType was added to LazyLineBreakIterator in [1]. 2. Makes ShapingLineBreaker STACK_ALLOCATED to keep a pointer to LazyLineBreakIterator. 3. Fixes ShapingLineBreaker to take the range shaping into account. Measuring outside of the shaped range results in zero, which lead to incorrect results. 4. To fix 2 above, adds ShapeResult::CharacterStartIndex(), that returns the start index of range shaping. 5. Fixed ShapeResult::OffsetForPosition() to return start/end offset when the position is outside of the ShapeResult. Before this change, OffsetForPosition() returns visual right, which produces incorrect results for RTL. 6. Fixes RTL and its tests. Since ShapingLineBreaker depends on conversions between offsets and positions, and since positions in ShapeResult is visual, adds FlipRtl() function. 7. Fixes when first safe is beyond the break opportunity. CJK, Thai, and some other scripts do not use spaces for word boundaries. This occurs often in these scripts with current mock safe-to-break, but could happen in real scenario too. To do this, changed to compute break opportunity before first safe. 8. Fixes start position to floor and end position to ceil. This fixes an issue when available width is zero. 9. Fixes when shape range ends at the mid of a word. These fixes make at least a few simple cases to layout correctly with NGLineBreaker[2] when locally enabled. [1] https://codereview.chromium.org/2871173002 [2] https://codereview.chromium.org/2871733003 BUG=636993 Review-Url: https://codereview.chromium.org/2875933006 Cr-Commit-Position: refs/heads/master@{#471636} Committed: https://chromium.googlesource.com/chromium/src/+/51cc75bd66227dafea735ffa7ea1672b51a72e20

Patch Set 1 #

Patch Set 2 : clang build fix #

Total comments: 7

Patch Set 3 : eae review + RTL snapping fixes #

Messages

Total messages: 40 (33 generated)
kojii
PTAL. I hope they're well related but if I'm putting too many into one CL, ...
3 years, 7 months ago (2017-05-12 18:33:39 UTC) #12
eae
https://codereview.chromium.org/2875933006/diff/20001/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h File third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h (right): https://codereview.chromium.org/2875933006/diff/20001/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h#newcode71 third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h:71: unsigned CharacterStartIndex() const; CharacterOffset perhaps and CharacterLength for (NumCharacters) ...
3 years, 7 months ago (2017-05-12 18:45:49 UTC) #16
kojii
https://codereview.chromium.org/2875933006/diff/20001/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h File third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h (right): https://codereview.chromium.org/2875933006/diff/20001/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h#newcode71 third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h:71: unsigned CharacterStartIndex() const; On 2017/05/12 at 18:45:49, eae wrote: ...
3 years, 7 months ago (2017-05-12 19:08:13 UTC) #17
eae
LGTM https://codereview.chromium.org/2875933006/diff/20001/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h File third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h (right): https://codereview.chromium.org/2875933006/diff/20001/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h#newcode71 third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h:71: unsigned CharacterStartIndex() const; On 2017/05/12 19:08:13, kojii wrote: ...
3 years, 7 months ago (2017-05-12 21:24:05 UTC) #20
kojii
On 2017/05/12 at 21:24:05, eae wrote: > Perhaps we could be even more explicit and ...
3 years, 7 months ago (2017-05-14 17:53:31 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2875933006/80001
3 years, 7 months ago (2017-05-14 17:53:40 UTC) #37
commit-bot: I haz the power
3 years, 7 months ago (2017-05-14 17:57:49 UTC) #40
Message was sent while issue was closed.
Committed patchset #3 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/51cc75bd66227dafea735ffa7ea1...

Powered by Google App Engine
This is Rietveld 408576698