WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-110610-20130311105618.patch (text/plain), 10.11 KB, created by
Sergio Villar Senin
on 2013-03-11 03:02:00 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sergio Villar Senin
Created:
2013-03-11 03:02:00 PDT
Size:
10.11 KB
patch
obsolete
>Subversion Revision: 145343 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index dd4f4f85e53981e83fea81bad73d124bddce4e8e..640ea1cc2c1d59f67f4295298e819c56adfbec05 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2013-03-07 Sergio Villar Senin <svillar@igalia.com> >+ >+ Empty list items after drag&drop in contentEditable divs >+ https://bugs.webkit.org/show_bug.cgi?id=110610 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Perform a cleanup after moving operations. This will mainly prune >+ extra placeholders left by the editing algorithms. Also do not >+ leave empty <li> when moving them around inside a list element. >+ >+ No new tests required, added the corresponding changes to the >+ already existing tests. >+ >+ * editing/MoveSelectionCommand.cpp: >+ (WebCore::MoveSelectionCommand::doApply): perform >+ cleanupAfterDeletion(). >+ * editing/ReplaceSelectionCommand.cpp: >+ (WebCore::ReplaceSelectionCommand::insertAsListItems): do not >+ insert an empty list item. >+ > 2013-03-07 Alexander Pavlov <apavlov@chromium.org> > > Web Inspector: [Elements] XSLT transformation result from the xml-stylesheet PI not rendered >diff --git a/Source/WebCore/editing/MoveSelectionCommand.cpp b/Source/WebCore/editing/MoveSelectionCommand.cpp >index 5a2143c63d450555cef3980b79438f459dcfa134..475282ecd48c92815551ebbb47fa535e360884c3 100644 >--- a/Source/WebCore/editing/MoveSelectionCommand.cpp >+++ b/Source/WebCore/editing/MoveSelectionCommand.cpp >@@ -65,6 +65,8 @@ void MoveSelectionCommand::doApply() > if (!pos.anchorNode()->inDocument()) > pos = endingSelection().start(); > >+ cleanupAfterDeletion(pos); >+ > setEndingSelection(VisibleSelection(pos, endingSelection().affinity(), endingSelection().isDirectional())); > if (!pos.anchorNode()->inDocument()) { > // Document was modified out from under us. >diff --git a/Source/WebCore/editing/ReplaceSelectionCommand.cpp b/Source/WebCore/editing/ReplaceSelectionCommand.cpp >index f104e02744f99a824a4d8fa3a3cab3b8efa595b3..c4b8bffdc2c152a13ca1a3c6faaffd5b2cf6fde7 100644 >--- a/Source/WebCore/editing/ReplaceSelectionCommand.cpp >+++ b/Source/WebCore/editing/ReplaceSelectionCommand.cpp >@@ -1444,8 +1444,6 @@ Node* ReplaceSelectionCommand::insertAsListItems(PassRefPtr<HTMLElement> prpList > } > if (isStart || isMiddle) > lastNode = lastNode->previousSibling(); >- if (isMiddle) >- insertNodeAfter(createListItemElement(document()), lastNode); > return lastNode; > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 334fbe155c72851862c3e603eebe73addf689127..18b4424374e562909addd2a9d2af3ce2ccd5019c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,24 @@ >+2013-03-07 Sergio Villar Senin <svillar@igalia.com> >+ >+ Empty list items after drag&drop in contentEditable divs >+ https://bugs.webkit.org/show_bug.cgi?id=110610 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Some placeholders should not be left after performing a cleanup in >+ move operations, this includes the empty list items generated when >+ moving around list items inside a list. >+ >+ * editing/pasteboard/drag-drop-list-expected.txt: Removed an empty <div>. >+ * editing/pasteboard/paste-list-004-expected.txt: >+ * editing/pasteboard/paste-list-004.html: Removed two empty <li>. >+ * editing/selection/4895428-1-expected.txt: Removed a <br>. >+ * editing/selection/4895428-4-expected.txt: Ditto. >+ * editing/selection/drag-list-item-expected.txt: Ditto. >+ * fast/events/ondragenter-expected.txt: Removed a blank line. >+ * platform/chromium/fast/events/ondragenter-expected.txt: Ditto. >+ * platform/win/fast/events/ondragenter-expected.txt: Ditto. >+ > 2013-03-11 Zan Dobersek <zdobersek@igalia.com> > > Unreviewed GTK gardening. >diff --git a/LayoutTests/editing/pasteboard/drag-drop-list-expected.txt b/LayoutTests/editing/pasteboard/drag-drop-list-expected.txt >index 838f2ccff4c888880c68e8dbbed8efe1c8e24abf..d79c9c2e3ff2df6b9f20bbcd3dab5b7089517baa 100644 >--- a/LayoutTests/editing/pasteboard/drag-drop-list-expected.txt >+++ b/LayoutTests/editing/pasteboard/drag-drop-list-expected.txt >@@ -11,7 +11,5 @@ This tests dropping content onto a list items content when the content is wrappe > | "DropAboveMe<#selection-anchor> DragMe<#selection-focus>" > | " > " >-| <div> >-| <br> > | " > " >diff --git a/LayoutTests/editing/pasteboard/paste-list-004-expected.txt b/LayoutTests/editing/pasteboard/paste-list-004-expected.txt >index 4c60579e1727eabd73d3a29f24d6d34bb0366981..c44b249d07304e9d99dbe43499a4cb681693ef21 100644 >--- a/LayoutTests/editing/pasteboard/paste-list-004-expected.txt >+++ b/LayoutTests/editing/pasteboard/paste-list-004-expected.txt >@@ -3,11 +3,9 @@ Pasting a list item into the middle of another list item should split the target > one two: one two > three: three > one two: one two >-: > four: four > monsters walking: <span style="background-color:green"><b>monsters walking</b></span> > one two: one two >-: > cross the floor: <span style="background-color:green"><b>cross the floor</b></span> > PASS > >diff --git a/LayoutTests/editing/pasteboard/paste-list-004.html b/LayoutTests/editing/pasteboard/paste-list-004.html >index 88d7c23ddc22d98e4e20893d49d8aff9ee35feda..8828e741f8f459be97572bfd313e0d2bcd1db194 100644 >--- a/LayoutTests/editing/pasteboard/paste-list-004.html >+++ b/LayoutTests/editing/pasteboard/paste-list-004.html >@@ -29,8 +29,7 @@ function editingTest() > pasteCommand(); > > // Place the cursor between "walking" and "cross" >- for (var i = 0; i < 2; ++i) >- moveSelectionForwardByLineCommand(); >+ moveSelectionForwardByLineCommand(); > for (var i = 0; i < 2; ++i) > moveSelectionForwardByWordCommand(); > >@@ -42,24 +41,22 @@ function editingTest() > "one two", > "three", > "one two", >- "", > "four", > "monsters walking", > "one two", >- "", > "cross the floor" > ]; >- if (listItems.length != 9) >- throw "Expected 8 list items, found " + listItems.length; >+ if (listItems.length != 7) >+ throw "Expected 7 list items, found " + listItems.length; > for (var i = 0; i < results.length; ++i) { > var actual = listItems[i].innerText.replace(/^\s+/g, ""); > if (results[i] != actual) > throw "Unexpected list item: " + i + "," + results[i] + "," + listItems[i].innerText; > } > >- // Verify that the cursor is in the right place (on the blank line). >+ // Verify that the cursor is in the right place (at the beginning of 'cross the floor'). > var selection = window.getSelection(); >- if (selection.baseNode != listItems[7] || selection.baseOffset != 0 || !selection.isCollapsed) >+ if (selection.baseNode != listItems[6].firstChild.firstChild.firstChild || selection.baseOffset != 0 || !selection.isCollapsed) > throw "Wrong selection position"; > > for (var i = 0; i < listItems.length; ++i) { >diff --git a/LayoutTests/editing/selection/4895428-1-expected.txt b/LayoutTests/editing/selection/4895428-1-expected.txt >index e83b06b1718c2c6db825fe2efb19196362046cfb..1e932294d2828fe3d22c6ea1e079344ead24120e 100644 >--- a/LayoutTests/editing/selection/4895428-1-expected.txt >+++ b/LayoutTests/editing/selection/4895428-1-expected.txt >@@ -5,7 +5,6 @@ This tests dragging a selected table by mousing down on the contents of one of i > | contenteditable="true" > | id="source" > | style="border: 1px solid blue;" >-| <br> > | " > " > | <div> >diff --git a/LayoutTests/editing/selection/4895428-4-expected.txt b/LayoutTests/editing/selection/4895428-4-expected.txt >index a2a53879113ed05039b125e449587b38c26f25e3..0eb9e4733808123afccda09b09558d6e66f17f1f 100644 >--- a/LayoutTests/editing/selection/4895428-4-expected.txt >+++ b/LayoutTests/editing/selection/4895428-4-expected.txt >@@ -7,7 +7,6 @@ This tests to see if an editable selection containing a focusable node is dragga > | style="border: 1px solid blue;" > | " > " >-| <br> > | " > " > | " >diff --git a/LayoutTests/editing/selection/drag-list-item-expected.txt b/LayoutTests/editing/selection/drag-list-item-expected.txt >index f68482a87a81b2464701f119cccdf4a473b84da1..cb49b102624de9c461542b33c13209be987bacf5 100644 >--- a/LayoutTests/editing/selection/drag-list-item-expected.txt >+++ b/LayoutTests/editing/selection/drag-list-item-expected.txt >@@ -25,9 +25,6 @@ The original list looks like this. 'two' is going to be selected and pasted afte > | id="one" > | "one" > | <li> >-| id="two" >-| <br> >-| <li> > | id="three" > | "three" > | <li> >@@ -58,9 +55,6 @@ The original list looks like this. 'two' and 'three' are going to be selected an > | id="one" > | "one" > | <li> >-| id="two" >-| <br> >-| <li> > | id="four" > | "four" > | <li> >diff --git a/LayoutTests/fast/events/ondragenter-expected.txt b/LayoutTests/fast/events/ondragenter-expected.txt >index 9d2bce37e7bac7294d78d4cb242569f862ccf0a5..7f83323cb6ead15112ff46d9db01f416091b80f0 100644 >--- a/LayoutTests/fast/events/ondragenter-expected.txt >+++ b/LayoutTests/fast/events/ondragenter-expected.txt >@@ -1,3 +1,2 @@ >- > Success: Text > This automated layout test checks to see that ondragenter events are being sent. >diff --git a/LayoutTests/platform/chromium/fast/events/ondragenter-expected.txt b/LayoutTests/platform/chromium/fast/events/ondragenter-expected.txt >index 9d2bce37e7bac7294d78d4cb242569f862ccf0a5..7f83323cb6ead15112ff46d9db01f416091b80f0 100644 >--- a/LayoutTests/platform/chromium/fast/events/ondragenter-expected.txt >+++ b/LayoutTests/platform/chromium/fast/events/ondragenter-expected.txt >@@ -1,3 +1,2 @@ >- > Success: Text > This automated layout test checks to see that ondragenter events are being sent. >diff --git a/LayoutTests/platform/win/fast/events/ondragenter-expected.txt b/LayoutTests/platform/win/fast/events/ondragenter-expected.txt >index 9d2bce37e7bac7294d78d4cb242569f862ccf0a5..7f83323cb6ead15112ff46d9db01f416091b80f0 100644 >--- a/LayoutTests/platform/win/fast/events/ondragenter-expected.txt >+++ b/LayoutTests/platform/win/fast/events/ondragenter-expected.txt >@@ -1,3 +1,2 @@ >- > Success: Text > This automated layout test checks to see that ondragenter events are being sent.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 110610
:
190972
|
191725
|
192021
|
192036
|
192182
|
192431
|
192894
|
192897
|
193092