Title: [240902] trunk
Revision
240902
Author
[email protected]
Date
2019-02-03 01:05:21 -0800 (Sun, 03 Feb 2019)

Log Message

Turn on Smart Paste
https://bugs.webkit.org/show_bug.cgi?id=193786

Reviewed by Ryosuke Niwa.

Source/WebCore:

Turned on a modified tests:
LayoutTests/editing/pasteboard/smart-paste-001.html
LayoutTests/editing/pasteboard/smart-paste-002.html
LayoutTests/editing/pasteboard/smart-paste-003.html
LayoutTests/editing/pasteboard/smart-paste-004.html
LayoutTests/editing/pasteboard/smart-paste-005.html
LayoutTests/editing/pasteboard/smart-paste-006.html
LayoutTests/editing/pasteboard/smart-paste-007.html
LayoutTests/editing/pasteboard/smart-paste-008.html

* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::canSmartReplace):
Turn on smart replace.

Source/WebKit:

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/TextCheckerIOS.mm:
(WebKit::TextChecker::isSmartInsertDeleteEnabled):
Use the flag from UIKit to determine if smart copy paste should be
turned on.

LayoutTests:

Rebaselined many tests and/or added iOS specific expectations to
correctly reflect smart copy paste behavior.

* editing/editing.js:
(runEditingTestWithCallbackLogging):
(runDumpAsTextEditingTest):
Added ability to handle async functions.
* editing/pasteboard/smart-paste-001.html:
* editing/pasteboard/smart-paste-002.html:
* editing/pasteboard/smart-paste-003.html:
* editing/pasteboard/smart-paste-004.html:
* editing/pasteboard/smart-paste-005.html:
* editing/pasteboard/smart-paste-006.html:
* editing/pasteboard/smart-paste-007.html:
* editing/pasteboard/smart-paste-008.html:
* platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt:
* platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt:
* platform/ios/TestExpectations:
* platform/ios/editing/pasteboard/smart-paste-001-expected.txt: Added.
* platform/ios/editing/pasteboard/smart-paste-002-expected.txt: Added.
* platform/ios/editing/pasteboard/smart-paste-003-expected.txt: Added.
* platform/ios/editing/pasteboard/smart-paste-004-expected.txt: Added.
* platform/ios/editing/pasteboard/smart-paste-005-expected.txt: Added.
* platform/ios/editing/pasteboard/smart-paste-006-expected.txt: Added.
* resources/ui-helper.js:
(window.UIHelper.doubleClickAt):
(window.UIHelper.async.selectWordByDoubleTapOrClick):
Added helper functions to allow for selecting a word by double tap or click.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (240901 => 240902)


--- trunk/LayoutTests/ChangeLog	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/ChangeLog	2019-02-03 09:05:21 UTC (rev 240902)
@@ -1,3 +1,39 @@
+2019-02-03  Megan Gardner  <[email protected]>
+
+        Turn on Smart Paste
+        https://bugs.webkit.org/show_bug.cgi?id=193786
+
+        Reviewed by Ryosuke Niwa.
+
+        Rebaselined many tests and/or added iOS specific expectations to 
+        correctly reflect smart copy paste behavior.
+
+        * editing/editing.js:
+        (runEditingTestWithCallbackLogging):
+        (runDumpAsTextEditingTest):
+        Added ability to handle async functions.
+        * editing/pasteboard/smart-paste-001.html:
+        * editing/pasteboard/smart-paste-002.html:
+        * editing/pasteboard/smart-paste-003.html:
+        * editing/pasteboard/smart-paste-004.html:
+        * editing/pasteboard/smart-paste-005.html:
+        * editing/pasteboard/smart-paste-006.html:
+        * editing/pasteboard/smart-paste-007.html:
+        * editing/pasteboard/smart-paste-008.html:
+        * platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt:
+        * platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt:
+        * platform/ios/TestExpectations:
+        * platform/ios/editing/pasteboard/smart-paste-001-expected.txt: Added.
+        * platform/ios/editing/pasteboard/smart-paste-002-expected.txt: Added.
+        * platform/ios/editing/pasteboard/smart-paste-003-expected.txt: Added.
+        * platform/ios/editing/pasteboard/smart-paste-004-expected.txt: Added.
+        * platform/ios/editing/pasteboard/smart-paste-005-expected.txt: Added.
+        * platform/ios/editing/pasteboard/smart-paste-006-expected.txt: Added.
+        * resources/ui-helper.js:
+        (window.UIHelper.doubleClickAt):
+        (window.UIHelper.async.selectWordByDoubleTapOrClick):
+        Added helper functions to allow for selecting a word by double tap or click.
+
 2019-02-02  Justin Fan  <[email protected]>
 
         [WebGPU] Fix GPURenderPassEncoder::setVertexBuffers and allow overlapping indices with GPUBindGroups

