Open Bug 1237062 Opened 8 years ago Updated 3 years ago

Deleting line break after block image inside contenteditable

Categories

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

43 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: s.kuzmenko, Unassigned)

Details

Attachments

(1 file)

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

Steps to reproduce:

My Firefox version: 43.0.2 on OSX 10.9.5.

Consider this HTML fragment (^ indicates cursor position, at the end of content editable; img CSS display property is set to block):

<div contenteditable="true">
  <img src="...">
  ^<br>
</div>


Press delete/backspace key.


Actual results:

Image gets deleted.

Additionally I've noticed two more things:

1. Pressing left arrow key has no effect. To place cursor right behind the image one has to press arrow up.

2. Visually and functionally there is difference where the cursor is placed:

<img>^<br> (cursor is inlined with image; trailing line break can be removed by pressing "forward delete key" or fn+delete on Mac).

or

<img><br>^ (cursor is below image; line break cannot be removed)


However selection and range objects are fully identical in both cases.





Expected results:

I expect line break to be removed instead. I also expect to be able to move cursor behind the image with left arrow key.

Side note: if you are wondering why there is <br> element after block level img: it would be placed by Firefox editor after image insertion followed by pressing return key.

Bulk-downgrade of unassigned, 4 years untouched DOM/Storage bugs' priority.

If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: