| Differences between
and this patch
- a/Source/WebCore/ChangeLog +21 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2013-03-07  Sergio Villar Senin  <svillar@igalia.com>
2
3
        Empty list items after drag&drop in contentEditable divs
4
        https://bugs.webkit.org/show_bug.cgi?id=110610
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Perform a cleanup after moving operations. This will mainly prune
9
        extra placeholders left by the editing algorithms. Also do not
10
        leave empty <li> when moving them around inside a list element.
11
12
        No new tests required, added the corresponding changes to the
13
        already existing tests.
14
15
        * editing/MoveSelectionCommand.cpp:
16
        (WebCore::MoveSelectionCommand::doApply): perform
17
        cleanupAfterDeletion().
18
        * editing/ReplaceSelectionCommand.cpp:
19
        (WebCore::ReplaceSelectionCommand::insertAsListItems): do not
20
        insert an empty list item.
21
1
2013-03-07  Alexander Pavlov  <apavlov@chromium.org>
22
2013-03-07  Alexander Pavlov  <apavlov@chromium.org>
2
23
3
        Web Inspector: [Elements] XSLT transformation result from the xml-stylesheet PI not rendered
24
        Web Inspector: [Elements] XSLT transformation result from the xml-stylesheet PI not rendered
- a/Source/WebCore/editing/MoveSelectionCommand.cpp +2 lines
Lines 65-70 void MoveSelectionCommand::doApply() a/Source/WebCore/editing/MoveSelectionCommand.cpp_sec1
65
    if (!pos.anchorNode()->inDocument())
65
    if (!pos.anchorNode()->inDocument())
66
        pos = endingSelection().start();
66
        pos = endingSelection().start();
67
67
68
    cleanupAfterDeletion(pos);
69
68
    setEndingSelection(VisibleSelection(pos, endingSelection().affinity(), endingSelection().isDirectional()));
70
    setEndingSelection(VisibleSelection(pos, endingSelection().affinity(), endingSelection().isDirectional()));
69
    if (!pos.anchorNode()->inDocument()) {
71
    if (!pos.anchorNode()->inDocument()) {
70
        // Document was modified out from under us.
72
        // Document was modified out from under us.
- a/Source/WebCore/editing/ReplaceSelectionCommand.cpp -2 lines
Lines 1444-1451 Node* ReplaceSelectionCommand::insertAsListItems(PassRefPtr<HTMLElement> prpList a/Source/WebCore/editing/ReplaceSelectionCommand.cpp_sec1
1444
    }
1444
    }
1445
    if (isStart || isMiddle)
1445
    if (isStart || isMiddle)
1446
        lastNode = lastNode->previousSibling();
1446
        lastNode = lastNode->previousSibling();
1447
    if (isMiddle)
1448
        insertNodeAfter(createListItemElement(document()), lastNode);
1449
    return lastNode;
1447
    return lastNode;
1450
}
1448
}
1451
1449
- a/LayoutTests/ChangeLog +21 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2013-03-07  Sergio Villar Senin  <svillar@igalia.com>
2
3
        Empty list items after drag&drop in contentEditable divs
4
        https://bugs.webkit.org/show_bug.cgi?id=110610
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Some placeholders should not be left after performing a cleanup in
9
        move operations, this includes the empty list items generated when
10
        moving around list items inside a list.
11
12
        * editing/pasteboard/drag-drop-list-expected.txt: Removed an empty <div>.
13
        * editing/pasteboard/paste-list-004-expected.txt:
14
        * editing/pasteboard/paste-list-004.html: Removed two empty <li>.
15
        * editing/selection/4895428-1-expected.txt: Removed a <br>.
16
        * editing/selection/4895428-4-expected.txt: Ditto.
17
        * editing/selection/drag-list-item-expected.txt: Ditto.
18
        * fast/events/ondragenter-expected.txt: Removed a blank line.
19
        * platform/chromium/fast/events/ondragenter-expected.txt: Ditto.
20
        * platform/win/fast/events/ondragenter-expected.txt: Ditto.
21
1
2013-03-11  Zan Dobersek  <zdobersek@igalia.com>
22
2013-03-11  Zan Dobersek  <zdobersek@igalia.com>
2
23
3
        Unreviewed GTK gardening.
24
        Unreviewed GTK gardening.
- a/LayoutTests/editing/pasteboard/drag-drop-list-expected.txt -2 lines
Lines 11-17 This tests dropping content onto a list items content when the content is wrappe a/LayoutTests/editing/pasteboard/drag-drop-list-expected.txt_sec1
11
|       "DropAboveMe<#selection-anchor> DragMe<#selection-focus>"
11
|       "DropAboveMe<#selection-anchor> DragMe<#selection-focus>"
12
| "
12
| "
13
"
13
"
14
| <div>
15
|   <br>
16
| "
14
| "
17
"
15
"
- a/LayoutTests/editing/pasteboard/paste-list-004-expected.txt -2 lines
Lines 3-13 Pasting a list item into the middle of another list item should split the target a/LayoutTests/editing/pasteboard/paste-list-004-expected.txt_sec1
3
one two: one two
3
one two: one two
4
three: three
4
three: three
5
one two: one two
5
one two: one two
6
:
7
four: four
6
four: four
8
monsters walking: <span style="background-color:green"><b>monsters walking</b></span>
7
monsters walking: <span style="background-color:green"><b>monsters walking</b></span>
9
one two: one two
8
one two: one two
10
:
11
cross the floor: <span style="background-color:green"><b>cross the floor</b></span>
9
cross the floor: <span style="background-color:green"><b>cross the floor</b></span>
12
PASS
10
PASS
13
11
- a/LayoutTests/editing/pasteboard/paste-list-004.html -8 / +5 lines
Lines 29-36 function editingTest() a/LayoutTests/editing/pasteboard/paste-list-004.html_sec1
29
    pasteCommand();