Modified: trunk/LayoutTests/editing/editing.js (240901 => 240902)


--- trunk/LayoutTests/editing/editing.js	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/editing/editing.js	2019-02-03 09:05:21 UTC (rev 240902)
@@ -954,8 +954,21 @@
     selection.setPosition(elem, 0);
     const result = editingTest();
 
-    for (var i = 0; i < elementsForDumpingMarkupList.length; i++)
-        document.body.appendChild(elementsForDumpingMarkupList[i]);
+    const postTask = () => {
+        for (var i = 0; i < elementsForDumpingMarkupList.length; i++)
+            document.body.appendChild(elementsForDumpingMarkupList[i]);
+    }
+
+    if (result instanceof Promise) {
+        if (window.testRunner)
+            testRunner.waitUntilDone();
+        result.then(() => {
+            postTask();
+            if (window.testRunner)
+                testRunner.notifyDone();
+        });
+    } else
+        postTask();
 }
 
 function debugForDumpAsText(name) {

Modified: trunk/LayoutTests/editing/pasteboard/smart-paste-006.html (240901 => 240902)


--- trunk/LayoutTests/editing/pasteboard/smart-paste-006.html	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/editing/pasteboard/smart-paste-006.html	2019-02-03 09:05:21 UTC (rev 240902)
@@ -44,7 +44,8 @@
 <script>
 
 async function editingTest() {
-    await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test'));    cutCommand();
+    await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test'));
+    cutCommand();
     typeCharacterCommand('-');
     typeCharacterCommand('-');
     moveSelectionBackwardByCharacterCommand();

Modified: trunk/LayoutTests/editing/pasteboard/smart-paste-007.html (240901 => 240902)


--- trunk/LayoutTests/editing/pasteboard/smart-paste-007.html	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/editing/pasteboard/smart-paste-007.html	2019-02-03 09:05:21 UTC (rev 240902)
@@ -18,7 +18,6 @@
 </style>
 <script src=""
 <script src=""
-
 <script>
 
 async function editingTest() {

Modified: trunk/LayoutTests/platform/ios/TestExpectations (240901 => 240902)


--- trunk/LayoutTests/platform/ios/TestExpectations	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2019-02-03 09:05:21 UTC (rev 240902)
@@ -2107,6 +2107,9 @@
 editing/pasteboard/paste-visible-script.html [ Failure ]
 editing/pasteboard/paste-wrapped-blockquote-into-nonblockquote.html [ Failure ]
 
+# Not able to select select element on iOS
+editing/pasteboard/4944770-2.html [ Failure ]
+
 # Failing pasteboard to triage
 editing/pasteboard/4242293-1.html [ Failure ]
 editing/pasteboard/5780697-2.html [ Failure ]
@@ -2138,14 +2141,8 @@
 editing/pasteboard/paste-sanitize-crash-1.html [ Failure ]
 editing/pasteboard/paste-sanitize-crash-2.html [ Failure ]
 editing/pasteboard/paste-text-events.html [ Failure ]
-editing/pasteboard/smart-paste-001.html [ Failure ]
-editing/pasteboard/smart-paste-002.html [ Failure ]
-editing/pasteboard/smart-paste-003.html [ Failure ]
-editing/pasteboard/smart-paste-004.html [ Failure ]
-editing/pasteboard/smart-paste-005.html [ Failure ]
-editing/pasteboard/smart-paste-007.html [ Failure ]
-editing/pasteboard/smart-paste-008.html [ Failure ]
 
+
 # Local pasteboard is not implemented on iOS, so pasteboard tests used to be all disabled.
 
 editing/execCommand/find-after-replace.html [ Skip ]

Modified: trunk/LayoutTests/platform/ios/editing/pasteboard/4989774-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/4989774-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/4989774-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -4,14 +4,18 @@
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderImage {IMG} at (0,0) size 76x103
-      RenderImage {IMG} at (76,0) size 76x103
-      RenderImage {IMG} at (152,0) size 76x103
-      RenderBR {BR} at (228,103) size 0x0
-      RenderText {#text} at (0,103) size 740x39
-        text run at (0,103) width 635: "This tests for a bug where an images pasted on the same line would appear on different lines. "
-        text run at (634,103) width 102: "You should see"
-        text run at (735,103) width 5: " "
-        text run at (0,123) width 364: "several pictures above all in the same line/paragraph."
+      RenderText {#text} at (76,88) size 4x19
+        text run at (76,88) width 4: " "
+      RenderImage {IMG} at (80,0) size 76x103
+      RenderText {#text} at (156,88) size 4x19
+        text run at (156,88) width 4: " "
+      RenderImage {IMG} at (160,0) size 76x103
+      RenderBR {BR} at (236,103) size 0x0
+      RenderText {#text} at (0,108) size 740x39
+        text run at (0,108) width 635: "This tests for a bug where an images pasted on the same line would appear on different lines. "
+        text run at (634,108) width 102: "You should see"
+        text run at (735,108) width 5: " "
+        text run at (0,128) width 364: "several pictures above all in the same line/paragraph."
       RenderText {#text} at (0,0) size 0x0
       RenderText {#text} at (0,0) size 0x0
-caret: position 164 of child 4 {#text} of body
+caret: position 164 of child 6 {#text} of body

Added: trunk/LayoutTests/platform/ios/editing/pasteboard/onpaste-text-html-expected.txt (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/onpaste-text-html-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/onpaste-text-html-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,6 @@
+CONSOLE MESSAGE: line 21: text/plain: This test verifies that we can get text/html from the clipboard during an onpaste event. 
+CONSOLE MESSAGE: line 23: text/html: <span style="...">This test verifies that we can get text/html from the clipboard during an onpaste event.<span class="Apple-converted-space"> </span></span>
+This test verifies that we can get text/html from the clipboard during an onpaste event. This test requires DRT.
+Paste content in this div. This test verifies that we can get text/html from the clipboard during an onpaste event. 
+PASS
+

Copied: trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-001-expected.txt (from rev 240901, trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-xml-expected.txt) (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-001-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-001-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,23 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 7 of #text > SPAN > DIV > BODY > HTML > #document to 7 of #text > SPAN > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 15 of #text > SPAN > DIV > BODY > HTML > #document to 15 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 11 of #text > SPAN > DIV > BODY > HTML > #document to 11 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
+
+You should see "foo barbar baz" below:
+| "
+"
+| <span>
+|   id="test"
+|   "foo bar bar<#selection-caret> baz"
+| "
+"

Copied: trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-002-expected.txt (from rev 240901, trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-009-expected.txt) (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-002-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-002-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,74 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 9 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 45 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 11 of #text > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 11 of #text > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 44 of #text > DIV > DIV > BODY > HTML > #document to 44 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 11 of #text > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+This tests copy and pastes "is a tide in the affairs of men,\nWhich taken" twice.
+
+There is a tide in the affairs of men,
+Which taken is a tide in the affairs of men,
+Which taken at the flood leads on to fortune.
+Omitted, all the voyage of their life,
+Is bound in shallows and in miseries.
+execCopyCommand: <div id="test" class="editing">There is a tide in the affairs of men,</div> <div class="editing">Which taken at the flood leads on to fortune.</div> <div class="editing">Omitted, all the voyage of their life,</div> <div class="editing">Is bound in shallows and in miseries.</div>
+execPasteCommand: <div id="test" class="editing">There is a tide in the affairs of men,</div><div class="editing">Which taken at the flood leads on to fortune.</div> <div class="editing">Omitted, all the voyage of their life,</div> <div class="editing">Is bound in shallows and in miseries.</div>
+execPasteCommand: <div id="test" class="editing">There is a tide in the affairs of men,</div><div class="editing">Which taken is a tide in the affairs of men,</div><div class="editing">Which taken at the flood leads on to fortune.</div> <div class="editing">Omitted, all the voyage of their life,</div> <div class="editing">Is bound in shallows and in miseries.</div>

Copied: trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-003-expected.txt (from rev 240901, trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-008-expected.txt) (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-003-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-003-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,117 @@
+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: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 38 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 7 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 40 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 40 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+This test copies and pastes "is a tide in the affairs of men,\nWhich taken at the flood leads on to fortune.\nOmitted" twice.
+
+There is a tide in the affairs of men,
+Which taken at the flood leads on to fortune.
+Omitted is a tide in the affairs of men,
+Which taken at the flood leads on to fortune.
+Omitted, all the voyage of their life,
+Is bound in shallows and in miseries.
+execCopyCommand: <div id="test" class="editing">There is a tide in the affairs of men, <div class="editing">Which taken at the flood leads on to fortune. <div class="editing">Omitted, all the voyage of their life, <div class="editing">Is bound in shallows and in miseries. </div> </div> </div> </div>
+execPasteCommand: <div id="test" class="editing">There&nbsp;is a tide in the affairs of men,<div class="editing">Which taken at the flood leads on to fortune.</div><div class="editing"><div class="editing">Omitted, all the voyage of their life, <div class="editing">Is bound in shallows and in miseries. </div> </div> </div> </div>
+execPasteCommand: <div id="test" class="editing">There&nbsp;is a tide in the affairs of men,<div class="editing">Which taken at the flood leads on to fortune.</div><div class="editing"><div class="editing">Omitted is a tide in the affairs of men,</div><div class="editing">Which taken at the flood leads on to fortune.</div><div class="editing">Omitted, all the voyage of their life, <div class="editing">Is bound in shallows and in miseries. </div> </div> </div> </div>

Added: trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-010-expected.txt (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-010-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-010-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,13 @@
+There was a bug when pasting at the end of the block. The content was inserted at the start
+the block instead of the end. This tests the insert-at-end case.
+| "
+"
+| <div>
+|   class="editing"
+|   id="test"
+|   "There is a tide in the affairs of men."
+|   <br>
+|   <br>
+|   "of men. of men.<#selection-caret>"
+| "
+"

Added: trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-at-tabspan-001-expected.txt (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-at-tabspan-001-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/paste-text-at-tabspan-001-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,24 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
+
+You should see aax\tz below:
+| "
+"
+| <span>
+|   id="test"
+|   "a ax<#selection-caret>"
+|   <span>
+|     class="Apple-tab-span"
+|     style="white-space:pre"
+|     "			"
+|   "z"
+| "
+"

Added: trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-001-expected.txt (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-001-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-001-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,19 @@
+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: 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: 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 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 10 of #text > DIV > DIV > BODY > HTML > #document to 10 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+Tests: 
+Smart paste when pasting after a word at the end of a line.
+Expected Results: 
+A space should be added between the preexisting word and the word that's pasted. It should like this: 
+test test
+test test
+execCopyCommand: <div id="test" class="editing"> test </div>
+execPasteCommand: <div id="test" class="editing"> test test</div>

Added: trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-002-expected.txt (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-002-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-002-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,20 @@
+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: 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: 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 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > 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
+Tests: 
+Smart paste when pasting at the beginning of a line before a word.
+Expected Results: 
+A space should be added after the pasted word before the preexising word. It should like this: 
+test test
+test test
+execCopyCommand: <div id="test" class="editing"> test </div>
+execPasteCommand: <div id="test" class="editing">test test </div>

Added: trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-003-expected.txt (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-003-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-003-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,20 @@
+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: 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: 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 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 15 of #text > DIV > DIV > BODY > HTML > #document to 15 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 10 of #text > DIV > DIV > BODY > HTML > #document to 10 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+Tests: 
+Smart paste when pasting after a word and before a space and another word.
+Expected Results: 
+A space should be added between the preexisting word and the word that's pasted. No space should be added after the pasted word. It should like this: 
+test test test
+test test test
+execCopyCommand: <div id="test" class="editing"> test test </div>
+execPasteCommand: <div id="test" class="editing"> test test test</div>

Added: trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-003-trailing-whitespace-expected.txt (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-003-trailing-whitespace-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-003-trailing-whitespace-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,12 @@
+Smart paste when pasting a word with trailing whitespace after a word and a space before another word.
+
+To run this test manually, select "hello " (including trailing space), copy, and paste.
+
+Expected result
+
+A space should be added between the preexisting word and the word that's pasted. No space should be added after the pasted word: hello hello world
+
+Actual result
+
+execCopyCommand: <div id="test" class="editing" style="font-size: 24px;"> hello world </div>
+execPasteCommand: <div id="test" class="editing" style="font-size: 24px;"> hello hello &nbsp;world</div>

Added: trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-004-expected.txt (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-004-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-004-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,22 @@
+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: 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: 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 5 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: shouldInsertNode:#document-fragment replacingDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 15 of #text > DIV > DIV > BODY > HTML > #document to 15 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 11 of #text > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+Tests: 
+Smart paste when pasting after word and a space before another word.
+Expected Results: 
+A space should be added after the pasted word before the other preexisting word. It should like this: 
+test test test
+test test test
+execCopyCommand: <div id="test" class="editing"> test test </div>
+execPasteCommand: <div id="test" class="editing"> test test test</div>

Added: trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-005-expected.txt (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-005-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-005-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,22 @@
+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: 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: 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 5 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 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 11 of #text > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 9 of #text > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+Tests: 
+Smart paste when pasting in the middle of a word.
+Expected Results: 
+Spaces should be added before and after the pasted word. It should look like this: 
+te test st
+te test st
+execCopyCommand: <div id="test" class="editing"> test </div>
+execPasteCommand: <div id="test" class="editing"> te test st</div>

Added: trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-006-expected.txt (0 => 240902)


--- trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-006-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/editing/pasteboard/smart-paste-006-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -0,0 +1,33 @@
+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: 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: 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 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldDeleteDOMRange: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: 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: 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 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 6 of #text > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > 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
+Tests: 
+Smart paste when pasting between smart paste exempt characters.
+Expected Results: 
+No spaces should be added before or 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>

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/4076267-2-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/4076267-2-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/4076267-2-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -11,7 +11,7 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:there should be a single trailing space between the '.' and the last character in this sentence  replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 96 of #text > DIV > DIV > BODY > HTML > #document to 96 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 97 of #text > DIV > DIV > BODY > HTML > #document to 97 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 97 of #text > DIV > DIV > BODY > HTML > #document to 97 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
@@ -27,4 +27,4 @@
         RenderBlock {DIV} at (2,2) size 780x24 [border: (2px solid #AAAAFF)]
           RenderText {#text} at (2,2) size 586x19
             text run at (2,2) width 586: "there should be a single trailing space between the '.' and the last character in this sentence ."
-caret: position 96 of child 0 {#text} of child 1 {DIV} of child 5 {DIV} of body
+caret: position 97 of child 0 {#text} of child 0 {DIV} of child 5 {DIV} of body

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/input-field-1-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/input-field-1-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/input-field-1-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -6,7 +6,7 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 2 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 3 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -19,7 +19,9 @@
           text run at (0,0) width 241: "This tests Copy/Paste of a input field."
       RenderBlock {DIV} at (0,36) size 784x25
         RenderTextControl {INPUT} at (2,2) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
-        RenderTextControl {INPUT} at (141,2) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
+        RenderText {#text} at (139,1) size 5x19
+          text run at (139,1) width 5: " "
+        RenderTextControl {INPUT} at (145,2) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
       RenderBlock {UL} at (0,77) size 784x20
         RenderListItem {LI} at (40,0) size 744x20
           RenderListMarker at (-18,0) size 7x19: bullet
@@ -27,6 +29,6 @@
             text run at (0,0) width 44: "Passed"
 layer at (17,49) size 122x14
   RenderBlock {DIV} at (6,3) size 123x15
-layer at (156,49) size 122x14
+layer at (160,49) size 122x14
   RenderBlock {DIV} at (6,3) size 123x15
-caret: position 1 of child 1 {INPUT} of child 2 {DIV} of body
+caret: position 1 of child 2 {INPUT} of child 2 {DIV} of body

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-006-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-006-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-006-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -13,7 +13,7 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of 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 DIV > DIV > BODY > HTML > #document to 8 of #text > 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 1 of DIV > DIV > BODY > HTML > #document to 9 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
 layer at (0,0) size 800x600
@@ -47,6 +47,6 @@
           RenderText {#text} at (2,3) size 77x28
             text run at (2,3) width 77: "line one"
           RenderBR {BR} at (78,25) size 1x0
-          RenderText {#text} at (2,33) size 78x28
-            text run at (2,33) width 78: "line two"
-caret: position 1 of child 2 {#text} of child 1 {DIV} of child 3 {DIV} of body
+          RenderText {#text} at (2,33) size 84x28
+            text run at (2,33) width 84: "l ine two"
+caret: position 2 of child 2 {#text} of child 1 {DIV} of child 3 {DIV} of body

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-007-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-007-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-007-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -13,7 +13,7 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 9 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -49,6 +49,6 @@
               text run at (0,1) width 77: "line one"
             RenderBR {BR} at (76,23) size 1x0
           RenderBlock {DIV} at (2,32) size 780x30
-            RenderText {#text} at (0,1) size 78x28
-              text run at (0,1) width 78: "line two"
-caret: position 1 of child 0 {#text} of child 2 {DIV} of child 1 {DIV} of child 3 {DIV} of body
+            RenderText {#text} at (0,1) size 84x28
+              text run at (0,1) width 84: "l ine two"
+caret: position 2 of child 0 {#text} of child 2 {DIV} of child 1 {DIV} of child 3 {DIV} of body

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-008-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-008-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-008-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -13,7 +13,7 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 8 of #text > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -48,6 +48,6 @@
             RenderText {#text} at (0,1) size 77x28
               text run at (0,1) width 77: "line one"
           RenderBlock {DIV} at (2,32) size 780x30
-            RenderText {#text} at (0,1) size 78x28
-              text run at (0,1) width 78: "line two"
-caret: position 1 of child 0 {#text} of child 2 {DIV} of child 1 {DIV} of child 3 {DIV} of body
+            RenderText {#text} at (0,1) size 84x28
+              text run at (0,1) width 84: "l ine two"
+caret: position 2 of child 0 {#text} of child 2 {DIV} of child 1 {DIV} of child 3 {DIV} of body

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-009-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-009-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-009-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -13,7 +13,7 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 8 of #text > 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 DIV > DIV > DIV > BODY > HTML > #document to 8 of #text > 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: shouldChangeSelectedDOMRange:range from 1 of DIV > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 2 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
@@ -50,6 +50,6 @@
                 text run at (0,1) width 77: "line one"
               RenderBR {BR} at (76,23) size 1x0
             RenderBlock {DIV} at (0,30) size 780x30
-              RenderText {#text} at (0,1) size 78x28
-                text run at (0,1) width 78: "line two"
-caret: position 1 of child 0 {#text} of child 2 {DIV} of child 1 {DIV} of child 1 {DIV} of child 3 {DIV} of body
+              RenderText {#text} at (0,1) size 84x28
+                text run at (0,1) width 84: "l ine two"
+caret: position 2 of child 0 {#text} of child 2 {DIV} of child 1 {DIV} of child 1 {DIV} of child 3 {DIV} of body

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-010-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-010-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-line-endings-010-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -13,7 +13,7 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 8 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > DIV > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -49,6 +49,6 @@
               RenderText {#text} at (0,1) size 77x28
                 text run at (0,1) width 77: "line one"
             RenderBlock (anonymous) at (0,30) size 780x30
-              RenderText {#text} at (0,1) size 78x28
-                text run at (0,1) width 78: "line two"
-caret: position 1 of child 1 {#text} of child 1 {DIV} of child 1 {DIV} of child 3 {DIV} of body
+              RenderText {#text} at (0,1) size 84x28
+                text run at (0,1) width 84: "l ine two"
+caret: position 2 of child 1 {#text} of child 1 {DIV} of child 1 {DIV} of child 3 {DIV} of body

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-match-style-001-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-match-style-001-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-match-style-001-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -11,7 +11,7 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:b replacingDOMRange:range from 1 of #text > B > DIV > DIV > BODY > HTML > #document to 1 of #text > B > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > B > DIV > DIV > BODY > HTML > #document to 2 of #text > B > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > B > DIV > DIV > BODY > HTML > #document to 3 of #text > B > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -40,7 +40,7 @@
           RenderText {#text} at (0,0) size 0x0
       RenderBlock {DIV} at (0,248) size 784x34
         RenderBlock {DIV} at (0,0) size 784x34 [border: (2px solid #FF0000)]
-          RenderInline {B} at (0,0) size 26x28
-            RenderText {#text} at (2,3) size 26x28
-              text run at (2,3) width 26: "ab"
-caret: position 2 of child 0 {#text} of child 0 {B} of child 1 {DIV} of child 3 {DIV} of body
+          RenderInline {B} at (0,0) size 32x28
+            RenderText {#text} at (2,3) size 32x28
+              text run at (2,3) width 32: "a b"
+caret: position 3 of child 0 {#text} of child 0 {B} of child 1 {DIV} of child 3 {DIV} of body

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-008-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-008-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-008-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -106,7 +106,7 @@
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 20 of #text > DIV > BODY > HTML > #document to 20 of #text > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 45 of #text > DIV > BODY > HTML > #document to 45 of #text > DIV > BODY > HTML > #document toDOMRange:range from 20 of #text > DIV > BODY > HTML > #document to 20 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 46 of #text > DIV > BODY > HTML > #document to 46 of #text > DIV > BODY > HTML > #document toDOMRange:range from 20 of #text > DIV > BODY > HTML > #document to 20 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -122,8 +122,8 @@
           RenderText {#text} at (14,15) size 356x28
             text run at (14,15) width 356: "Is bound in shallows and in miseries."
         RenderBlock (anonymous) at (14,102) size 756x30
-          RenderText {#text} at (0,1) size 438x28
-            text run at (0,1) width 438: "Upon such a full seashallows and in miseries."
+          RenderText {#text} at (0,1) size 444x28
+            text run at (0,1) width 444: "Upon such a full sea shallows and in miseries."
       RenderBlock {DIV} at (0,146) size 784x58 [border: (2px solid #FF0000)]
         RenderText {#text} at (14,15) size 380x28
           text run at (14,15) width 380: "Upon such a full sea are we now afloat,"

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-009-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-009-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-009-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -81,12 +81,12 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 37 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 37 of #text > DIV > DIV > BODY > HTML > #document to 39 of #text > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 37 of #text > DIV > DIV > BODY > HTML > #document to 40 of #text > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -102,9 +102,10 @@
           RenderText {#text} at (14,15) size 356x28
             text run at (14,15) width 356: "Is bound in shallows and in miseries."
         RenderBlock (anonymous) at (14,102) size 756x30
-          RenderText {#text} at (0,1) size 18x28
+          RenderText {#text} at (0,1) size 24x28
             text run at (0,1) width 18: "U"
+            text run at (17,1) width 7: " "
       RenderBlock {DIV} at (0,146) size 784x58 [border: (2px solid #FF0000)]
-        RenderText {#text} at (14,15) size 380x28
-          text run at (14,15) width 380: "Upon such a full sea are we now afloat,"
-caret: position 1 of child 0 {#text} of child 2 {DIV} of body
+        RenderText {#text} at (14,15) size 386x28
+          text run at (14,15) width 386: "U pon such a full sea are we now afloat,"
+caret: position 2 of child 0 {#text} of child 2 {DIV} of body

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-019-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-019-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-019-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -14,7 +14,7 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertText:Bar replacingDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > SPAN > DIV > BODY > HTML > #document to 7 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -48,11 +48,12 @@
             RenderText {#text} at (0,1) size 154x28
               text run at (0,1) width 154: "(case sensitive)."
       RenderBlock {DIV} at (0,321) size 784x34 [border: (2px solid #FF0000)]
-        RenderInline {SPAN} at (0,0) size 152x28
+        RenderInline {SPAN} at (0,0) size 118x28
           RenderInline {SPAN} at (0,0) size 78x28
             RenderText {#text} at (2,3) size 78x28
               text run at (2,3) width 78: "Foo Bar"
-          RenderText {#text} at (80,3) size 74x28
-            text run at (80,3) width 74: " bazBar"
-        RenderText {#text} at (0,0) size 0x0
-caret: position 7 of child 1 {#text} of child 1 {SPAN} of child 3 {DIV} of body
+          RenderText {#text} at (80,3) size 40x28
+            text run at (80,3) width 40: " baz"
+        RenderText {#text} at (119,3) size 41x28
+          text run at (119,3) width 41: " Bar"
+caret: position 4 of child 2 {#text} of child 3 {DIV} of body

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-at-tabspan-003-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-at-tabspan-003-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-text-at-tabspan-003-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -7,11 +7,12 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 3 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > SPAN > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > SPAN > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > SPAN > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > 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
@@ -19,13 +20,13 @@
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 784x58 [border: (2px solid #FF0000)]
-        RenderInline {SPAN} at (0,0) size 178x28
+        RenderInline {SPAN} at (0,0) size 184x28
           RenderText {#text} at (14,15) size 11x28
             text run at (14,15) width 11: "a"
           RenderInline {SPAN} at (0,0) size 134x28
             RenderText {#text} at (24,15) size 134x28
               text run at (24,15) width 134: "\x{9}\x{9}\x{9}"
-          RenderText {#text} at (158,15) size 34x28
-            text run at (158,15) width 34: "axz"
+          RenderText {#text} at (158,15) size 40x28
+            text run at (158,15) width 40: "a xz"
         RenderText {#text} at (0,0) size 0x0
-caret: position 2 of child 2 {#text} of child 1 {SPAN} of child 1 {DIV} of body
+caret: position 3 of child 2 {#text} of child 1 {SPAN} of child 1 {DIV} of body

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-xml-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-xml-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/paste-xml-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -11,9 +11,9 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 7 of #text > span > div > body > html > #document to 7 of #text > span > div > body > html > #document givenAction:WebViewInsertActionPasted
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 14 of #text > span > div > body > html > #document to 14 of #text > span > div > body > html > #document toDOMRange:range from 10 of #text > span > div > body > html > #document to 10 of #text > span > div > body > html > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 15 of #text > span > div > body > html > #document to 15 of #text > span > div > body > html > #document toDOMRange:range from 11 of #text > span > div > body > html > #document to 11 of #text > span > div > body > html > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-foo barbar baz
+foo bar bar baz
 execCopyCommand: <span xmlns="http://www.w3.org/1999/xhtml" id="test">foo bar baz</span>
-execPasteCommand: <span xmlns="http://www.w3.org/1999/xhtml" id="test">foo barbar baz</span>
+execPasteCommand: <span xmlns="http://www.w3.org/1999/xhtml" id="test">foo bar bar baz</span>

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -1,8 +1,17 @@
+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: 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: 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 5 of #text > 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 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldDeleteDOMRange: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: 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: 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 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
@@ -9,7 +18,7 @@
 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 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 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
@@ -36,7 +45,7 @@
             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 79x28
-            text run at (2,3) width 79: ".test.test"
-        RenderBlock (anonymous) at (0,34) size 784x0
-caret: position 5 of child 0 {#text} of child 1 {DIV} of child 3 {DIV} of body
+          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

Modified: trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt (240901 => 240902)


--- trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt	2019-02-03 09:05:21 UTC (rev 240902)
@@ -1,9 +1,16 @@
+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 0 of #text > SPAN > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > SPAN > DIV > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+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
@@ -21,14 +28,8 @@
           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 784x30
-        RenderBlock {DIV} at (0,0) size 784x30
-          RenderText {#text} at (0,8) size 6x19
-            text run at (0,8) width 6: "f"
-          RenderInline {SPAN} at (0,0) size 34x28
-            RenderText {#text} at (5,1) size 34x28
-              text run at (5,1) width 34: "test"
-          RenderText {#text} at (38,8) size 26x19
-            text run at (38,8) width 26: " bar"
-        RenderBlock (anonymous) at (0,30) size 784x0
-caret: position 4 of child 0 {#text} of child 1 {SPAN} of child 0 {DIV} of child 4 {DIV} of body
+      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

Modified: trunk/Source/WebCore/ChangeLog (240901 => 240902)


--- trunk/Source/WebCore/ChangeLog	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/Source/WebCore/ChangeLog	2019-02-03 09:05:21 UTC (rev 240902)
@@ -1,3 +1,24 @@
+2019-02-03  Megan Gardner  <[email protected]>
+
+        Turn on Smart Paste
+        https://bugs.webkit.org/show_bug.cgi?id=193786
+
+        Reviewed by Ryosuke Niwa.
+
+        Turned on a modified tests:
+        LayoutTests/editing/pasteboard/smart-paste-001.html
+        LayoutTests/editing/pasteboard/smart-paste-002.html
+        LayoutTests/editing/pasteboard/smart-paste-003.html
+        LayoutTests/editing/pasteboard/smart-paste-004.html
+        LayoutTests/editing/pasteboard/smart-paste-005.html
+        LayoutTests/editing/pasteboard/smart-paste-006.html
+        LayoutTests/editing/pasteboard/smart-paste-007.html
+        LayoutTests/editing/pasteboard/smart-paste-008.html
+
+        * platform/ios/PasteboardIOS.mm:
+        (WebCore::Pasteboard::canSmartReplace):
+        Turn on smart replace.
+
 2019-02-02  Simon Fraser  <[email protected]>
 
         Tidy up data memebers of FrameView and related classes to shrink class sizes

Modified: trunk/Source/WebCore/platform/ios/PasteboardIOS.mm (240901 => 240902)


--- trunk/Source/WebCore/platform/ios/PasteboardIOS.mm	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/Source/WebCore/platform/ios/PasteboardIOS.mm	2019-02-03 09:05:21 UTC (rev 240902)
@@ -147,7 +147,7 @@
 
 bool Pasteboard::canSmartReplace()
 {
-    return false;
+    return true;
 }
 
 void Pasteboard::read(PasteboardPlainText& text)

Modified: trunk/Source/WebKit/ChangeLog (240901 => 240902)


--- trunk/Source/WebKit/ChangeLog	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/Source/WebKit/ChangeLog	2019-02-03 09:05:21 UTC (rev 240902)
@@ -1,3 +1,16 @@
+2019-02-03  Megan Gardner  <[email protected]>
+
+        Turn on Smart Paste
+        https://bugs.webkit.org/show_bug.cgi?id=193786
+
+        Reviewed by Ryosuke Niwa.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        * UIProcess/ios/TextCheckerIOS.mm:
+        (WebKit::TextChecker::isSmartInsertDeleteEnabled):
+        Use the flag from UIKit to determine if smart copy paste should be
+        turned on.
+
 2019-02-02  Simon Fraser  <[email protected]>
 
         Tidy up data memebers of FrameView and related classes to shrink class sizes

Modified: trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h (240901 => 240902)


--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2019-02-03 09:05:21 UTC (rev 240902)
@@ -259,6 +259,7 @@
 @end
 
 @interface UIKeyboardImpl : UIView <UIKeyboardCandidateListDelegate>
+- (BOOL)smartInsertDeleteIsEnabled;
 @end
 
 @interface UIKeyboardImpl ()

Modified: trunk/Source/WebKit/UIProcess/ios/TextCheckerIOS.mm (240901 => 240902)


--- trunk/Source/WebKit/UIProcess/ios/TextCheckerIOS.mm	2019-02-03 00:16:44 UTC (rev 240901)
+++ trunk/Source/WebKit/UIProcess/ios/TextCheckerIOS.mm	2019-02-03 09:05:21 UTC (rev 240902)
@@ -113,8 +113,7 @@
 
 bool TextChecker::isSmartInsertDeleteEnabled()
 {
-    notImplemented();
-    return false;
+    return [[UIKeyboardImpl sharedInstance] smartInsertDeleteIsEnabled];
 }
 
 void TextChecker::setSmartInsertDeleteEnabled(bool)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to