| Differences between
and this patch
- a/Source/WebCore/ChangeLog +18 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2014-05-06  Myles C. Maxfield  <mmaxfield@apple.com>
2
3
        Dragging text from one paragraph to another does not render as expected
4
        https://bugs.webkit.org/show_bug.cgi?id=132633
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        When we are dragging and dropping into a content editable field, we detect
9
        if we are trying to put a <p> into an existing <p>, and if so, split the
10
        outer <p> and insert the new <p> as its sibling. However, the outer <p>
11
        might not be editable, so we don't want to do any splitting and inserting
12
        at that location.
13
14
        Test: editing/pasteboard/drag-drop-paragraph-crasher.html
15
16
        * editing/ReplaceSelectionCommand.cpp:
17
        (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
18
1
2014-05-06  Alex Christensen  <achristensen@webkit.org>
19
2014-05-06  Alex Christensen  <achristensen@webkit.org>
2
20
3
        Unreviewed build fix for debug after r168367.
21
        Unreviewed build fix for debug after r168367.
- a/Source/WebCore/editing/ReplaceSelectionCommand.cpp -1 / +2 lines
Lines 629-635 void ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuild a/Source/WebCore/editing/ReplaceSelectionCommand.cpp_sec1
629
            continue;
629
            continue;
630
630
631
        if (isProhibitedParagraphChild(toHTMLElement(node.get())->localName())) {
631
        if (isProhibitedParagraphChild(toHTMLElement(node.get())->localName())) {
632
            if (auto* paragraphElement = enclosingElementWithTag(positionInParentBeforeNode(node.get()), pTag))
632
            auto* paragraphElement = enclosingElementWithTag(positionInParentBeforeNode(node.get()), pTag);
633
            if (paragraphElement && paragraphElement->parentNode()->hasEditableStyle())
633
                moveNodeOutOfAncestor(node, paragraphElement);
634
                moveNodeOutOfAncestor(node, paragraphElement);
634
        }
635
        }
635
636
- a/LayoutTests/ChangeLog +13 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2014-05-06  Myles C. Maxfield  <mmaxfield@apple.com>
2
3
        Dragging text from one paragraph to another does not render as expected
4
        https://bugs.webkit.org/show_bug.cgi?id=132633
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        The problem occurs when dragging text that includes a <p> into an editable
9
        area that has a <p> as a parent.
10
11
        * editing/pasteboard/drag-drop-paragraph-crasher-expected.txt: Added.
12
        * editing/pasteboard/drag-drop-paragraph-crasher.html: Added.
13
1
2014-05-06  Mark Hahnenberg  <mhahnenberg@apple.com>
14
2014-05-06  Mark Hahnenberg  <mhahnenberg@apple.com>
2
15
3
        Roll out r167889
16
        Roll out r167889
- a/LayoutTests/editing/pasteboard/drag-drop-paragraph-crasher-expected.txt +14 lines
Line 0 a/LayoutTests/editing/pasteboard/drag-drop-paragraph-crasher-expected.txt_sec1
1
This tests text selection drag including a <p> tag, where its parent <p> tag is not editable.
2
3
To test this by hand, select the relevant text in this editable span:
4
Select
5
6
me
7
8
aSelect
9
mend drag it here
10
11
12
13
If there is no crash, then the test passed.
14
Pass
- a/LayoutTests/editing/pasteboard/drag-drop-paragraph-crasher.html +54 lines
Line 0 a/LayoutTests/editing/pasteboard/drag-drop-paragraph-crasher.html_sec1
1
<html>
2
<body>
3
<script>
4
function debug(msg) {
5
  var console = document.getElementById('console');
6
  var line = document.createElement('div');
7
  line.textContent = msg;
8
  console.appendChild(line);
9
}
10
11
function editingTest() {
12
    if (!window.testRunner)
13
        return;
14
15
    testRunner.dumpAsText();
16
    testRunner.waitUntilDone();
17
18
    // Drag text in the source
19
    var sel = window.getSelection();
20
    var range = document.createRange();
21
    range.setStartBefore(document.getElementById("source"));
22
    range.setEndBefore(document.getElementById("destination"));
23
    sel.removeAllRanges();
24
    sel.addRange(range);
25
26
    x = source.offsetLeft + 10;
27
    y = source.offsetTop + source.offsetHeight / 2;
28
    eventSender.mouseMoveTo(x, y);
29
    eventSender.mouseDown();
30
    // and drop it off to the destination field.
31
    var destination = document.getElementById("destination");
32
    eventSender.leapForward(500);
33
    eventSender.mouseMoveTo(destination.offsetLeft + 10, destination.offsetTop + destination.offsetHeight / 2);
34
    eventSender.mouseUp();
35
36
    var result = destination.value;
37
    debug("Pass");
38
39
    testRunner.notifyDone();
40
}
41
</script>
42
<p>This tests text selection drag including a &lt;p&gt; tag, where its parent &lt;p&gt; tag is not editable.</p>
43
To test this by hand, select the relevant text in this editable span:
44
	<p>
45
		<span id=source>Select
46
			<p>me</p>
47
			<p id=destination contenteditable>and drag it here</p>
48
		</span>
49
	</p>
50
<br><br>If there is no crash, then the test passed.
51
<div id=console></div>
52
<script>editingTest();</script>
53
</body>
54
</html>

Return to Bug 132633