29
    pasteCommand();
30
30
31
    // Place the cursor between "walking" and "cross"
31
    // Place the cursor between "walking" and "cross"
32
    for (var i = 0; i < 2; ++i)
32
    moveSelectionForwardByLineCommand();
33
        moveSelectionForwardByLineCommand();
34
    for (var i = 0; i < 2; ++i)
33
    for (var i = 0; i < 2; ++i)
35
        moveSelectionForwardByWordCommand();
34
        moveSelectionForwardByWordCommand();
36
35
Lines 42-65 function editingTest() a/LayoutTests/editing/pasteboard/paste-list-004.html_sec2
42
        "one two",
41
        "one two",
43
        "three",
42
        "three",
44
        "one two",
43
        "one two",
45
        "",
46
        "four",
44
        "four",
47
        "monsters walking",
45
        "monsters walking",
48
        "one two",
46
        "one two",
49
        "",
50
        "cross the floor"
47
        "cross the floor"
51
        ];
48
        ];
52
    if (listItems.length != 9)
49
    if (listItems.length != 7)
53
        throw "Expected 8 list items, found " + listItems.length;
50
        throw "Expected 7 list items, found " + listItems.length;
54
    for (var i = 0; i < results.length; ++i) {
51
    for (var i = 0; i < results.length; ++i) {
55
        var actual = listItems[i].innerText.replace(/^\s+/g, "");
52
        var actual = listItems[i].innerText.replace(/^\s+/g, "");
56
        if (results[i] != actual)
53
        if (results[i] != actual)
57
            throw "Unexpected list item: " + i + "," + results[i] + "," + listItems[i].innerText;
54
            throw "Unexpected list item: " + i + "," + results[i] + "," + listItems[i].innerText;
58
    }
55
    }
59
56
60
    // Verify that the cursor is in the right place (on the blank line).
57
    // Verify that the cursor is in the right place (at the beginning of 'cross the floor').
61
    var selection = window.getSelection();
58
    var selection = window.getSelection();
62
    if (selection.baseNode != listItems[7] || selection.baseOffset != 0 || !selection.isCollapsed)
59
    if (selection.baseNode != listItems[6].firstChild.firstChild.firstChild || selection.baseOffset != 0 || !selection.isCollapsed)
63
        throw "Wrong selection position";
60
        throw "Wrong selection position";
64
61
65
    for (var i = 0; i < listItems.length; ++i) {
62
    for (var i = 0; i < listItems.length; ++i) {
- a/LayoutTests/editing/selection/4895428-1-expected.txt -1 lines
Lines 5-11 This tests dragging a selected table by mousing down on the contents of one of i a/LayoutTests/editing/selection/4895428-1-expected.txt_sec1
5
|   contenteditable="true"
5
|   contenteditable="true"
6
|   id="source"
6
|   id="source"
7
|   style="border: 1px solid blue;"
7
|   style="border: 1px solid blue;"
8
|   <br>
9
| "
8
| "
10
"
9
"
11
| <div>
10
| <div>
- a/LayoutTests/editing/selection/4895428-4-expected.txt -1 lines
Lines 7-13 This tests to see if an editable selection containing a focusable node is dragga a/LayoutTests/editing/selection/4895428-4-expected.txt_sec1
7
|   style="border: 1px solid blue;"
7
|   style="border: 1px solid blue;"
8
|   "
8
|   "
9
"
9
"
10
|   <br>
11
|   "
10
|   "
12
"
11
"
13
| "
12
| "
- a/LayoutTests/editing/selection/drag-list-item-expected.txt -6 lines
Lines 25-33 The original list looks like this. 'two' is going to be selected and pasted afte a/LayoutTests/editing/selection/drag-list-item-expected.txt_sec1
25
|   id="one"
25
|   id="one"
26
|   "one"
26
|   "one"
27
| <li>
27
| <li>
28
|   id="two"
29
|   <br>
30
| <li>
31
|   id="three"
28
|   id="three"
32
|   "three"
29
|   "three"
33
| <li>
30
| <li>
Lines 58-66 The original list looks like this. 'two' and 'three' are going to be selected an a/LayoutTests/editing/selection/drag-list-item-expected.txt_sec2
58
|   id="one"
55
|   id="one"
59
|   "one"
56
|   "one"
60
| <li>
57
| <li>
61
|   id="two"
62
|   <br>
63
| <li>
64
|   id="four"
58
|   id="four"
65
|   "four"
59
|   "four"
66
| <li>
60
| <li>
- a/LayoutTests/fast/events/ondragenter-expected.txt -1 lines
Lines 1-3 a/LayoutTests/fast/events/ondragenter-expected.txt_sec1
1
2
Success: Text
1
Success: Text
3
This automated layout test checks to see that ondragenter events are being sent.
2
This automated layout test checks to see that ondragenter events are being sent.
- a/LayoutTests/platform/chromium/fast/events/ondragenter-expected.txt -1 lines
Lines 1-3 a/LayoutTests/platform/chromium/fast/events/ondragenter-expected.txt_sec1
1
2
Success: Text
1
Success: Text
3
This automated layout test checks to see that ondragenter events are being sent.
2
This automated layout test checks to see that ondragenter events are being sent.
- a/LayoutTests/platform/win/fast/events/ondragenter-expected.txt -1 lines
Lines 1-3 a/LayoutTests/platform/win/fast/events/ondragenter-expected.txt_sec1
1
2
Success: Text
1
Success: Text
3
This automated layout test checks to see that ondragenter events are being sent.
2
This automated layout test checks to see that ondragenter events are being sent.

Return to Bug 110610