contentEditable lists should not be splittable

RESOLVED FIXED in mozilla8

Status

()

Core
Editor
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: kaze, Assigned: kaze)

Tracking

unspecified
mozilla8
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Assignee)

Description

6 years ago
In design mode, pressing [Return] twice in a list (ol, ul, dl) splits the list and inserts a paragraph. When the list is the active editing host, it should not be split.

Reproducible: Always

Steps to Reproduce:
1. create an empty HTML file with the following code:
    <ul contenteditable>
        <li> foo </li>
        <li> bar </li>
    </ul>
2. put the caret at the end of the first list item
3. press [Return] twice
4. the resulting code is:
    <ul contenteditable>
        <li> foo </li>
    </ul>
    <p> <br _moz_dirty> </p>
    <ul contenteditable>
        <li> bar </li>
    </ul>

Expected Results:
    <ul contenteditable>
        <li> foo </li>
        <li> <br _moz_dirty> </li>
        <li> <br _moz_dirty> </li>
        <li> bar </li>
    </ul>
(Assignee)

Comment 1

6 years ago
bug 597349 and bug 570144 might be related.
(Assignee)

Updated

6 years ago
Assignee: nobody → kaze
(Assignee)

Updated

6 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 2

6 years ago
Created attachment 549776 [details] [diff] [review]
patch proposal
(Assignee)

Comment 3

6 years ago
Created attachment 549791 [details]
testcase
(Assignee)

Comment 4

6 years ago
Created attachment 549839 [details] [diff] [review]
patch proposal

slightly factorized code + unit tests
Attachment #549776 - Attachment is obsolete: true
Attachment #549839 - Flags: review?(ehsan)
Comment on attachment 549839 [details] [diff] [review]
patch proposal

Review of attachment 549839 [details] [diff] [review]:
-----------------------------------------------------------------

::: editor/libeditor/html/nsHTMLEditRules.cpp
@@ +6782,2 @@
>    // if we are in an empty listitem, then we want to pop up out of the list
> +  // but only if prefs says it's ok and if the parent isn't the active editing host.

Nit: if the list container isn't the active editing host.
Attachment #549839 - Flags: review?(ehsan) → review+
(Assignee)

Comment 6

6 years ago
Created attachment 550096 [details] [diff] [review]
patch proposal

same patch w/ fixed comment.
Attachment #549839 - Attachment is obsolete: true
Attachment #550096 - Flags: review?(ehsan)
Comment on attachment 550096 [details] [diff] [review]
patch proposal

(You didn't really need a review for this one :-)
Attachment #550096 - Flags: review?(ehsan) → review+
Pushed to inbound.
http://hg.mozilla.org/mozilla-central/rev/6ea906365d1f
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8

Updated

6 years ago
Depends on: 680279
You need to log in before you can comment on or make changes to this bug.