You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps 7–8 of Selection.modify() use the inline base direction (paragraph-level CSS direction) to map "left"/"right" to forwards/backwards. This is wrong when the caret is inside a bidi run with a different direction.
<pdir="ltr">Hello שלום world</p>
When the caret is inside "שלום" (an RTL run) and the user presses the Right arrow, the current spec maps Right to forwards, and moves the caret visually to the left. This is incorrect.
The spec should instead use the resolved text direction at the caret (rtl), which maps Right to backwards and moves the caret visually to the right.
Fix: Replace "inline base direction" with "resolved text direction at the focus" (bidi embedding level per UAX#9: even = LTR, odd = RTL).
Browser behavior: Firefox and Safari already use resolved text direction. Chromium currently matches the spec text; a fix is in progress. This change aligns the spec with majority interoperable behavior.
Please file bugs for each browser and have this discussed at an editing WG meeting.
Ack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Agenda+Queue this item for discussion at the next WG meeting
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Steps 7–8 of
Selection.modify()use the inline base direction (paragraph-level CSSdirection) to map"left"/"right"to forwards/backwards. This is wrong when the caret is inside a bidi run with a different direction.When the caret is inside "שלום" (an RTL run) and the user presses the Right arrow, the current spec maps Right to forwards, and moves the caret visually to the left. This is incorrect.
The spec should instead use the resolved text direction at the caret (rtl), which maps Right to backwards and moves the caret visually to the right.
Fix: Replace "inline base direction" with "resolved text direction at the focus" (bidi embedding level per UAX#9: even = LTR, odd = RTL).
Browser behavior: Firefox and Safari already use resolved text direction. Chromium currently matches the spec text; a fix is in progress. This change aligns the spec with majority interoperable behavior.
Preview | Diff