NEW19701
Select All + Delete doesn't delete all the content in a contentEditable region
https://bugs.webkit.org/show_bug.cgi?id=19701
Summary Select All + Delete doesn't delete all the content in a contentEditable region
Ojan Vafai
Reported 2008-06-20 18:28:47 PDT
Test case coming.
Attachments
reduced test case (182 bytes, text/html)
2008-06-20 18:29 PDT, Ojan Vafai
no flags
Ojan Vafai
Comment 1 2008-06-20 18:29:15 PDT
Created attachment 21865 [details] reduced test case
Alexey Proskuryakov
Comment 2 2008-07-28 14:29:03 PDT
This also happens on the Mac (of course, with Cmd+A in place of Ctrl+A).
Justin Garcia
Comment 3 2009-02-24 14:16:27 PST
Adele Peterson
Comment 4 2009-03-24 16:45:22 PDT
*** Bug 24789 has been marked as a duplicate of this bug. ***
Julie Parent
Comment 5 2009-04-07 18:15:50 PDT
*** Bug 25088 has been marked as a duplicate of this bug. ***
Adele Peterson
Comment 6 2009-04-08 00:08:33 PDT
My planned approach to just delete everything in the editable root will break a bunch of tests- including the case added for list editing with http://trac.webkit.org/changeset/21648. So I don't think that straightforward approach will work since sometimes a delete is part of a more complex editing action, or its immediately followed by typing.
Adele Peterson
Comment 7 2009-04-08 00:10:06 PDT
This was the test I meant to point to: editing/inserting/4875189-1.html
Ojan Vafai
Comment 8 2009-04-08 13:34:26 PDT
Ugh. This is another area where position normalizing bites us. In this test, delete/replace should leave the LI, but if the whole contents of the DIV is selected (e.g. the range's start is set to div,0 and end is set to div,1), which is what select-all should do, then it should not leave the LI. But with position normalizing, we can't distinguish between those selections at the time of the delete. For reference, here's the contents of editing/inserting/4875189-1.html: <p>This tests for a bug when replacing the contents of a list. The list shouldn't be removed, just its contents.</p> <div contenteditable="true"><ul><li id="li">You shouldn't see this.</li></ul></div> <script> var r = document.createRange(); var li = document.getElementById("li"); r.setStart(li, 0); r.setEnd(li, li.childNodes.length); var selection = window.getSelection(); selection.addRange(r); document.execCommand("InsertHTML", false, "This should be in a list item.") </script>
Justin Garcia
Comment 9 2011-03-17 18:32:50 PDT
I thought we had fixed this in: http://trac.webkit.org/changeset/43044 Select All + Delete doesn't delete everything, but a subsequent delete will...
Note You need to log in before you can comment on or make changes to this bug.