Open Bug 1267897 Opened 5 years ago Updated 2 years ago

Cannot cursor across contentedible=false span at edge of contenteditable block

Categories

(Core :: DOM: Editor, defect)

44 Branch
defect
Not set
normal

Tracking

()

UNCONFIRMED

People

(Reporter: david, Unassigned)

Details

(Keywords: testcase)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0
Build ID: 20160209234513

Steps to reproduce:

1. Open data:text/html,<h1 contenteditable style="padding: .2em"><span contenteditable=false>XX</span>aa<span contenteditable=false>YY</span>bb<span contenteditable=false>ZZ</span></h1> .
2. Click between the two 'a's.
3. Press the right arrow key repeatedly.
4. Then press the left arrow key repeatedly.


Actual results:

Travelling rightwards, the cursor cannot cross 'ZZ' (it gets stuck at position { node: 'bb', offset: 2 } ).
Travelling leftwards, the cursor cannot cross 'XX' (it gets stuck at position { node: 'aa', offset: 0 } ).


Expected results:

Travelling rightwards, the cursor should cross 'ZZ' to reach { node: h1, offset: 5 } .
Travelling leftwards, the cursor should cross 'XX' to reach { node: h1, offset: 0 } .

Note that both { node: h1, offset: 0 } and { node: h1, offset: 5 } are reachable by clicking the mouse.

In Chromium the cursor behaves correctly (though there is a display glitch; see https://bugs.chromium.org/p/chromium/issues/detail?id=605433 ).
Component: Untriaged → Editor
Product: Firefox → Core
Keywords: testcase
Confirming that this is still the case with FF 62.

The same issue exists _between_ two uneditable inline elements—the cursor will skip them as a group when moved into them, which differs from Chrome/Safari's behavior and is problematic when those elements represent separate elements.
You need to log in before you can comment on or make changes to this bug.