Commit Graph
8 Commits
Author SHA1 Message Date
John O'Keefe 800fb2fa02 Fix inverted probe collapse in the touch selection clamp 2026-09-13 18:32:58 -04:00
John O'Keefe cae618ac87 Fix selectionIsBackward for iframe selections
The helper created its probe range in the module's own document
(the host, in the bundled web reader), so boundary points in the
content iframe collapsed the range and every selection read as
backward.
2026-09-13 18:30:09 -04:00
John O'Keefe 2e392e80d3 Retry the touch selection clamp after the gesture ends 2026-09-13 18:26:47 -04:00
John O'Keefe 5102fc70dd Clamp by geometry, not the visible range
The last visible range can extend past the visible column on text
nodes that span multiple columns (its end-offset bisect uses union
rects), so comparing DOM boundary points against it misses off-view
selection endpoints. Test the endpoint caret rect against the
visible column bounds instead.
2026-09-13 18:23:52 -04:00
John O'Keefe 2a54b52fdb Keep touchSelecting armed through collapsed selectionchange events
Chrome emits collapsed selectionchange events while the long-press
word selection is being set up; clearing the flag on them disarmed
the clamp before the selection ever became a Range.
2026-09-13 18:18:03 -04:00
John O'Keefe 8ac36efbda Fix clamp coordinates: caretRangeFromPoint needs content-space bounds 2026-09-13 18:14:25 -04:00
John O'Keefe e1fa4698c6 Clamp touch selection endpoints to the visible page
Chrome word-snapping during a touch selection drag can map the
endpoint past the visible column into the next (off-screen) page,
selecting the entire visible page at once. Re-map the endpoint via
caretRangeFromPoint at the same line height inside the visible
column whenever it lands outside the last visible range.
2026-09-13 18:07:36 -04:00
John O'Keefe de70103651 Fix touch selection paging away mid-drag: gate selection auto-paging to non-touch pointers 2026-09-13 17:18:47 -04:00