Open Bug 961985 Opened 7 years ago Updated 2 years ago

contenteditable, then selected the whole paragraph and part of the next paragraph pressing backspace misbehave

Categories

(Core :: DOM: Core & HTML, defect)

26 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

UNCONFIRMED

People

(Reporter: hhhhemul, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/31.0.1650.63 Chrome/31.0.1650.63 Safari/537.36

Steps to reproduce:

<div contenteditable="true">
  <p id="p0">paragraph #0 text 0</p>
  <p id="p1">paragraph #1 text 1</p>
  <p id="p2">paragraph #2 text 2</p>
</div>
Let assume that selected whole p#p1 and "paragraph #2" in p#p2. Now press backspace.


Actual results:

<div contenteditable="true">
  <p id="p0">paragraph #0 text 0</p>
  " text 2"
</div>
" text 2" is a text node


Expected results:

<div contenteditable="true">
  <p id="p0">paragraph #0 text 0</p>
  <p id="p2"> text 2</p>
</div>
It is essential to start selection from beginnig p#p1. I.e. selection starts from begin of p#p1 and ends after "paragraph #2" in p#p2.
webkit behave acceptable but not strictly logical. In chromium result is:
<div contenteditable="true">
  <p id="p0">paragraph #0 text 0</p>
  <p id="p1"> text 2</p>
</div>

i.e. webkit delete content of p#p1 and selected content of p#p2 than append content of p#p2 to p#p1.
My opinion is gecko should behave like webkit in this situation.
Is this a regression?  In other words, did this use to work in older versions of Firefox?
On firefox 22.0 and 24.0 this issue keeps appear. It seems this isnt regression.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.