|
1 | | -# Visual Order Caret Navigation for Bidirectional Text |
| 1 | +# Visual Order Caret Movement for Bidirectional Text |
2 | 2 |
|
3 | 3 | ## Authors |
4 | 4 |
|
5 | 5 | - Samba Murthy Bandaru (sambamurthy.bandaru@microsoft.com) |
6 | 6 |
|
7 | 7 | ## Participate |
8 | | -- Feature request: [Visual order caret navigation for bidi text](https://issues.chromium.org/issues/499819853) |
| 8 | +- Feature request: [Visual-order caret movement for bidi text](https://issues.chromium.org/issues/499819853) |
9 | 9 | - Spec: [Selection API -- `Selection.modify()`](https://w3c.github.io/selection-api/#dom-selection-modify) |
10 | 10 | - [Chromium editing-dev group](https://groups.google.com/a/chromium.org/g/editing-dev) |
11 | 11 |
|
@@ -48,7 +48,7 @@ This makes the current caret movement visually inconsistent: |
48 | 48 |
|
49 | 49 | This behavior is confusing and disorienting, particularly for users who routinely work with bidirectional content. |
50 | 50 |
|
51 | | -This explainer proposes implementing **visual caret navigation** in Chromium -- arrow key movement that always follows the on-screen direction, so that Right moves the caret rightward and Left moves it leftward regardless of text or line direction. The feature will be gated behind a feature flag for incremental rollout. |
| 51 | +This explainer proposes implementing **visual caret movement** in Chromium -- arrow key movement that always follows the on-screen direction, so that Right moves the caret rightward and Left moves it leftward regardless of text or line direction. The feature will be gated behind a feature flag for incremental rollout. |
52 | 52 |
|
53 | 53 | ## The Bidirectional Text Problem |
54 | 54 |
|
@@ -96,15 +96,15 @@ Visual movement solves this by moving the caret based on its **screen position** |
96 | 96 |
|
97 | 97 | 4. **Gate behind a feature flag** for safe incremental rollout, with no behavior change for users who do not opt in. |
98 | 98 |
|
99 | | -5. **Correctly handle all bidi scenarios**: simple LTR/RTL boundaries, multiple bidi runs, nested bidi embeddings, bidi control characters, CSS `direction`/`unicode-bidi` overrides, and cross-line navigation. |
| 99 | +5. **Correctly handle all bidi scenarios**: simple LTR/RTL boundaries, multiple bidi runs, nested bidi embeddings, bidi control characters, CSS `direction`/`unicode-bidi` overrides, and cross-line movement. |
100 | 100 |
|
101 | 101 | ## Non-Goals |
102 | 102 |
|
103 | 103 | 1. **Changing selection extension behavior.** Shift+Arrow selection operates on logical DOM offsets. True visual selection across bidi boundaries would require multi-range selection support in Chromium, which does not exist today. This is a potential future extension but is out of scope. |
104 | 104 |
|
105 | 105 | ## Proposed Solution |
106 | 106 |
|
107 | | -When the `BidiVisualOrderCaretNavigation` feature flag is enabled, Chromium's arrow key handling switches to visual (screen-order) caret movement. The implementation works by leveraging Blink's existing inline layout fragments, which are already stored in visual display order after bidi reordering. This allows the algorithm to walk through text in the order it appears on screen rather than the order it is stored in memory. |
| 107 | +When the `BidiVisualOrderCaretMovement` feature flag is enabled, Chromium's arrow key handling switches to visual (screen-order) caret movement. The implementation works by leveraging Blink's existing inline layout fragments, which are already stored in visual display order after bidi reordering. This allows the algorithm to walk through text in the order it appears on screen rather than the order it is stored in memory. |
108 | 108 |
|
109 | 109 | At a high level: |
110 | 110 |
|
@@ -135,7 +135,7 @@ With this feature enabled, `'left'` and `'right'` will perform true visual movem |
135 | 135 |
|
136 | 136 | The feature is currently gated behind a disabled-by-default runtime flag: |
137 | 137 |
|
138 | | -- **Command line:** `--enable-blink-features=BidiVisualOrderCaretNavigation` |
| 138 | +- **Command line:** `--enable-blink-features=BidiVisualOrderCaretMovement` |
139 | 139 |
|
140 | 140 | **Rollout phases:** |
141 | 141 |
|
|
0 commit comments