Closed Bug 1035444 Opened 10 years ago Closed 3 years ago

Editing a contenteditable div skips non-text elements when deleting.

Categories

(Firefox for Android Graveyard :: Keyboards and IME, defect)

34 Branch
ARM
Android
defect
Not set
normal

Tracking

(firefox34 affected)

RESOLVED INCOMPLETE
Tracking Status
firefox34 --- affected

People

(Reporter: heath.borders, Unassigned)

References

Details

(Keywords: reproducible)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36

Steps to reproduce:

On a page with the following content:

<html>
<head>
<title></title>
</head>
<body>

<div contenteditable="true">Editable <ul><li>1</li><li>2</li></ul> <table border="5"><tr><td>T</td></tr><tr><td>U</td></tr></table> <img src="http://www.politicususa.com/wp-content/uploads/Screen-shot-2010-11-02-at-8.34.01-PM2-1.jpg?cdn=no"> Content!</div>

</body>
</html>

I placed the cursor at the end of "Content!" and started deleting.


Actual results:

The cursor skipped over the <img> element without deleting it. It also deleted the contents of the <li> elements, but didn't delete the <li> elements themselves. It deleted the contents of the table cells, but not the table cells themselves.


Expected results:

When the cursor is next to an image, and I delete, the image should be deleted.
When the cursor is inside an empty <li> element and I delete, the <li> element should be deleted.
When the cursor is outside of a table, it should not go inside of the table when deleting. It should stop deleting at the edge of the table. When inside a table cell, it should stop deleting at the edge of the cell.

Basically, Firefox for Android should behave just like desktop Firefox.
OS: Mac OS X → Android
Hardware: x86 → ARM
Version: Firefox 29 → Firefox 30
I reproduced this on my Nexus 5 (Android 4.4.4), w/Nightly (08/02), Google Keyboard.

JSFiddle: http://jsfiddle.net/9hj6z/
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: reproducible
Version: Firefox 30 → Firefox 34

Now it deletes <img>s and <li>s but not table cells.

Masayuki, do you have an idea why Android deletion behavior differs from desktop one?

Flags: needinfo?(masayuki)

I have no idea because editor code is completely cross-platform design, meaning there is no #ifdefs. But some caret style pref may be different from desktop's. I guess that such prefs may cause the difference.

Flags: needinfo?(masayuki)
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.