Closed Bug 1327917 Opened 8 years ago Closed 7 years ago

[contenteditable] breaks text editing after typing: no caret displayed, typing doesn't work

Categories

(Core :: DOM: Editor, defect, P2)

39 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1175418
Tracking Status
firefox50 --- wontfix
firefox51 --- wontfix
firefox52 --- wontfix
firefox53 --- wontfix
firefox54 --- fixed
firefox55 --- fixed

People

(Reporter: arni2033, Unassigned)

References

()

Details

(Keywords: regression)

>>>   My Info:   Win7_64, Nightly 49, 32bit, ID 20160526082509
STR_1:
1. Open url   data:text/html,<div contenteditable>asdf asdf<br>z
2. Click in contenteditable element
3. Press Ctrl+A, then Right key, then type "z"
4. Press Ctrl+A, then Right key, then type "z"
5. Press BackSpace

AR:  "asdf asdf\nzz".  Caret disappears from [contenteditable]. Typing further text has no effect
ER:  "asdf asdf\nzz[caret]"
Component: Untriaged → Editor
Product: Firefox → Core
No longer blocks: 1277113
Narrowed nightly regression window from [2015-03-13, 2015-03-15] (2 days) to [2015-03-13, 2015-03-14] (1 days) (~0 steps left)
Got as far as we can go bisecting nightlies...
Last good revision: 42afc7ef5ccb (2015-03-13)
First bad revision: 38154607d807 (2015-03-14)
Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=42afc7ef5ccb&tochange=38154607d807

Ehsan, could you take a look and see if this is related to bug 1100966?
Flags: needinfo?(ehsan)
Version: Trunk → 39 Branch
Redirecting to Masayuki.
Flags: needinfo?(ehsan) → needinfo?(masayuki)
Priority: -- → P2
testcase: https://jsfiddle.net/d_toybox/qv6z2skc/1/
Looks like that pressing ArrowRight key sets selection range to the end of <div>. That's the unexpected behavior. Like Chromium, we should set the selection range at the end of the last text node.
Flags: needinfo?(masayuki)
Ah, but the actual cause of this is, "Select All" causes setting ranges entire children of the <div>. Chromium sets first child's 0 to the end of the last child. So, looks like this is a compatibility issue of selection.
According to https://bugs.chromium.org/p/chromium/issues/detail?id=336821, they think that Chromium's selectAllChildren() is buggy and Selection API spec also defines that it should behave as ours.

So, I think that we should only change the behavior of "Select All" in editor.
Hmm, or, perhaps, we should make EditorBase::FindBetterInsertionPoint() HTMLEditor aware because Selection API can set same result as current "Select All".
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Too late for a fix for 53, as we are in the last week of the 53 beta cycle.
Masayuki, do you think a fix for 54 is feasible?
Flags: needinfo?(masayuki)
(In reply to Nathan Froyd [:froydnj] from comment #8)
> Masayuki, do you think a fix for 54 is feasible?

Ah, no. I'm working on other urgent bugs.
Assignee: masayuki → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(masayuki)
Blocks: 1100966
I can reproduce this on Firefox 52 and 53, but I cannot reproduce on the latest Nightly (55).  Is this fixed by other bugs?
maybe bug 1175418?  I will check by mozregression.
This is fixed by bug 1175418.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
For the record, if this is fixed by bug 1175418, that probably means the underlying code still doesn't handle adjacent text nodes correctly.  Bug 1175418 only removes one case where there will be adjacent text nodes, so this bug will still presumably occur in other cases where there are adjacent text nodes.  So I'm not sure this should be RESOLVED.  (But if no one is interested in finding a new test-case, I guess we may as well leave it.)
You need to log in before you can comment on or make changes to this bug.