Skip to content

Commit

Permalink
[ExtendedTextMetrics] Fix mixed bidi caretPositionFromPoint
Browse files Browse the repository at this point in the history
Mixed bidi text runs are always challenging when it comes to
PositionFromOffset and related methods, because a particular
location where the direction changes is the start of two runs
or the end of two runs. The choice of which index to return
depends on what the offset is going to be used for.

This CL changes caretPositionFromPoint to adjust the position
returned when at the end of a text run that does not match the
overall text direction. The position is moved to a neighboring
run to match the behavior of the DOM method, which in this case
is also probably better for building selection and insert behavior.

Fixed: 364332944
Change-Id: I742f567cdf0e9a116d5d430d47d952a0f7c04301
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5889819
Reviewed-by: Andres Ricardo Perez <andresrperez@chromium.org>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1363262}
  • Loading branch information
schenney-chromium authored and chromium-wpt-export-bot committed Oct 2, 2024
1 parent f15e421 commit f458a7d
Show file tree
Hide file tree
Showing 3 changed files with 891 additions and 81 deletions.
Loading

0 comments on commit f458a7d

Please sign in to comment.