The default bug view has changed. See this FAQ.

After pressing Enter, editable DIVs in list items are duplicated

RESOLVED FIXED in mozilla9

Status

()

Core
Editor
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: Igor Stepin, Assigned: kaze)

Tracking

({testcase})

unspecified
mozilla9
x86
All
testcase
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3

Looks like div with contenteditable inside dl/dd broken.

Reproducible: Always

Steps to Reproduce:
1. Type '123' in the editable div
2. Press 'Enter' key
Actual Results:  
Doublicated empty div (with the same id) added.

Expected Results:  
New line (br tag) added in the editable div.

Testcase:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>contenteditable enter error</title>
    </head>
    <body>
        <form action="#">
            <dl>
                <dt>Editable div broken:</dt>
                <dd>
                    <textarea id="body" name="body" style="display: none;" cols="80" rows="5"></textarea>
                    <div id="body2" style="border: 1px solid black" contenteditable="true"><p><br/></p></div>
                </dd>
            </dl>
        </form>
        <form action="#">
            <div>Editable div works:</div>
            <div>
                <textarea id="body" name="body" style="display: none;" cols="80" rows="5"></textarea>
                <div id="body2" style="border: 1px solid black" contenteditable="true"><p><br/></p></div>
            </div>
        </form>
    </body>
</html>
(Reporter)

Comment 1

7 years ago
Created attachment 449268 [details]
testcase

Updated

7 years ago
Keywords: testcase
(Assignee)

Comment 2

6 years ago
Probably a duplicate of bug 597349.
(Assignee)

Comment 3

6 years ago
Bug confirmed. It should have been covered by bug 460740 but it’s still there.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Updated

6 years ago
OS: Windows 7 → All
Summary: After pressing Enter div with contenteditable doublicates → After pressing Enter, editable DIVs in list items are duplicated
(Assignee)

Comment 4

6 years ago
Created attachment 555386 [details] [diff] [review]
patch proposal
Assignee: nobody → kaze
(Assignee)

Comment 5

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

http://tbpl.allizom.org/?tree=Try&usebuildbot=1&rev=d6c616d0ea5a

Note: I’ve fixed a typo in `test_bug460740.html' with this patch.

Ehsan: as this bug is a follow-up of bug 460740, and since we’re likely to find similar bugs in the future, should I merge the two unit tests into a more generic/extensive test?
(e.g. “test_contenteditable_return_handling.html”)
Attachment #555386 - Attachment is obsolete: true
(Assignee)

Comment 6

6 years ago
Ugh. I get two “unexpected-pass” on crashtest/debug:

REFTEST TEST-UNEXPECTED-PASS | file:///home/cltbld/talos-slave/test/build/reftest/tests/layout/base/crashtests/479360-1.xhtml | assertion count 0 is less than expected 6 assertions
REFTEST TEST-UNEXPECTED-PASS | file:///home/cltbld/talos-slave/test/build/reftest/tests/layout/base/crashtests/481806-1.html | assertion count 0 is less than expected 6 assertions

And five “unexpected-fail” on Win opt/debug (not WinXP):

1137 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/base/tests/test_reftests_with_caret.html | Reftest http://mochi.test:8888/tests/layout/base/tests/bug240933-1.html FAILED
1146 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/base/tests/test_reftests_with_caret.html | Reftest http://mochi.test:8888/tests/layout/base/tests/bug597519-1.html FAILED
1153 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/base/tests/test_reftests_with_caret.html | Reftest http://mochi.test:8888/tests/layout/base/tests/bug612271-3.html FAILED
1160 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/base/tests/test_reftests_with_caret.html | Reftest http://mochi.test:8888/tests/layout/base/tests/bug634406-1.html FAILED
1163 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/base/tests/test_reftests_with_caret.html | Reftest http://mochi.test:8888/tests/layout/base/tests/bug664087-1.html FAILED
(Assignee)

Comment 7

6 years ago
Sorry: the five “unexpected-fail” above are related to Win/debug only. For Win/opt I get one “unexpected-fail”:

1218 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/base/tests/test_reftests_with_caret.html | Reftest http://mochi.test:8888/tests/layout/base/tests/bug646382-1.html FAILED

These failures might be intermittent and/or unrelated to this patch (caret stuff…).
I have to address the two crashtest/debug “unexpected-pass” anyway.
(Assignee)

Comment 8

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

The two “unexpected-pass” tests are related to bug 439258, and the corresponding tests are probably biased by my patch proposal for bug 462758 (which was in my Hg queue as well).

Here’s another try with only this patch:
http://tbpl.allizom.org/?tree=Try&usebuildbot=1&rev=c3acd3b3ac7a
Attachment #555437 - Attachment is obsolete: true
(Assignee)

Updated

6 years ago
Attachment #555684 - Flags: review?(ehsan)
Comment on attachment 555684 [details] [diff] [review]
patch proposal

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

Can you please push a try run on top of the current tip and see if you can still reproduce the test_reftests_with_caret.html failure?
Attachment #555684 - Flags: review?(ehsan) → review+
(Assignee)

Comment 10

6 years ago
I’ve just rebased the patch and pushed it to try:
https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=24912abdafe1
Status: NEW → ASSIGNED
http://hg.mozilla.org/integration/mozilla-inbound/rev/e4f2aa3c5bc2
Flags: in-testsuite+
Target Milestone: --- → mozilla9
https://hg.mozilla.org/mozilla-central/rev/e4f2aa3c5bc2
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.