• Morten Stenshorne's avatar
    [LayoutNG] Fix PositionForPoint() when within range in one axis only. · 71481f0a
    Morten Stenshorne authored
    This is a partial revert of patch set 4 in CL:2515399 (to the initial
    patch set). The change in patch set 4 was done in order to improve
    readability, but with one oversight: We'd set a non-zero distance when
    actually within range, since we'd always subtract one edge from another.
    
    This helps fix 6 tests, but the tests themselves also had to be updated,
    because legacy PositionForPoint() for multicol is broken when hitting
    above or below columns, in that it assumed UNIX / Mac editing behavior,
    which makes a difference when hitting just above the character at e.g.
    offset 2 in the first column. UNIX / Mac would return 0 as startOffset
    ("above the first line... okay, we're before the text, then"), while
    Windows should return 2 ("we're above the first line, but the nearest
    character is the one at offset 2 - use that"). Force Windows editing
    behavior in the tests, to fix this.
    
    The PositionForPoint() implementation for LayoutNG multicol is now
    behaving way better than the legacy engine, which allows us to add the
    missing parts to those tests (what we tested for vertical-rl was really
    limited due to legacy bugs). Legacy was also off-by-one for RTL columns,
    when hitting near the middle of a column gap (assigning one pixel too
    many to one column, and one too little to the other column).
    
    Rebaseline the tests. Everything now passes in LayoutNG, but there are
    obviously failures when running with the legacy engine now.
    
    Bug: 829028
    Change-Id: Iecdecf1454318e645fa91bac29119df0fc7ca377
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526402Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
    Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
    Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
    Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#825689}
    71481f0a
caret-range-outside-columns-rtl.html 5.01 KB