Bug 100403

Summary: contenteditable incorrectly swaps nodes on deletion
Product: WebKit Reporter: Elliott Sprehn <esprehn>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, dglazkov, eric, jelte, mifenton, rniwa, webkit.review.bot
Priority: P2 Keywords: HasReduction
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Reduction
none
Patch
none
Patch
none
Patch rniwa: review+, webkit.review.bot: commit-queue-

Elliott Sprehn
Reported 2012-10-25 12:00:33 PDT
In some cases if there's no whitespace between paragraphs contenteditable will swap nodes around in the wrong order. For example given the below with the caret at the pipe: X| Y Z If you then hit delete you end up with: ZY Downstream bug: http://code.google.com/p/chromium/issues/detail?id=157925
Attachments
Reduction (408 bytes, text/html)
2012-10-25 12:01 PDT, Elliott Sprehn
no flags
Patch (5.30 KB, patch)
2012-12-23 19:59 PST, Sukolsak Sakshuwong
no flags
Patch (5.31 KB, patch)
2012-12-23 20:07 PST, Sukolsak Sakshuwong
no flags
Patch (6.10 KB, patch)
2012-12-23 23:36 PST, Sukolsak Sakshuwong
rniwa: review+
webkit.review.bot: commit-queue-
Elliott Sprehn
Comment 1 2012-10-25 12:01:47 PDT
Created attachment 170706 [details] Reduction
Sukolsak Sakshuwong
Comment 2 2012-12-23 19:59:47 PST
Sukolsak Sakshuwong
Comment 3 2012-12-23 20:07:34 PST
Ryosuke Niwa
Comment 4 2012-12-23 22:31:21 PST
Comment on attachment 180637 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180637&action=review > Source/WebCore/editing/DeleteSelectionCommand.cpp:484 > + updatePositionForNodeRemoval(m_downstreamEnd, children[i].get()); > + removeNode(children[i]); You shouldn't have to call updatePositionForNodeRemoval. DeleteSelectionCommand::removeNode should automatically take care of that.
Sukolsak Sakshuwong
Comment 5 2012-12-23 23:36:18 PST
WebKit Review Bot
Comment 6 2012-12-24 06:36:08 PST
Comment on attachment 180650 [details] Patch Rejecting attachment 180650 [details] from commit-queue. New failing tests: editing/execCommand/format-block-contenteditable-false.html editing/deleting/delete-3865854-fix.html editing/execCommand/5469868.html editing/execCommand/5190926.html editing/execCommand/delete-selection-has-style.html editing/pasteboard/testcase-9507.html editing/deleting/delete-at-paragraph-boundaries-002.html editing/pasteboard/paste-text-009.html editing/execCommand/create-list-from-range-selection.html editing/pasteboard/paste-text-015.html editing/deleting/delete-and-cleanup.html editing/deleting/delete-select-all-003.html editing/pasteboard/block-wrappers-necessary.html editing/pasteboard/paste-4039777-fix.html editing/pasteboard/paste-text-008.html editing/pasteboard/paste-without-nesting.html editing/deleting/delete-3959464-fix.html editing/execCommand/4916541.html editing/deleting/delete-at-paragraph-boundaries-001.html svg/custom/bug78838.html editing/execCommand/inline-style-after-indentoutdent.html editing/style/4916887.html editing/deleting/deleting-line-break-preserves-underline-color.html editing/pasteboard/copy-paste-bidi.html Full output: http://queues.webkit.org/results/15496480
WebKit Review Bot
Comment 7 2012-12-30 05:55:59 PST
Comment on attachment 180650 [details] Patch Attachment 180650 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/15594429 New failing tests: editing/execCommand/format-block-contenteditable-false.html editing/deleting/delete-3865854-fix.html editing/execCommand/5469868.html editing/execCommand/5190926.html editing/execCommand/delete-selection-has-style.html editing/pasteboard/testcase-9507.html editing/deleting/delete-at-paragraph-boundaries-002.html editing/pasteboard/paste-text-009.html editing/execCommand/create-list-from-range-selection.html editing/pasteboard/paste-text-015.html editing/deleting/delete-and-cleanup.html editing/deleting/delete-select-all-003.html editing/pasteboard/block-wrappers-necessary.html editing/pasteboard/paste-4039777-fix.html editing/pasteboard/paste-text-008.html editing/pasteboard/paste-without-nesting.html editing/deleting/delete-3959464-fix.html editing/execCommand/4916541.html editing/deleting/delete-at-paragraph-boundaries-001.html svg/custom/bug78838.html editing/execCommand/inline-style-after-indentoutdent.html editing/style/4916887.html editing/deleting/deleting-line-break-preserves-underline-color.html editing/pasteboard/copy-paste-bidi.html
Build Bot
Comment 8 2013-01-04 17:57:17 PST
Comment on attachment 180650 [details] Patch Attachment 180650 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/15699448 New failing tests: editing/execCommand/format-block-contenteditable-false.html editing/deleting/delete-3865854-fix.html editing/execCommand/5469868.html editing/execCommand/5190926.html editing/execCommand/delete-selection-has-style.html editing/pasteboard/testcase-9507.html editing/deleting/delete-at-paragraph-boundaries-002.html editing/pasteboard/paste-text-009.html editing/execCommand/create-list-from-range-selection.html editing/pasteboard/paste-text-015.html editing/deleting/delete-and-cleanup.html editing/deleting/delete-select-all-003.html editing/pasteboard/block-wrappers-necessary.html editing/pasteboard/paste-4039777-fix.html editing/pasteboard/paste-text-008.html editing/pasteboard/paste-without-nesting.html editing/deleting/delete-3959464-fix.html editing/execCommand/4916541.html editing/deleting/delete-at-paragraph-boundaries-001.html svg/custom/bug78838.html editing/execCommand/inline-style-after-indentoutdent.html editing/style/4916887.html editing/deleting/deleting-line-break-preserves-underline-color.html editing/pasteboard/copy-paste-bidi.html
Ahmad Saleem
Comment 9 2022-07-26 13:27:16 PDT
I am unable to reproduce this bug using attached reduction in Safari 15.6 on macOS 12.5, it behaves same across all browsers and does not fix up results like mentioned in Comment 0 and the content remain where it is. Only "X" get removed and it is across all browsers (Chrome Canary 106, Firefox Nightly 104 and Safari 15.6). Thanks!
Ryosuke Niwa
Comment 10 2022-07-26 21:50:59 PDT
Oh yeah, I fixed this bug years ago.
Note You need to log in before you can comment on or make changes to this bug.