Bug 11331 - Selecting all of a list's items and deleting doesn't always delete the list
Summary: Selecting all of a list's items and deleting doesn't always delete the list
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: GoogleBug, InRadar
Depends on:
Blocks: 9638
  Show dependency treegraph
 
Reported: 2006-10-17 15:25 PDT by Chris Petersen
Modified: 2017-07-18 08:29 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Petersen 2006-10-17 15:25:14 PDT
* SUMMARY
In both GMail and Writely Editors, the list marker is not removed after I delete the selected list element in the document.

* STEPS TO REPRODUCE
1. With r17089, login into your Gmail or Writely (Google Docs and Spreadsheets) account
2. Create a new message/document
3. Type two sentences on separate lines
4. Select the first line and apply a list (Numbered or Bulleted)
5. Drag a selection over BOTH lines that you typed.
6. While both lines are selected, press the delete key
7. Notice the selected text is removed but the list marker remains

* RESULTS
Pressing the delete key should remove all selected text (including the list marker) but doesn't.
Comment 1 Chris Petersen 2006-10-17 15:26:28 PDT
This is filed as <rdar://problem/4788259>
Comment 2 Tony Chang 2010-03-04 23:10:43 PST
A couple observations:
- WebKit currently only deletes what you can select.  You can only select a region based on where you can place a cursor.  Since you can't place a cursor before the first list item, you can't delete it by selecting it.
- In Firefox, if I only have a single list item, I end up with the same problem.  Since I can't select outside the list item, I can only delete text within the list item.  I can however use Select All to select and remove the list.
- In Firefox, it seems to special case deleting more than one list item at a time.  If I'm deleting 2+ list items and all the text is being removed, the bullet is also removed.
- In IE, I can't seem to select before the first list item, so I can't delete it in IE either.  Ctrl+A does work and allows me to delete the whole document.  IE does not special case the deleting of 2+ list items that Firefox does.


In conclusion, I think this is working as expected.  Firefox is the only browser that seems to allow selecting and deleting the first bullet, and it's only in some cases.  perhaps Select All should work, but I think that'll be tricky since selections in webkit are based on visible positions and there's no way to get the cursor before the first list item.
Comment 3 Aryeh Gregor 2011-08-19 11:35:11 PDT
I tested in IE10PP2, Firefox 7.0a2, Chrome 15 dev, and Opera 11.50.  All except Firefox leave the list marker intact if you select using the mouse or arrow keys.  If you select using Ctrl+A, IE10PP2 removes the list marker as well.

I'm inclined to say IE is correct here: selecting with the mouse or arrows should select the text, while selecting with Ctrl+A should select the blocks, and deletion should behave differently in those two cases.

My editing spec currently is silent on what selections are created by various user actions, but it does mandate leaving the list item if the selection is in the Text nodes, and deleting it if the selection includes the <ol> itself.  In WebKit, of course, the selection can't include the <ol> itself here, it's clamped to the text.