Dragging text from one paragraph to another does not render as expected
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 May 2014 02:51:55 +0000 (02:51 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 May 2014 02:51:55 +0000 (02:51 +0000)
commit27ff4c7070563c2cda94b28baad7c58c32e6835b
treee2a3c16e5ab1bf08bb5e55a39f2f5b1dcf29c6be
parent74a1cec4680d0972d1cfb965cab13cf41e44baf3
Dragging text from one paragraph to another does not render as expected
https://bugs.webkit.org/show_bug.cgi?id=132633

Reviewed by Darin Adler and Ryosuke Niwa.

Source/WebCore:
When we are dragging and dropping into a content editable field, we detect
if we are trying to put a <p> into an existing <p>, and if so, split the
outer <p> and insert the new <p> as its sibling. However, the outer <p>
might not be editable, so we don't want to do any splitting and inserting
at that location.

Test: editing/pasteboard/drag-drop-paragraph-crasher.html

* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):

LayoutTests:
The problem occurs when dragging text that includes a <p> into an editable
area that has a <p> as a parent.

* editing/pasteboard/drag-drop-paragraph-crasher-expected.txt: Added.
* editing/pasteboard/drag-drop-paragraph-crasher.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/drag-drop-paragraph-crasher-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/drag-drop-paragraph-crasher.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/editing/ReplaceSelectionCommand.cpp