Bug 19701 - Select All + Delete doesn't delete all the content in a contentEditable region
Summary: Select All + Delete doesn't delete all the content in a contentEditable region
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:
Keywords: InRadar
: 24789 25088 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-20 18:28 PDT by Ojan Vafai
Modified: 2017-07-18 08:29 PDT (History)
7 users (show)

See Also:


Attachments
reduced test case (182 bytes, text/html)
2008-06-20 18:29 PDT, Ojan Vafai
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ojan Vafai 2008-06-20 18:28:47 PDT
Test case coming.
Comment 1 Ojan Vafai 2008-06-20 18:29:15 PDT
Created attachment 21865 [details]
reduced test case
Comment 2 Alexey Proskuryakov 2008-07-28 14:29:03 PDT
This also happens on the Mac (of course, with Cmd+A in place of Ctrl+A).
Comment 3 Justin Garcia 2009-02-24 14:16:27 PST
<rdar://problem/6609509>
Comment 4 Adele Peterson 2009-03-24 16:45:22 PDT
*** Bug 24789 has been marked as a duplicate of this bug. ***
Comment 5 Julie Parent 2009-04-07 18:15:50 PDT
*** Bug 25088 has been marked as a duplicate of this bug. ***
Comment 6 Adele Peterson 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.
Comment 7 Adele Peterson 2009-04-08 00:10:06 PDT
This was the test I meant to point to:
editing/inserting/4875189-1.html
Comment 8 Ojan Vafai 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>
Comment 9 Justin Garcia 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...