WebCore:

2008-04-15  Justin Garcia  <justin.garcia@apple.com>

        Reviewed by Oliver.

        <rdar://problem/5665299> REGRESSION (r27369): Paste text into a contenteditable div creates a contenteditable div for each line (16661)

        * editing/markup.cpp:
        (WebCore::createFragmentFromText): Don't use clones of the enclosing block to hold
        paragraphs if the enclosing block is the root editable element.

LayoutTests:

2008-04-15  Justin Garcia  <justin.garcia@apple.com>

        Reviewed by Oliver.

        <rdar://problem/5665299> REGRESSION (r27369): Paste text into a contenteditable div creates a contenteditable div for each line (16661)

        * editing/pasteboard/5665299-expected.txt: Added.
        * editing/pasteboard/5665299.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ffa57415
2008-04-15 Justin Garcia <justin.garcia@apple.com>
Reviewed by Oliver.
<rdar://problem/5665299> REGRESSION (r27369): Paste text into a contenteditable div creates a contenteditable div for each line (16661)
* editing/pasteboard/5665299-expected.txt: Added.
* editing/pasteboard/5665299.html: Added.
2008-04-15 Anatoli Papirovski <apapirovski@mac.com>
Reviewed by hyatt
This tests for a bug where pasting plain text into an empty contenteditable div would create paragraphs held in clones of the contenteditable div. To run it manually, do a Paste and Match style and then inspect the editable region. It should contain paragraphs held in regular divs.
<div>test</div><div><br></div><div><br></div>
<div id="description">This tests for a bug where pasting plain text into an empty contenteditable div would create paragraphs held in clones of the contenteditable div. To run it manually, do a Paste and Match style and then inspect the editable region. It should contain paragraphs held in regular divs.</div>
<textarea id="copy">test
</textarea>
<div id="paste" contenteditable="true"><br></div>
<script>
if (window.layoutTestController)
window.layoutTestController.dumpAsText();
copy = document.getElementById("copy");
copy.focus();
document.execCommand("SelectAll");
document.execCommand("Copy");
paste = document.getElementById("paste");
paste.focus();
document.execCommand("PasteAndMatchStyle");
document.body.innerText = document.getElementById("description").innerText + "\n\n" + paste.innerHTML;
</script>
2008-04-15 Justin Garcia <justin.garcia@apple.com>
Reviewed by Oliver.
<rdar://problem/5665299> REGRESSION (r27369): Paste text into a contenteditable div creates a contenteditable div for each line (16661)
* editing/markup.cpp:
(WebCore::createFragmentFromText): Don't use clones of the enclosing block to hold
paragraphs if the enclosing block is the root editable element.
2008-04-15 Mark Rowe <mrowe@apple.com>
Reviewed by Jon Honeycutt.
......@@ -1056,7 +1056,7 @@ PassRefPtr<DocumentFragment> createFragmentFromText(Range* context, const String
// Break string into paragraphs. Extra line breaks turn into empty paragraphs.
Node* block = enclosingBlock(context->firstNode());
bool useClonesOfEnclosingBlock = block && !block->hasTagName(bodyTag) && !block->hasTagName(htmlTag);
bool useClonesOfEnclosingBlock = block && !block->hasTagName(bodyTag) && !block->hasTagName(htmlTag) && block != editableRootForPosition(context->startPosition());
Vector<String> list;
string.split('\n', true, list); // true gets us empty strings in the list
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment