[iOS] Layout tests editing/pasteboard/smart-paste-007.html and editing/pasteboard/smart-paste-008.html are failing
https://bugs.webkit.org/show_bug.cgi?id=194275
Reviewed by Ryosuke Niwa.
Smart paste tests 7 and 8 were outputting more information that was needed
to verify correct functionality. Also cleaned up test 8 to be more similar to
the other smart copy paste tests.
* editing/pasteboard/smart-paste-007.html:
* editing/pasteboard/smart-paste-008.html:
* platform/ios-wk1/editing/pasteboard/smart-paste-007-expected.txt: Removed.
* platform/ios-wk1/editing/pasteboard/smart-paste-008-expected.txt: Removed.
* platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt: Removed.
* platform/ios/editing/pasteboard/smart-paste-007-expected.txt: Renamed from LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt.
* platform/ios/editing/pasteboard/smart-paste-008-expected.txt: Added.
* platform/mac/editing/pasteboard/smart-paste-007-expected.txt:
* platform/mac/editing/pasteboard/smart-paste-008-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@241010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ac34beb..b51adad 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,24 @@
+2019-02-05 Megan Gardner <megan_gardner@apple.com>
+
+ [iOS] Layout tests editing/pasteboard/smart-paste-007.html and editing/pasteboard/smart-paste-008.html are failing
+ https://bugs.webkit.org/show_bug.cgi?id=194275
+
+ Reviewed by Ryosuke Niwa.
+
+ Smart paste tests 7 and 8 were outputting more information that was needed
+ to verify correct functionality. Also cleaned up test 8 to be more similar to
+ the other smart copy paste tests.
+
+ * editing/pasteboard/smart-paste-007.html:
+ * editing/pasteboard/smart-paste-008.html:
+ * platform/ios-wk1/editing/pasteboard/smart-paste-007-expected.txt: Removed.
+ * platform/ios-wk1/editing/pasteboard/smart-paste-008-expected.txt: Removed.
+ * platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt: Removed.
+ * platform/ios/editing/pasteboard/smart-paste-007-expected.txt: Renamed from LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt.
+ * platform/ios/editing/pasteboard/smart-paste-008-expected.txt: Added.
+ * platform/mac/editing/pasteboard/smart-paste-007-expected.txt:
+ * platform/mac/editing/pasteboard/smart-paste-008-expected.txt:
+
2019-02-05 Wenson Hsieh <wenson_hsieh@apple.com>
Rename TestOptions.ignoreSynchronousMessagingTimeoutsForTesting
diff --git a/LayoutTests/editing/pasteboard/smart-paste-007.html b/LayoutTests/editing/pasteboard/smart-paste-007.html
index ab8837d..12155ca 100644
--- a/LayoutTests/editing/pasteboard/smart-paste-007.html
+++ b/LayoutTests/editing/pasteboard/smart-paste-007.html
@@ -57,7 +57,7 @@
</div>
<script>
-runEditingTest();
+runDumpAsTextEditingTest(true);
</script>
</body>
diff --git a/LayoutTests/editing/pasteboard/smart-paste-008.html b/LayoutTests/editing/pasteboard/smart-paste-008.html
index 312902e..779bf97 100644
--- a/LayoutTests/editing/pasteboard/smart-paste-008.html
+++ b/LayoutTests/editing/pasteboard/smart-paste-008.html
@@ -1,18 +1,27 @@
-<script>
-if (window.testRunner)
- testRunner.dumpEditingCallbacks();
-</script>
-<p>There was a bug in paste's smart replace whitespace handling. In some cases, it used information gathered at the start of the selection being pasted into to decide whether or not a space needed to be added to the end of the incoming content.</p>
-<p>A smart paste is performed into a selection starting in one block and ending in another. Spaces should surround the pasted word.</p>
-<div id="test" contenteditable="true"><div>foo</div><div>x bar</div></div>
+<html>
+<head>
+
+<style>
+.editing {
+ border: 2px solid red;
+ font-size: 24px;
+}
+.explanation {
+ border: 2px solid blue;
+ padding: 12px;
+ font-size: 24px;
+ margin-bottom: 24px;
+}
+.scenario { margin-bottom: 16px;}
+.scenario:first-line { font-weight: bold; margin-bottom: 16px;}
+.expected-results:first-line { font-weight: bold }
+</style>
<script src="../editing.js"></script>
<script src="../../resources/ui-helper.js"></script>
<script>
-var e = document.getElementById("test");
-async function runTest() {
- getSelection().setBaseAndExtent(e, 0, e, 0);
+async function editingTest() {
await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test'));
copyCommand();
moveSelectionBackwardByCharacterCommand();
@@ -20,6 +29,20 @@
extendSelectionForwardByLineCommand();
pasteCommand();
}
+</script>
-UIHelper.wait(runTest());
+<div class="explanation">
+<div class="scenario">
+<p>There was a bug in paste's smart replace whitespace handling. In some cases, it used information gathered at the start of the selection being pasted into to decide whether or not a space needed to be added to the end of the incoming content.</p>
+<div class="expected-results">
+Expected Results:
+<br>
+A smart paste is performed into a selection starting in one block and ending in another. Spaces should surround the pasted word and look like:
+<br>
+f foo bar
+</div>
+<div id="test" contenteditable="true"><div>foo</div><div>x bar</div></div>
+
+<script>
+runDumpAsTextEditingTest(true);
</script>
diff --git a/LayoutTests/platform/ios-wk1/editing/pasteboard/smart-paste-007-expected.txt b/LayoutTests/platform/ios-wk1/editing/pasteboard/smart-paste-007-expected.txt
deleted file mode 100644
index 54eda41..0000000
--- a/LayoutTests/platform/ios-wk1/editing/pasteboard/smart-paste-007-expected.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
-EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 10 of #text > DIV > DIV > BODY > HTML > #document to 10 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldApplyStyle:<DOMCSSStyleDeclaration: 0x7fef55d07fc0> toElementsInDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > SPAN > FONT > DIV > DIV > BODY > HTML > #document to 4 of #text > SPAN > FONT > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > FONT > DIV > DIV > BODY > HTML > #document to 4 of #text > SPAN > FONT > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {DIV} at (0,0) size 784x224 [border: (2px solid #0000FF)]
- RenderBlock {DIV} at (14,14) size 756x60
- RenderText {#text} at (0,1) size 66x28
- text run at (0,1) width 66: "Tests: "
- RenderBR {BR} at (0,0) size 0x0
- RenderText {#text} at (0,31) size 457x28
- text run at (0,31) width 457: "Smart paste when pasting between two periods."
- RenderBlock {DIV} at (14,90) size 756x120
- RenderText {#text} at (0,1) size 190x28
- text run at (0,1) width 190: "Expected Results: "
- RenderBR {BR} at (189,23) size 1x0
- RenderText {#text} at (0,31) size 738x58
- text run at (0,31) width 738: "A space should be added before, but not after the pasted word. It should look"
- text run at (0,61) width 90: "like this: "
- RenderBR {BR} at (89,83) size 1x0
- RenderText {#text} at (0,91) size 52x28
- text run at (0,91) width 52: ". test."
- RenderBlock {DIV} at (0,248) size 784x34
- RenderBlock {DIV} at (0,0) size 784x34 [border: (2px solid #FF0000)]
- RenderText {#text} at (2,3) size 6x28
- text run at (2,3) width 6: "."
- RenderInline {FONT} at (0,0) size 23x19
- RenderInline {SPAN} at (0,0) size 23x19 [bgcolor=#FFFFFF00]
- RenderText {#text} at (8,10) size 23x19
- text run at (8,10) width 23: "test"
- RenderText {#text} at (30,3) size 40x28
- text run at (30,3) width 40: ".test"
- RenderBlock (anonymous) at (0,34) size 784x0
-caret: position 4 of child 0 {#text} of child 0 {SPAN} of child 1 {FONT} of child 1 {DIV} of child 3 {DIV} of body (upstream affinity)
diff --git a/LayoutTests/platform/ios-wk1/editing/pasteboard/smart-paste-008-expected.txt b/LayoutTests/platform/ios-wk1/editing/pasteboard/smart-paste-008-expected.txt
deleted file mode 100644
index b9d84df..0000000
--- a/LayoutTests/platform/ios-wk1/editing/pasteboard/smart-paste-008-expected.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document
-EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldApplyStyle:<DOMCSSStyleDeclaration: 0x7fef55f60300> toElementsInDOMRange:range from 0 of #text > SPAN > DIV > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > DIV > BODY > HTML > #document
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > SPAN > DIV > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {P} at (0,0) size 784x40
- RenderText {#text} at (0,0) size 767x39
- text run at (0,0) width 401: "There was a bug in paste's smart replace whitespace handling. "
- text run at (400,0) width 367: "In some cases, it used information gathered at the start of"
- text run at (0,20) width 759: "the selection being pasted into to decide whether or not a space needed to be added to the end of the incoming content."
- RenderBlock {P} at (0,56) size 784x40
- RenderText {#text} at (0,0) size 779x39
- text run at (0,0) width 559: "A smart paste is performed into a selection starting in one block and ending in another. "
- text run at (558,0) width 221: "Spaces should surround the pasted"
- text run at (0,20) width 37: "word."
- RenderBlock {DIV} at (0,112) size 784x20
- RenderBlock {DIV} at (0,0) size 784x20
- RenderText {#text} at (0,0) size 6x19
- text run at (0,0) width 6: "f"
- RenderInline {SPAN} at (0,0) size 23x19 [bgcolor=#FFFFFF00]
- RenderText {#text} at (5,0) size 23x19
- text run at (5,0) width 23: "test"
- RenderText {#text} at (27,0) size 25x19
- text run at (27,0) width 25: " bar"
- RenderBlock (anonymous) at (0,20) size 784x0
-caret: position 4 of child 0 {#text} of child 1 {SPAN} of child 0 {DIV} of child 4 {DIV} of body (upstream affinity)
diff --git a/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt b/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt
deleted file mode 100644
index b1b4016..0000000
--- a/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document
-EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {P} at (0,0) size 784x40
- RenderText {#text} at (0,0) size 767x39
- text run at (0,0) width 401: "There was a bug in paste's smart replace whitespace handling. "
- text run at (400,0) width 367: "In some cases, it used information gathered at the start of"
- text run at (0,20) width 759: "the selection being pasted into to decide whether or not a space needed to be added to the end of the incoming content."
- RenderBlock {P} at (0,56) size 784x40
- RenderText {#text} at (0,0) size 779x39
- text run at (0,0) width 559: "A smart paste is performed into a selection starting in one block and ending in another. "
- text run at (558,0) width 221: "Spaces should surround the pasted"
- text run at (0,20) width 37: "word."
- RenderBlock {DIV} at (0,112) size 784x20
- RenderBlock {DIV} at (0,0) size 784x20
- RenderText {#text} at (0,0) size 56x19
- text run at (0,0) width 56: "f foo bar"
-caret: position 5 of child 0 {#text} of child 0 {DIV} of child 4 {DIV} of body
diff --git a/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-007-expected.txt
similarity index 70%
rename from LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt
rename to LayoutTests/platform/ios/editing/pasteboard/smart-paste-007-expected.txt
index d88a593..97114b6 100644
--- a/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt
+++ b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-007-expected.txt
@@ -21,31 +21,13 @@
EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {DIV} at (0,0) size 784x224 [border: (2px solid #0000FF)]
- RenderBlock {DIV} at (14,14) size 756x60
- RenderText {#text} at (0,1) size 66x28
- text run at (0,1) width 66: "Tests: "
- RenderBR {BR} at (0,0) size 0x0
- RenderText {#text} at (0,31) size 457x28
- text run at (0,31) width 457: "Smart paste when pasting between two periods."
- RenderBlock {DIV} at (14,90) size 756x120
- RenderText {#text} at (0,1) size 190x28
- text run at (0,1) width 190: "Expected Results: "
- RenderBR {BR} at (189,23) size 1x0
- RenderText {#text} at (0,31) size 738x58
- text run at (0,31) width 738: "A space should be added before, but not after the pasted word. It should look"
- text run at (0,61) width 90: "like this: "
- RenderBR {BR} at (89,83) size 1x0
- RenderText {#text} at (0,91) size 52x28
- text run at (0,91) width 52: ". test."
- RenderBlock {DIV} at (0,248) size 784x34
- RenderBlock {DIV} at (0,0) size 784x34 [border: (2px solid #FF0000)]
- RenderText {#text} at (2,3) size 52x28
- text run at (2,3) width 52: ". test."
-caret: position 6 of child 0 {#text} of child 1 {DIV} of child 3 {DIV} of body
-scrolled to 0,21
+Tests:
+Smart paste when pasting between two periods.
+Expected Results:
+A space should be added before, but not after the pasted word. It should look like this:
+. test.
+. test.
+execCutCommand: <div id="test" class="editing"><br></div>
+execTypeCharacterCommand: <div id="test" class="editing">.</div>
+execTypeCharacterCommand: <div id="test" class="editing">..</div>
+execPasteCommand: <div id="test" class="editing">. test.</div>
diff --git a/LayoutTests/platform/ios/editing/pasteboard/smart-paste-008-expected.txt b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-008-expected.txt
new file mode 100644
index 0000000..f115a5d
--- /dev/null
+++ b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-008-expected.txt
@@ -0,0 +1,21 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 1 of DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+There was a bug in paste's smart replace whitespace handling. In some cases, it used information gathered at the start of the selection being pasted into to decide whether or not a space needed to be added to the end of the incoming content.
+
+Expected Results:
+A smart paste is performed into a selection starting in one block and ending in another. Spaces should surround the pasted word and look like:
+f foo bar
+f foo bar
+
diff --git a/LayoutTests/platform/mac/editing/pasteboard/smart-paste-007-expected.txt b/LayoutTests/platform/mac/editing/pasteboard/smart-paste-007-expected.txt
index 760f520..e361028 100644
--- a/LayoutTests/platform/mac/editing/pasteboard/smart-paste-007-expected.txt
+++ b/LayoutTests/platform/mac/editing/pasteboard/smart-paste-007-expected.txt
@@ -20,30 +20,13 @@
EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {DIV} at (0,0) size 784x212 [border: (2px solid #0000FF)]
- RenderBlock {DIV} at (14,14) size 756x56
- RenderText {#text} at (0,0) size 66x28
- text run at (0,0) width 66: "Tests: "
- RenderBR {BR} at (0,0) size 0x0
- RenderText {#text} at (0,28) size 457x28
- text run at (0,28) width 457: "Smart paste when pasting between two periods."
- RenderBlock {DIV} at (14,86) size 756x112
- RenderText {#text} at (0,0) size 190x28
- text run at (0,0) width 190: "Expected Results: "
- RenderBR {BR} at (189,22) size 1x0
- RenderText {#text} at (0,28) size 738x56
- text run at (0,28) width 738: "A space should be added before, but not after the pasted word. It should look"
- text run at (0,56) width 90: "like this: "
- RenderBR {BR} at (89,78) size 1x0
- RenderText {#text} at (0,84) size 52x28
- text run at (0,84) width 52: ". test."
- RenderBlock {DIV} at (0,236) size 784x32
- RenderBlock {DIV} at (0,0) size 784x32 [border: (2px solid #FF0000)]
- RenderText {#text} at (2,2) size 52x28
- text run at (2,2) width 52: ". test."
-caret: position 6 of child 0 {#text} of child 1 {DIV} of child 3 {DIV} of body
+Tests:
+Smart paste when pasting between two periods.
+Expected Results:
+A space should be added before, but not after the pasted word. It should look like this:
+. test.
+. test.
+execCutCommand: <div id="test" class="editing"><br></div>
+execTypeCharacterCommand: <div id="test" class="editing">.</div>
+execTypeCharacterCommand: <div id="test" class="editing">..</div>
+execPasteCommand: <div id="test" class="editing">. test.</div>
diff --git a/LayoutTests/platform/mac/editing/pasteboard/smart-paste-008-expected.txt b/LayoutTests/platform/mac/editing/pasteboard/smart-paste-008-expected.txt
index eef2cc7..2c15901 100644
--- a/LayoutTests/platform/mac/editing/pasteboard/smart-paste-008-expected.txt
+++ b/LayoutTests/platform/mac/editing/pasteboard/smart-paste-008-expected.txt
@@ -1,35 +1,22 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > DIV > BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 1 of DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {P} at (0,0) size 784x36
- RenderText {#text} at (0,0) size 767x36
- text run at (0,0) width 401: "There was a bug in paste's smart replace whitespace handling. "
- text run at (400,0) width 367: "In some cases, it used information gathered at the start of"
- text run at (0,18) width 759: "the selection being pasted into to decide whether or not a space needed to be added to the end of the incoming content."
- RenderBlock {P} at (0,52) size 784x36
- RenderText {#text} at (0,0) size 779x36
- text run at (0,0) width 559: "A smart paste is performed into a selection starting in one block and ending in another. "
- text run at (558,0) width 221: "Spaces should surround the pasted"
- text run at (0,18) width 37: "word."
- RenderBlock {DIV} at (0,104) size 784x18
- RenderBlock {DIV} at (0,0) size 784x18
- RenderText {#text} at (0,0) size 56x18
- text run at (0,0) width 56: "f foo bar"
-caret: position 5 of child 0 {#text} of child 0 {DIV} of child 4 {DIV} of body
+There was a bug in paste's smart replace whitespace handling. In some cases, it used information gathered at the start of the selection being pasted into to decide whether or not a space needed to be added to the end of the incoming content.
+
+Expected Results:
+A smart paste is performed into a selection starting in one block and ending in another. Spaces should surround the pasted word and look like:
+f foo bar
+f foo bar
+