From cc2f6b3e10e03144bc2952c06010c4bc11bbe816 Mon Sep 17 00:00:00 2001 From: Samba Murthy Bandaru Date: Wed, 29 Apr 2026 16:06:39 +0530 Subject: [PATCH] Fix modify() to use resolved text direction instead of inline base direction --- index.html | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 474aca3..f14ecc1 100644 --- a/index.html +++ b/index.html @@ -681,7 +681,7 @@

modify() method
-
+

The method must follow these steps:

@@ -707,13 +707,13 @@

forwards.
  • If direction is ASCII case-insensitive match - with "right" and [=inline base direction=] of this + with "right" and the resolved text direction at this selection's focus is ltr, set effectiveDirection to forwards.
  • If direction is ASCII case-insensitive match - with "left" and [=inline base direction=] of this + with "left" and the resolved text direction at this selection's focus is rtl, set effectiveDirection to forwards. @@ -731,6 +731,24 @@

    selection by granularity.

  • +

    + The resolved text direction at a boundary point + is ltr if the embedding + direction ([[!UAX9]] BD3) of the character at that position + is L, and rtl if the embedding + direction is R. +

    +

    + At a bidi boundary—where adjacent characters have different + embedding directions—user agents may use additional context + (such as caret affinity based on the direction of cursor + movement) to determine which character's embedding direction + to use. +

    We need to more precisely define what it means to extend or move selection by each granularity.