[BidiCaretAffinity] Caret display and hit test location mismatch issues |
|
Issue descriptionThis is the umbrella bug for all issues that hit test location and caret display location mismatch when bidi caret affinity is enabled.
,
Yesterday
(25 hours ago)
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/426bd2af7f4e16ff1fe20573e3382d355a27192c commit 426bd2af7f4e16ff1fe20573e3382d355a27192c Author: Xiaocheng Hu <xiaochengh@chromium.org> Date: Tue Jan 22 05:20:02 2019 [BidiCaretAffinity] Fix caret rect calculation in legacy layout when after collapsed space When caret is after collapsed spaces, e.g., "foo |ABC", VisiblePosition canonicalizes to "foo | ABC" instead. However, the downstream caret should be displayed at "foo CBA|" instead of "foo |CBA". Current implementation fails to do so because it fails to find the correct InlineTextBox whose offset range contains the canonicalized offset. This patch fixes that by also checking the nearest text boxes that are out of range. The newly added layout test currently doesn't pass with bidi caret affinity, as it requires NGCaretNavigator to handle line wrap info. It will be fixed in a follow up patch. Note: the root cause seems to be in VisiblePosition canonicalization, which however might be too complex or risky to fix. This patch works around it instead. Bug: 923087 Change-Id: I0a1ab862a9f0ffc72a6fd6503ab48fe88190e3cf Reviewed-on: https://chromium-review.googlesource.com/c/1419265 Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Cr-Commit-Position: refs/heads/master@{#624730} [modify] https://crrev.com/426bd2af7f4e16ff1fe20573e3382d355a27192c/third_party/blink/renderer/core/editing/inline_box_position.cc [modify] https://crrev.com/426bd2af7f4e16ff1fe20573e3382d355a27192c/third_party/blink/web_tests/TestExpectations [add] https://crrev.com/426bd2af7f4e16ff1fe20573e3382d355a27192c/third_party/blink/web_tests/editing/caret/bidi_hit_test_caret_consistency.html |
|
►
Sign in to add a comment |
|
Comment 1 by xiaoche...@chromium.org
, Jan 17 (5 days ago)