Bug 57149 - Ending a list in contentEditable/designMode with enter produces a div
Summary: Ending a list in contentEditable/designMode with enter produces a div
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://tinymce.moxiecode.com/safari/e...
Depends on:
Blocks: 6627
  Show dependency treegraph
Reported: 2011-03-26 07:33 PDT by Moxiecode Systems
Modified: 2011-08-19 09:03 PDT (History)
4 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Moxiecode Systems 2011-03-26 07:33:20 PDT
Ending a list in contentEditable/designMode with enter produces a div it should produce a BR element like Gecko.

Steps to reproduce:
1. Open the attached url.
2. Place caret behind the X inside editable area below.
3. Press enter twice.
4. Click the Dump HTML link observe the HTML produced.

Expected result:

Actual result:
Comment 1 Annie Sullivan 2011-05-18 17:57:38 PDT
Generally when the user presses enter WebKit uses <div> to separate lines, instead of <br> like Gecko. Are you asking to change it just in this specific case, or in all cases? If it's just this case, what's the reasoning?

FYI, there is a thread about the html that is generated when pressing enter on the whatwg mailing list: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-May/031577.html
Comment 2 Aryeh Gregor 2011-08-19 09:03:16 PDT
The result of that discussion was that we should converge on the behavior of IE/Opera, which is to use <p>'s; and to wrap every line in a <p>, even the first (see bug 31678).  That's what I wrote in the spec:


In practice, this is one of the most annoying interop issues with contenteditable: IE/Opera uses <p>, Gecko uses <br>, WebKit uses <div>.  The big issue here is that this affects even authors who don't use execCommand() at all, which lots of authors don't because it's too unreliable.  They still have to use contenteditable, and this is one of the biggest differences between browsers for contenteditable.  They also behave differently for delete and so on, but this difference affects every contenteditable region where the user ever pressed Enter, which is almost all of them.

So IMO, this would be a good thing to prioritize.  That way at least browsers would produce similar markup for the case where the user just types text in contenteditable without running execCommand().