NEW 42849
Incorrect merging of LIs using backspace
https://bugs.webkit.org/show_bug.cgi?id=42849
Summary Incorrect merging of LIs using backspace
Julie Parent
Reported 2010-07-22 13:57:16 PDT
Created attachment 62335 [details] Test case Repro steps: 1. Start with a bold tag wrapping a list (or attached test file): <div contentEditable> <b> <ul><li>asdf</li><li>Backspace here</li></ul> </b> </div> 2. Put your cursor at the start of the "Backspace here" line 3. Hit backspace. Result (HTML got crazy, renders with a large gap between "asdf" and "Backspace here"): <div contenteditable> <b> <ul><li>asdf<span class="Apple-style-span" style="font-weight: normal; "><b><ul style="display: inline !important; "><li style="display: inline !important; ">Backspace here</li></ul></b></span></li></ul> </b> </div> Expected result (list items just merge): <div contentEditable> <b> <ul><li>asdfBackspace here</li></ul> </b> </div> Notes: * If you continue to hit backspace, the cursor is rendered to the left of the "B" in "Backspace", but the character removed is the "f" in "asdf", then the "d", then the "s", etc, so the character being removed and the visual indication of the character to be removed do not match. * This also occurs with <i> or <u> tags instead of <b> * This also occurs if you put your cursor at the end of the "asdf" line and hit delete.
Attachments
Test case (87 bytes, text/html)
2010-07-22 13:57 PDT, Julie Parent
no flags
Tony Chang
Comment 1 2010-07-26 09:22:51 PDT
The current results are clearly wrong, but I think the expected result is to remove the bullet for the "Backspace here" item. Hitting backspace again should merge the list items. This is a variation of bug 35281 (which may fix this, I haven't tested).
Tony Chang
Comment 2 2010-07-26 09:25:11 PDT
Oh, I should clarify that the behavior I described matches IE, while the behavior Julie described matches Firefox. I think IE's behavior is better since it gives you another way to break out of lists and it's easy to tap the backspace key again if you want to merge.
Ryosuke Niwa
Comment 3 2010-07-26 09:59:28 PDT
(In reply to comment #1) > The current results are clearly wrong, but I think the expected result is to remove the bullet for the "Backspace here" item. Hitting backspace again should merge the list items. By removing the bullet, you mean to merge the LIs and insert a br/div? Because that sounds like the most reasonable thing to do here.
Tony Chang
Comment 4 2010-07-26 13:47:56 PDT
(In reply to comment #3) > (In reply to comment #1) > > The current results are clearly wrong, but I think the expected result is to remove the bullet for the "Backspace here" item. Hitting backspace again should merge the list items. > > By removing the bullet, you mean to merge the LIs and insert a br/div? Because that sounds like the most reasonable thing to do here. No, I mean that the expected output should be like: <b> <ul><li>asdf</li></ul> <div>Backspace here</div> </b> In IE, the <div> is actually a <p>, but WebKit uses <div> for paragraphs. Pressing backspace a second time would produce Julie's suggested output (i.e., merge the paragraph into the list item).
Ryosuke Niwa
Comment 5 2010-07-26 15:11:34 PDT
(In reply to comment #4) > No, I mean that the expected output should be like: > <b> > <ul><li>asdf</li></ul> > <div>Backspace here</div> > </b> Oh, right. That works as well. So if we had another list child after "backspace here" (i.e. three LIs in the total), will you split the list (end up with ULs)?
Tony Chang
Comment 6 2010-07-26 15:12:52 PDT
(In reply to comment #5) > So if we had another list child after "backspace here" (i.e. three LIs in the total), will you split the list (end up with ULs)? Yes, that's right.
Ryosuke Niwa
Comment 7 2010-07-26 15:50:41 PDT
(In reply to comment #6) > (In reply to comment #5) > > So if we had another list child after "backspace here" (i.e. three LIs in the total), will you split the list (end up with ULs)? > > Yes, that's right. Ok, I agree with you. That's probably the best we can do here.
Note You need to log in before you can comment on or make changes to this bug.