Last Comment Bug 570144 - After pressing Enter, editable DIVs in list items are duplicated
: After pressing Enter, editable DIVs in list items are duplicated
Status: RESOLVED FIXED
: testcase
Product: Core
Classification: Components
Component: Editor (show other bugs)
: unspecified
: x86 All
: -- normal (vote)
: mozilla9
Assigned To: Fabien Cazenave [:kaze]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-04 07:47 PDT by Igor Stepin
Modified: 2011-09-13 06:44 PDT (History)
3 users (show)
ehsan: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (1.07 KB, text/html)
2010-06-04 07:48 PDT, Igor Stepin
no flags Details
patch proposal (1.53 KB, patch)
2011-08-24 06:34 PDT, Fabien Cazenave [:kaze]
no flags Details | Diff | Splinter Review
patch proposal (7.56 KB, patch)
2011-08-24 09:49 PDT, Fabien Cazenave [:kaze]
no flags Details | Diff | Splinter Review
patch proposal (7.56 KB, patch)
2011-08-25 02:55 PDT, Fabien Cazenave [:kaze]
ehsan: review+
Details | Diff | Splinter Review

Description Igor Stepin 2010-06-04 07:47:46 PDT
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>
Comment 1 Igor Stepin 2010-06-04 07:48:24 PDT
Created attachment 449268 [details]
testcase
Comment 2 Fabien Cazenave [:kaze] 2011-07-28 03:24:07 PDT
Probably a duplicate of bug 597349.
Comment 3 Fabien Cazenave [:kaze] 2011-08-24 03:55:18 PDT
Bug confirmed. It should have been covered by bug 460740 but it’s still there.
Comment 4 Fabien Cazenave [:kaze] 2011-08-24 06:34:22 PDT
Created attachment 555386 [details] [diff] [review]
patch proposal
Comment 5 Fabien Cazenave [:kaze] 2011-08-24 09:49:39 PDT
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”)
Comment 6 Fabien Cazenave [:kaze] 2011-08-24 14:42:09 PDT
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
Comment 7 Fabien Cazenave [:kaze] 2011-08-24 15:02:19 PDT
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.
Comment 8 Fabien Cazenave [:kaze] 2011-08-25 02:55:15 PDT
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
Comment 9 :Ehsan Akhgari 2011-09-01 10:59:15 PDT
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?
Comment 10 Fabien Cazenave [:kaze] 2011-09-07 10:21:29 PDT
I’ve just rebased the patch and pushed it to try:
https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=24912abdafe1
Comment 12 Matt Brubeck (:mbrubeck) 2011-09-13 06:44:32 PDT
https://hg.mozilla.org/mozilla-central/rev/e4f2aa3c5bc2

Note You need to log in before you can comment on or make changes to this bug.