After sending message, Mail changes formatting
https://bugs.webkit.org/show_bug.cgi?id=111360

Reviewed by Enrica Casucci.

Source/WebCore: 

Added makeInsertedContentRoundTrippableWithHTMLTreeBuilder to move prohibited children (e.g. p, h1, etc...)
out of paragraph elements to run immediately after the fragment insertion. This function splits trees and
moves prohibited children out of paragraph elements to keep the tree isomorphic under HTML serialization and
parsing. Unfortunately, there are many other DOM tree constructs we need to fix to make the subtree truly
isomorphic but this is a step forward.

Test: editing/pasteboard/pasting-into-p-should-not-nest-p.html

* editing/ReplaceSelectionCommand.cpp:
(WebCore::isProhibitedParagraphChild): Added. Matches the list at
https://dvcs.w3.org/hg/editing/raw-file/57abe6d3cb60/editing.html#prohibited-paragraph-child
except main element, which is currently missing in the specification.
(WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder): Added.
(WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor): Added.
(WebCore::ReplaceSelectionCommand::doApply): Call moveProhibitedChildrenOutOfParagraphElements.

* editing/ReplaceSelectionCommand.h:
(ReplaceSelectionCommand):

LayoutTests: 

Added a regression test, demonstrating that a paragraph element is not nested after a paste.
Also rebaselined multiple tests that had been exhibiting this bug in their expected results.

* editing/pasteboard/block-wrappers-necessary-expected.txt:
* editing/pasteboard/paste-table-001-expected.txt:
* editing/pasteboard/paste-text-011-expected.txt:
* editing/pasteboard/paste-text-015-expected.txt:
* editing/pasteboard/pasting-into-p-should-not-nest-p-expected.txt: Added.
* editing/pasteboard/pasting-into-p-should-not-nest-p.html: Added.
* editing/pasteboard/pasting-into-h6-should-not-nest-h6-expected.txt: Added.
* editing/pasteboard/pasting-into-h6-should-not-nest-h6.html: Added.
* platform/mac/editing/pasteboard/paste-text-016-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145253 268f45cc-cd09-0410-ab3c-d52691b4dbfc