WebKit Bugzilla
Attachment 360187 Details for
Bug 193786
: Turn on Smart Paste
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Layout test changes needed
layout-test-changes.patch (text/plain), 37.63 KB, created by
Ryosuke Niwa
on 2019-01-25 16:33:14 PST
(
hide
)
Description:
Layout test changes needed
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2019-01-25 16:33:14 PST
Size:
37.63 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index d3f3445e83c..439fec433b7 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,34 @@ >+2019-01-25 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Turn on Smart Paste >+ https://bugs.webkit.org/show_bug.cgi?id=193786 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * editing/editing.js: >+ (runEditingTestWithCallbackLogging): Added the support for editingTest to return a promise. >+ Make DRT/WTR automatically wait for the promise and notify done. >+ (runDumpAsTextEditingTest): Ditto. >+ * 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/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. >+ * platform/ios/editing/pasteboard/smart-paste-007-expected.txt: Added. >+ * resources/ui-helper.js: >+ (UIHelper.doubleClickAt): Added. >+ (UIHelper.async.selectWordByDoubleTapOrClick): Added. >+ > 2019-01-25 Ryosuke Niwa <rniwa@webkit.org> > > iOS: inputmode="none" disables hardware keyboard's globe key >diff --git a/LayoutTests/editing/editing.js b/LayoutTests/editing/editing.js >index 26d56a9c7c4..0e6788f9ef7 100644 >--- a/LayoutTests/editing/editing.js >+++ b/LayoutTests/editing/editing.js >@@ -924,7 +924,17 @@ function runEditingTestWithCallbackLogging(enableCallbackLogging) { > var elem = document.getElementById("test"); > var selection = window.getSelection(); > selection.setPosition(elem, 0); >- editingTest(); >+ >+ const result = editingTest(); >+ >+ if (result instanceof Promise) { >+ if (window.testRunner) >+ testRunner.waitUntilDone(); >+ result.then(() => { >+ if (window.testRunner) >+ testRunner.notifyDone(); >+ }); >+ } > } > > var dumpAsText = false; >@@ -942,10 +952,23 @@ function runDumpAsTextEditingTest(enableCallbacks) { > var elem = document.getElementById("test"); > var selection = window.getSelection(); > selection.setPosition(elem, 0); >- editingTest(); >+ 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) { >diff --git a/LayoutTests/editing/pasteboard/smart-paste-001.html b/LayoutTests/editing/pasteboard/smart-paste-001.html >index 461b86940b6..cffd89c6cbe 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-001.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-001.html >@@ -39,10 +39,11 @@ test > </div> > </div> > <script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- doubleClickAtSelectionStart(); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > copyCommand(); > moveSelectionForwardByCharacterCommand(); > pasteCommand(); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-002.html b/LayoutTests/editing/pasteboard/smart-paste-002.html >index bc3cd7b71e6..89283b09abc 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-002.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-002.html >@@ -39,13 +39,11 @@ test > </div> > </div> > <script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- var target = document.getElementById('test'); >- var x = target.offsetLeft + target.offsetWidth / 2; >- var y = target.offsetTop + target.offsetHeight / 2; >- doubleClick(x, y); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > copyCommand(); > moveSelectionBackwardByWordCommand(); > pasteCommand(); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-003.html b/LayoutTests/editing/pasteboard/smart-paste-003.html >index 6e5a609e322..5a076954881 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-003.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-003.html >@@ -40,10 +40,11 @@ test test > </div> > </div> > <script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- doubleClickAtSelectionStart(); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > copyCommand(); > moveSelectionForwardByCharacterCommand(); > pasteCommand(); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-004.html b/LayoutTests/editing/pasteboard/smart-paste-004.html >index f6515156ab9..0a914c5524d 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-004.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-004.html >@@ -39,10 +39,11 @@ test test > </div> > </div> > <script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- doubleClickAtSelectionStart(); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > copyCommand(); > moveSelectionForwardByCharacterCommand(); > moveSelectionForwardByCharacterCommand(); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-005.html b/LayoutTests/editing/pasteboard/smart-paste-005.html >index 799047b450c..f12f5e5fd83 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-005.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-005.html >@@ -40,13 +40,11 @@ test > </div> > </div> > <script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- var target = document.getElementById('test'); >- var x = target.offsetLeft + target.offsetWidth / 2; >- var y = target.offsetTop + target.offsetHeight / 2; >- doubleClick(x, y); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > copyCommand(); > moveSelectionBackwardByWordCommand(); > moveSelectionForwardByCharacterCommand(); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-006.html b/LayoutTests/editing/pasteboard/smart-paste-006.html >index d2efa017f3e..f1ad76485b6 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-006.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-006.html >@@ -40,10 +40,11 @@ test > </div> > </div> > <script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- extendSelectionForwardByWordCommand(); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > cutCommand(); > typeCharacterCommand('-'); > typeCharacterCommand('-'); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-007.html b/LayoutTests/editing/pasteboard/smart-paste-007.html >index 8b7de9d52a9..ab8837dc33e 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-007.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-007.html >@@ -16,15 +16,12 @@ > .scenario:first-line { font-weight: bold; margin-bottom: 16px;} > .expected-results:first-line { font-weight: bold } > </style> >-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script> >- >+<script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> > >-function editingTest() { >- var target = document.getElementById('test'); >- var x = target.offsetLeft; >- var y = target.offsetTop + target.offsetHeight / 2; >- doubleClick(x, y); >+async function editingTest() { >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); > cutCommand(); > typeCharacterCommand('.'); > typeCharacterCommand('.'); >diff --git a/LayoutTests/editing/pasteboard/smart-paste-008.html b/LayoutTests/editing/pasteboard/smart-paste-008.html >index 37e10482fc5..312902e6283 100644 >--- a/LayoutTests/editing/pasteboard/smart-paste-008.html >+++ b/LayoutTests/editing/pasteboard/smart-paste-008.html >@@ -6,16 +6,20 @@ if (window.testRunner) > <p>A smart paste is performed into a selection starting in one block and ending in another. Spaces should surround the pasted word.</p> > <div id="test" contenteditable="true"><div>foo</div><div>x bar</div></div> > >-<script type="text/javascript" src="../editing.js"></script> >+<script src="../editing.js"></script> >+<script src="../../resources/ui-helper.js"></script> > <script> >-var s = window.getSelection(); > var e = document.getElementById("test"); > >-setSelectionCommand(e, 0, e, 0); >-doubleClickAtSelectionStart(); >-copyCommand(); >-moveSelectionBackwardByCharacterCommand(); >-moveSelectionForwardByCharacterCommand(); >-extendSelectionForwardByLineCommand(); >-pasteCommand(); >+async function runTest() { >+ getSelection().setBaseAndExtent(e, 0, e, 0); >+ await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test')); >+ copyCommand(); >+ moveSelectionBackwardByCharacterCommand(); >+ moveSelectionForwardByCharacterCommand(); >+ extendSelectionForwardByLineCommand(); >+ pasteCommand(); >+} >+ >+UIHelper.wait(runTest()); > </script> >diff --git a/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt b/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt >deleted file mode 100644 >index 0beecb8ff17..00000000000 >--- a/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt >+++ /dev/null >@@ -1,34 +0,0 @@ >-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: webViewDidChangeSelection:WebViewDidChangeSelectionNotification >-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification >-layer at (0,0) size 800x600 >- RenderView at (0,0) size 800x600 >-layer at (0,0) size 800x600 >- RenderBlock {HTML} at (0,0) size 800x600 >- RenderBody {BODY} at (8,8) size 784x584 >- RenderBlock {P} at (0,0) size 784x40 >- RenderText {#text} at (0,0) size 767x39 >- text run at (0,0) width 401: "There was a bug in paste's smart replace whitespace handling. " >- text run at (400,0) width 367: "In some cases, it used information gathered at the start of" >- text run at (0,20) width 759: "the selection being pasted into to decide whether or not a space needed to be added to the end of the incoming content." >- RenderBlock {P} at (0,56) size 784x40 >- RenderText {#text} at (0,0) size 779x39 >- text run at (0,0) width 559: "A smart paste is performed into a selection starting in one block and ending in another. " >- text run at (558,0) width 221: "Spaces should surround the pasted" >- text run at (0,20) width 37: "word." >- RenderBlock {DIV} at (0,112) size 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 >diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations >index af57d95e6f5..e2063588872 100644 >--- a/LayoutTests/platform/ios/TestExpectations >+++ b/LayoutTests/platform/ios/TestExpectations >@@ -2136,13 +2136,7 @@ editing/pasteboard/paste-plaintext-user-select-none.html [ Failure ] > 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. > >diff --git a/LayoutTests/platform/ios/editing/pasteboard/smart-paste-001-expected.txt b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-001-expected.txt >new file mode 100644 >index 00000000000..4355430d21e >--- /dev/null >+++ b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-001-expected.txt >@@ -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> >diff --git a/LayoutTests/platform/ios/editing/pasteboard/smart-paste-002-expected.txt b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-002-expected.txt >new file mode 100644 >index 00000000000..5fecd89ddf5 >--- /dev/null >+++ b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-002-expected.txt >@@ -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> >diff --git a/LayoutTests/platform/ios/editing/pasteboard/smart-paste-003-expected.txt b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-003-expected.txt >new file mode 100644 >index 00000000000..b137fddf50d >--- /dev/null >+++ b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-003-expected.txt >@@ -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> >diff --git a/LayoutTests/platform/ios/editing/pasteboard/smart-paste-004-expected.txt b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-004-expected.txt >new file mode 100644 >index 00000000000..282c3625315 >--- /dev/null >+++ b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-004-expected.txt >@@ -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> >diff --git a/LayoutTests/platform/ios/editing/pasteboard/smart-paste-005-expected.txt b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-005-expected.txt >new file mode 100644 >index 00000000000..e4f6f583be9 >--- /dev/null >+++ b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-005-expected.txt >@@ -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> >diff --git a/LayoutTests/platform/ios/editing/pasteboard/smart-paste-006-expected.txt b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-006-expected.txt >new file mode 100644 >index 00000000000..e05ea3792d2 >--- /dev/null >+++ b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-006-expected.txt >@@ -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> >diff --git a/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-007-expected.txt >similarity index 57% >rename from LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt >rename to LayoutTests/platform/ios/editing/pasteboard/smart-paste-007-expected.txt >index 6684c5cce04..d88a593802d 100644 >--- a/LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt >+++ b/LayoutTests/platform/ios/editing/pasteboard/smart-paste-007-expected.txt >@@ -1,6 +1,15 @@ >+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 >@@ -9,7 +18,7 @@ EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification > EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted > EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification >-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 10 of #text > DIV > DIV > BODY > HTML > #document to 10 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 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 @@ layer at (0,0) size 800x600 > 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 >diff --git a/LayoutTests/resources/ui-helper.js b/LayoutTests/resources/ui-helper.js >index 5b320bc4d45..31c64a8b637 100644 >--- a/LayoutTests/resources/ui-helper.js >+++ b/LayoutTests/resources/ui-helper.js >@@ -30,6 +30,15 @@ window.UIHelper = class UIHelper { > }); > } > >+ static doubleClickAt(x, y) >+ { >+ eventSender.mouseMoveTo(x, y); >+ eventSender.mouseDown(); >+ eventSender.mouseUp(); >+ eventSender.mouseDown(); >+ eventSender.mouseUp(); >+ } >+ > static doubleTapAt(x, y) > { > console.assert(this.isIOS()); >@@ -104,6 +113,20 @@ window.UIHelper = class UIHelper { > return UIHelper.activateAt(x, y); > } > >+ static async selectWordByDoubleTapOrClick(element, relativeX = 5, relativeY = 5) >+ { >+ const boundingRect = element.getBoundingClientRect(); >+ const x = boundingRect.x + relativeX; >+ const y = boundingRect.y + relativeY; >+ if (this.isIOS()) { >+ await UIHelper.tapAt(x, y); >+ await UIHelper.doubleTapAt(x, y); >+ await UIHelper.ensurePresentationUpdate(); >+ } else { >+ await UIHelper.doubleClickAt(x, y); >+ } >+ } >+ > static keyDown(key, modifiers=[]) > { > if (!this.isWebKit2() || !this.isIOS()) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193786
:
360133
|
360143
|
360145
|
360187
|
360197
|
360201
|
360211
|
360214
|
360215
|
360218
|
360369
|
360371
|
360377
|
360379
|
360453
|
360817
|
360822
|
360916
|
360937
|
360943
|
360958
|
360999
|
361000