Title: [290908] branches/safari-613-branch/LayoutTests
Revision
290908
Author
[email protected]
Date
2022-03-07 14:08:28 -0800 (Mon, 07 Mar 2022)

Log Message

Cherry-pick r287898. rdar://problem/86035420

    Rewrite touch and drag tests to be more robust.
    https://bugs.webkit.org/show_bug.cgi?id=235057
    rdar://86035420

    Reviewed by Wenson Hsieh.

    Rewrite the touch-and-drag tests to check for selection changes, not specific text selections.
    Specific selections and subject to small changes in font and layout, and all that is actually important is that
    there have been selection changes based off of dragged touches.
    The touch-event-radius test has been updated to use the screen size directly, since the radius is scaled by the screen size
    internally. The output has been changed to not need to be updated when the test phone changes.

    * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text-expected.txt:
    * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text.html:
    * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text-expected.txt:
    * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text.html:
    * fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html:
    * fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text-expected.txt:
    * fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html:
    * fast/events/touch/ios/long-press-then-drag-to-select-text-expected.txt:
    * fast/events/touch/ios/long-press-then-drag-to-select-text.html:
    * fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text-expected.txt:
    * fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html:
    * fast/events/touch/ios/touch-event-radius-expected.txt:
    * fast/events/touch/ios/touch-event-radius.html:

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

Modified Paths

Diff

Modified: branches/safari-613-branch/LayoutTests/ChangeLog (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/ChangeLog	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/ChangeLog	2022-03-07 22:08:28 UTC (rev 290908)
@@ -1,3 +1,64 @@
+2022-03-07  Russell Epstein  <[email protected]>
+
+        Cherry-pick r287898. rdar://problem/86035420
+
+    Rewrite touch and drag tests to be more robust.
+    https://bugs.webkit.org/show_bug.cgi?id=235057
+    rdar://86035420
+    
+    Reviewed by Wenson Hsieh.
+    
+    Rewrite the touch-and-drag tests to check for selection changes, not specific text selections.
+    Specific selections and subject to small changes in font and layout, and all that is actually important is that
+    there have been selection changes based off of dragged touches.
+    The touch-event-radius test has been updated to use the screen size directly, since the radius is scaled by the screen size
+    internally. The output has been changed to not need to be updated when the test phone changes.
+    
+    * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text-expected.txt:
+    * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text.html:
+    * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text-expected.txt:
+    * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text.html:
+    * fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html:
+    * fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text-expected.txt:
+    * fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html:
+    * fast/events/touch/ios/long-press-then-drag-to-select-text-expected.txt:
+    * fast/events/touch/ios/long-press-then-drag-to-select-text.html:
+    * fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text-expected.txt:
+    * fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html:
+    * fast/events/touch/ios/touch-event-radius-expected.txt:
+    * fast/events/touch/ios/touch-event-radius.html:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-01-11  Megan Gardner  <[email protected]>
+
+            Rewrite touch and drag tests to be more robust.
+            https://bugs.webkit.org/show_bug.cgi?id=235057
+            rdar://86035420
+
+            Reviewed by Wenson Hsieh.
+
+            Rewrite the touch-and-drag tests to check for selection changes, not specific text selections.
+            Specific selections and subject to small changes in font and layout, and all that is actually important is that
+            there have been selection changes based off of dragged touches.
+            The touch-event-radius test has been updated to use the screen size directly, since the radius is scaled by the screen size
+            internally. The output has been changed to not need to be updated when the test phone changes.
+
+            * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text-expected.txt:
+            * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text.html:
+            * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text-expected.txt:
+            * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text.html:
+            * fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html:
+            * fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text-expected.txt:
+            * fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html:
+            * fast/events/touch/ios/long-press-then-drag-to-select-text-expected.txt:
+            * fast/events/touch/ios/long-press-then-drag-to-select-text.html:
+            * fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text-expected.txt:
+            * fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html:
+            * fast/events/touch/ios/touch-event-radius-expected.txt:
+            * fast/events/touch/ios/touch-event-radius.html:
+
 2022-03-01  Russell Epstein  <[email protected]>
 
         Revert r289282. rdar://problem/88876661

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text-expected.txt (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text-expected.txt	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text-expected.txt	2022-03-07 22:08:28 UTC (rev 290908)
@@ -1,8 +1,6 @@
 PASS: Has Caret Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
+PASS: Has Selection
+PASS: Selection Changed
+PASS: Selection Changed
+PASS: Selection Changed
 

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text.html (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text.html	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text.html	2022-03-07 22:08:28 UTC (rev 290908)
@@ -1,5 +1,4 @@
 <!DOCTYPE html>
-
 <html>
 <head>
     <script src=""
@@ -9,29 +8,26 @@
             testRunner.dumpAsText();
             testRunner.waitUntilDone();
         }
-    
+
         async function runTest()
         {
             if (!testRunner.runUIScript)
                 return;
-        
+
             var output = '';
             var editableTargetRect = document.getElementById('editable').getBoundingClientRect();
-            var firstTargetRect = document.getElementById('firstSelection').getBoundingClientRect();
-            var secondTargetRect = document.getElementById('secondSelection').getBoundingClientRect();
-            var thirdTargetRect = document.getElementById('thirdSelection').getBoundingClientRect();
-            var editableToNoneditableOffset =  document.getElementById('noneditable').getBoundingClientRect().y - document.getElementById('editable').getBoundingClientRect().y;
-        
+
             var tapPointX = editableTargetRect.x + editableTargetRect.width / 2;
             var tapPointY = editableTargetRect.y + editableTargetRect.height / 2;
-            var doubleTapPointX = firstTargetRect.x + firstTargetRect.width / 2;
-            var doubleTapPointY = firstTargetRect.y + firstTargetRect.height / 2 - editableToNoneditableOffset;
-            var dragY = firstTargetRect.y + firstTargetRect.height - editableToNoneditableOffset;
-            var dragX = firstTargetRect.x + firstTargetRect.width;
-            var dragY2 = secondTargetRect.y + secondTargetRect.height - editableToNoneditableOffset;
-            var dragY3 = thirdTargetRect.y + thirdTargetRect.height - editableToNoneditableOffset;
-            var dragY4 = firstTargetRect.y - firstTargetRect.height - editableToNoneditableOffset;
-        
+            
+            var fontHeight = 30;
+
+            var selectionChangedCount = 0;
+            var lastSelectionChangeCount = 0;
+            document.addEventListener("selectionchange", () => {
+                selectionChangedCount++;
+            });
+
             await UIHelper.tapAt(tapPointX, tapPointY);
             if (document.getSelection().type == "Caret")
                 output += 'PASS: Has Caret Selection';
@@ -41,64 +37,53 @@
 
             await didShowKeyboard();
 
-            await UIHelper.doubleTapAt(doubleTapPointX, doubleTapPointY);
-            if (document.getSelection().toString() == "sed")
-                output += 'PASS: Correct Selection';
+            await UIHelper.doubleTapAt(tapPointX, tapPointY);
+            if (document.getSelection().toString() != "")
+                output += 'PASS: Has Selection';
             else
-                output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
+                output += 'FAIL: failed to select a word as a result of a double tap.';
             output += '<br>';
 
             await UIHelper.waitForDoubleTapDelay();
 
-            await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY2);
-            if (document.getSelection().toString() == "sed do eiusmod tempor incididun")
-                output += 'PASS: Correct Selection';
-            else
-                output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+            var grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionEndGrabberViewRect());
 
-            await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY3);
-            if (document.getSelection().toString() == "sed do eiusmod tempor incididunt ut labore et dolore ma")
-                output += 'PASS: Correct Selection';
-            else
-                output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y, grabberMidpoint.x, grabberMidpoint.y + (fontHeight * 2));
 
-            await touchAndDragFromPointToPoint(dragX, dragY3, dragX, dragY2);
-            if (document.getSelection().toString() == "sed do eiusmod tempor incididun")
-                output += 'PASS: Correct Selection';
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+                output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
 
-            await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY);
-            if (document.getSelection().toString() == "sed")
-                output += 'PASS: Correct Selection';
+            lastSelectionChangeCount = selectionChangedCount;
+            grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionEndGrabberViewRect());
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y, grabberMidpoint.x, grabberMidpoint.y - (fontHeight));
+
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+                output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
 
-            var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY4);
-            if (document.getSelection().toString() == "sed")
-                output += 'PASS: Correct Selection';
+            lastSelectionChangeCount = selectionChangedCount;
+            grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionEndGrabberViewRect());
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y, grabberMidpoint.x, grabberMidpoint.y - (fontHeight * 4));
+
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to reduce selection to a single character by dragging up. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
-            output += result;
+                output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
 
-            var noneditableElement = document.getElementById('noneditable');
-            noneditableElement.parentNode.removeChild(noneditableElement);
             var editableElement = document.getElementById('editable');
             editableElement.parentNode.removeChild(editableElement);
             document.getElementById('target').innerHTML = output;
             testRunner.notifyDone();
         }
-    
+
         window.addEventListener('load', runTest, false);
     </script>
     <style>
-        #noneditable {
-            height: 200px;
+        #target {
+            height: 50px;
             width: 300px;
             background-color: silver;
             font-family: monospace;
@@ -105,31 +90,21 @@
             font-size: 18px;
         }
         #editable {
-            height: 200px;
+            height: 300px;
             width: 300px;
             background-color: silver;
             font-family: monospace;
-            font-size: 18px;
+            font-size: 30px;
         }
-        #target {
-            height: 50px;
-            width: 300px;
-            background-color: silver;
-            font-family: monospace;
-            font-size: 18px;
-        }
     </style>
     <meta name="viewport" content="width=device-width, initial-scale=1">
 </head>
 <body>
-    <div id="editable" contenteditable>
-        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
-    </div> 
-    <div id="noneditable">
-        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, <span id="firstSelection">sed</span> do eiusmod tempor incididun<span id="secondSelection"></span>t ut labore et dolore mag<span id="thirdSelection"></span>na aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
-    </div>
     <div id="target">
         This test requires UIScriptController to run.
     </div>
+    <div id="editable" contenteditable>
+        <p>Here's to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes.</p>
+    </div>
 </body>
 </html>

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text-expected.txt (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text-expected.txt	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text-expected.txt	2022-03-07 22:08:28 UTC (rev 290908)
@@ -1,8 +1,6 @@
 PASS: Has Caret Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
+PASS: Has Selection
+PASS: Selection Changed
+PASS: Selection Changed
+PASS: Selection Changed
 

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text.html (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text.html	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text.html	2022-03-07 22:08:28 UTC (rev 290908)
@@ -1,5 +1,4 @@
 <!DOCTYPE html>
-
 <html>
 <head>
     <script src=""
@@ -9,7 +8,7 @@
             testRunner.dumpAsText();
             testRunner.waitUntilDone();
         }
-    
+
         async function runTest()
         {
             if (!testRunner.runUIScript)
@@ -17,21 +16,18 @@
 
             var output = '';
             var editableTargetRect = document.getElementById('editable').getBoundingClientRect();
-            var firstTargetRect = document.getElementById('firstSelection').getBoundingClientRect();
-            var secondTargetRect = document.getElementById('secondSelection').getBoundingClientRect();
-            var thirdTargetRect = document.getElementById('thirdSelection').getBoundingClientRect();
-            var editableToNoneditableOffset =  document.getElementById('noneditable').getBoundingClientRect().y - document.getElementById('editable').getBoundingClientRect().y;
-        
+
             var tapPointX = editableTargetRect.x + editableTargetRect.width / 2;
             var tapPointY = editableTargetRect.y + editableTargetRect.height / 2;
-            var doubleTapPointX = firstTargetRect.x + firstTargetRect.width / 2;
-            var doubleTapPointY = firstTargetRect.y + firstTargetRect.height / 2 - editableToNoneditableOffset;
-            var dragY = firstTargetRect.y - editableToNoneditableOffset;
-            var dragX = firstTargetRect.x;
-            var dragY2 = secondTargetRect.y - editableToNoneditableOffset;
-            var dragY3 = thirdTargetRect.y - editableToNoneditableOffset;
-            var dragY4 = firstTargetRect.y + firstTargetRect.height - editableToNoneditableOffset;
-        
+            
+            var fontHeight = 30;
+
+            var selectionChangedCount = 0;
+            var lastSelectionChangeCount = 0;
+            document.addEventListener("selectionchange", () => {
+                selectionChangedCount++;
+            });
+
             await UIHelper.tapAt(tapPointX, tapPointY);
             if (document.getSelection().type == "Caret")
                 output += 'PASS: Has Caret Selection';
@@ -41,53 +37,43 @@
 
             await didShowKeyboard();
 
-            await UIHelper.doubleTapAt(doubleTapPointX, doubleTapPointY);
-            if (document.getSelection().toString() == "at")
-                output += 'PASS: Correct Selection';
+            await UIHelper.doubleTapAt(tapPointX, tapPointY);
+            if (document.getSelection().toString() != "")
+                output += 'PASS: Has Selection';
             else
-                output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
+                output += 'FAIL: failed to select a word as a result of a double tap.';
             output += '<br>';
 
             await UIHelper.waitForDoubleTapDelay();
 
-            await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY2);
-            if (document.getSelection().toString() == "o eiusmod tempor incididunt at")
-                output += 'PASS: Correct Selection';
-            else
-                output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+            lastSelectionChangeCount = selectionChangedCount;
+            var grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionStartGrabberViewRect());
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y , grabberMidpoint.x, grabberMidpoint.y - (fontHeight * 2));
 
-            await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY3);
-            if (document.getSelection().toString() == " adipiscing elit, sed do eiusmod tempor incididunt at")
-                output += 'PASS: Correct Selection';
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+                output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
 
-            await touchAndDragFromPointToPoint(dragX, dragY3, dragX, dragY2);
-            if (document.getSelection().toString() == "o eiusmod tempor incididunt at")
-                output += 'PASS: Correct Selection';
-            else
-                output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+            lastSelectionChangeCount = selectionChangedCount;
+            grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionStartGrabberViewRect());
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y , grabberMidpoint.x, grabberMidpoint.y + (fontHeight * 3));
+            await liftUpAtPoint(grabberMidpoint.x, grabberMidpoint.y - (fontHeight * 3));
 
-            await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY);
-            if (document.getSelection().toString() == "at")
-                output += 'PASS: Correct Selection';
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+                output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
+            
+            lastSelectionChangeCount = selectionChangedCount;
+            grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionStartGrabberViewRect());
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y , grabberMidpoint.x, grabberMidpoint.y + (fontHeight * 2));
 
-            var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY4);
-            if (document.getSelection().toString() == "at")
-                output += 'PASS: Correct Selection';
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to reduce selection to a single character by dragging down. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
-            output += result;
+                output += 'FAIL: Selection changed <br>' + selectionChangedCount;
 
-            var noneditableElement = document.getElementById('noneditable');
-            noneditableElement.parentNode.removeChild(noneditableElement);
             var editableElement = document.getElementById('editable');
             editableElement.parentNode.removeChild(editableElement);
             document.getElementById('target').innerHTML = output;
@@ -97,8 +83,8 @@
         window.addEventListener('load', runTest, false);
     </script>
     <style>
-        #noneditable {
-            height: 200px;
+        #target {
+            height: 50px;
             width: 300px;
             background-color: silver;
             font-family: monospace;
@@ -105,31 +91,22 @@
             font-size: 18px;
         }
         #editable {
-            height: 200px;
+            height: 300px;
             width: 300px;
             background-color: silver;
             font-family: monospace;
-            font-size: 18px;
+            font-size: 30px;
         }
-        #target {
-            height: 50px;
-            width: 300px;
-            background-color: silver;
-            font-family: monospace;
-            font-size: 18px;
-        }
     </style>
-    <meta name="viewport" content="initial-scale=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
 </head>
 <body>
-    <div id="editable" contenteditable>
-        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt at labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
-    </div> 
-    <div id="noneditable">
-        <p>Lorem ipsum dolor sit amet, consectetur<span id="thirdSelection"></span> adipiscing elit, sed d<span id="secondSelection"></span>o eiusmod tempor incididunt <span id="firstSelection">at</span> labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
-    </div>
     <div id="target">
         This test requires UIScriptController to run.
     </div>
+    <div id="editable" contenteditable>
+        <p>Here's to the crazy ones. The misfits. The rebels. The trouble makers. The round pegs in the square holes.</p>
+    </div>
 </body>
 </html>
+

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html	2022-03-07 22:08:28 UTC (rev 290908)
@@ -37,27 +37,30 @@
                 output += 'FAIL: failed to select a word as a result of a long press.';
             output += '<br>';
 
+            lastSelectionChangeCount = selectionChangedCount;
             var grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionStartGrabberViewRect());
             await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y , grabberMidpoint.x, grabberMidpoint.y - (fontHeight * 2));
 
-            if (selectionChangedCount == 3)
+            if (selectionChangedCount > lastSelectionChangeCount)
                 output += 'PASS: Selection Changed </br>';
             else
                 output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
 
+            lastSelectionChangeCount = selectionChangedCount;
             grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionStartGrabberViewRect());
             await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y , grabberMidpoint.x, grabberMidpoint.y + (fontHeight * 3));
             await liftUpAtPoint(grabberMidpoint.x, grabberMidpoint.y - (fontHeight * 3));
 
-            if (selectionChangedCount == 5)
+            if (selectionChangedCount > lastSelectionChangeCount)
                 output += 'PASS: Selection Changed </br>';
             else
                 output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
             
+            lastSelectionChangeCount = selectionChangedCount;
             grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionStartGrabberViewRect());
             await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y , grabberMidpoint.x, grabberMidpoint.y + (fontHeight * 2));
 
-            if (selectionChangedCount == 7)
+            if (selectionChangedCount > lastSelectionChangeCount)
                 output += 'PASS: Selection Changed </br>';
             else
                 output += 'FAIL: Selection changed <br>' + selectionChangedCount;

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text-expected.txt (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text-expected.txt	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text-expected.txt	2022-03-07 22:08:28 UTC (rev 290908)
@@ -1,7 +1,5 @@
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
+PASS: Has Selection
+PASS: Selection Changed
+PASS: Selection Changed
+PASS: Selection Changed
 

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html	2022-03-07 22:08:28 UTC (rev 290908)
@@ -1,96 +1,98 @@
 <!DOCTYPE html>
-
 <html>
 <head>
     <script src=""
+    <script src=""
     <script>
         if (window.testRunner) {
             testRunner.dumpAsText();
             testRunner.waitUntilDone();
         }
-    
+
         async function runTest()
         {
             if (!testRunner.runUIScript)
                 return;
-        
+
             var output = '';
-            var firstTargetRect = document.getElementById('firstSelection').getBoundingClientRect();
-            var secondTargetRect = document.getElementById('secondSelection').getBoundingClientRect();
-            var thirdTargetRect = document.getElementById('thirdSelection').getBoundingClientRect();
-        
-            var pressPointX = firstTargetRect.x + firstTargetRect.width / 2;
-            var pressPointY = firstTargetRect.y + firstTargetRect.height / 2;
-            var dragY = firstTargetRect.y + firstTargetRect.height;
-            var dragX = firstTargetRect.x + firstTargetRect.width;
-            var dragY2 = secondTargetRect.y + secondTargetRect.height;
-            var dragY3 = thirdTargetRect.y + thirdTargetRect.height;
-            var dragY4 = firstTargetRect.y - firstTargetRect.height;
-        
-            await longPressAtPoint(pressPointX,pressPointY);
-            if (document.getSelection().toString() == "sed")
-                output += 'PASS: Correct Selection';
-            else
-                output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+            var targetRect = document.getElementById('target').getBoundingClientRect();
 
-            await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY2);
-            if (document.getSelection().toString() == "sed do eiusmod tempor incididun")
-                output += 'PASS: Correct Selection';
+            var pressPointX = targetRect.x + targetRect.width / 2;
+            var pressPointY = targetRect.y + targetRect.height / 2;
+            
+            var fontHeight = 30;
+
+            var selectionChangedCount = 0;
+            var lastSelectionChangeCount = 0;
+            document.addEventListener("selectionchange", () => {
+                selectionChangedCount++;
+            });
+
+            await longPressAtPoint(pressPointX, pressPointY);
+
+            await UIHelper.waitForSelectionToAppear();
+
+            if (document.getSelection().toString() != "")
+                output += 'PASS: Has Selection';
             else
-                output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+                output += 'FAIL: failed to select a word as a result of a long press.';
             output += '<br>';
 
-            await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY3);
-            if (document.getSelection().toString() == "sed do eiusmod tempor incididunt ut labore et dolore ma")
-                output += 'PASS: Correct Selection';
+            lastSelectionChangeCount = selectionChangedCount;
+            var grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionEndGrabberViewRect());
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y, grabberMidpoint.x, grabberMidpoint.y + (fontHeight * 2));
+
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+                output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
 
-            await touchAndDragFromPointToPoint(dragX, dragY3, dragX, dragY2);
-            if (document.getSelection().toString() == "sed do eiusmod tempor incididun")
-                output += 'PASS: Correct Selection';
+            lastSelectionChangeCount = selectionChangedCount;
+            grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionEndGrabberViewRect());
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y, grabberMidpoint.x, grabberMidpoint.y - (fontHeight));
+
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+                output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
 
-            await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY);
-            if (document.getSelection().toString() == "sed")
-                output += 'PASS: Correct Selection';
+            lastSelectionChangeCount = selectionChangedCount;
+            grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionEndGrabberViewRect());
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y, grabberMidpoint.x, grabberMidpoint.y - (fontHeight * 4));
+
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+                output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
 
-            var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY4);
-            if (document.getSelection().toString() == "sed")
-                output += 'PASS: Correct Selection';
-            else
-                output += 'FAIL: failed to reduce selection to a single character by dragging up. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
-            output += result;
             document.getElementById('target').innerHTML = output;
             testRunner.notifyDone();
         }
-    
+
         window.addEventListener('load', runTest, false);
     </script>
     <style>
         #target {
-            height: 400px;
+            height: 50px;
             width: 300px;
             background-color: silver;
             font-family: monospace;
             font-size: 18px;
         }
+        #editable {
+            height: 300px;
+            width: 300px;
+            background-color: silver;
+            font-family: monospace;
+            font-size: 30px;
+        }
     </style>
-    <meta name="viewport" content="initial-scale=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
 </head>
 <body>
     <div id="target">
-        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, <span id="firstSelection">sed</span> do eiusmod tempor incididun<span id="secondSelection"></span>t ut labore et dolore mag<span id="thirdSelection"></span>na aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
-        
-        This test requires UIScriptController to run.
+        <p>Here's to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes.</p>
+        <p>This test requires UIScriptController to run.</p>
     </div>
 </body>
 </html>

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-to-select-text-expected.txt (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-to-select-text-expected.txt	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-to-select-text-expected.txt	2022-03-07 22:08:28 UTC (rev 290908)
@@ -1,3 +1,4 @@
-PASS: Correct Selection
-PASS: Correct Selection
+PASS: Has Selection
+PASS: Selection Changed
 
+

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-to-select-text.html (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-to-select-text.html	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-to-select-text.html	2022-03-07 22:08:28 UTC (rev 290908)
@@ -3,6 +3,7 @@
 <html>
 <head>
     <script src=""
+    <script src=""
     <script>
         if (window.testRunner) {
             testRunner.dumpAsText();
@@ -15,26 +16,33 @@
                 return;
 
             var output = '';
-            var firstTargetRect = document.getElementById('firstSelection').getBoundingClientRect();
-            var secondTargetRect = document.getElementById('secondSelection').getBoundingClientRect();
-        
-            var pressPointX = firstTargetRect.x + firstTargetRect.width / 2;
-            var pressPointY = firstTargetRect.y + firstTargetRect.height / 2;
-            var dragX = secondTargetRect.x + secondTargetRect.width / 2;
-            var dragY = secondTargetRect.y + secondTargetRect.height / 2;
-        
-            await longPressAndHoldAtPoint(pressPointX, pressPointY);
-            if (document.getSelection().toString() == "magna")
-                output += 'PASS: Correct Selection';
+            var targetRect = document.getElementById('target').getBoundingClientRect();
+
+            var pressPointX = targetRect.x + targetRect.width / 2;
+            var pressPointY = targetRect.y + targetRect.height / 2;
+            
+            var fontHeight = 30;
+
+            var selectionChangedCount = 0;
+            var lastSelectionChangeCount = 0;
+            document.addEventListener("selectionchange", () => {
+                selectionChangedCount++;
+            });
+
+            await longPressAtPoint(pressPointX, pressPointY);
+            await UIHelper.waitForSelectionToAppear();
+            if (document.getSelection().toString() != "")
+                output += 'PASS: Has Selection';
             else
-                output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
+                output += 'FAIL: failed to select a word as a result of a long press.';
             output += '<br>';
 
-            var result = await continueTouchAndDragFromPointToPoint(pressPointX, pressPointY, dragX, dragY);
-            if (document.getSelection().toString() == "eiusmod tempor incididunt ut labore et dolore magna")
-                output += 'PASS: Correct Selection';
+            lastSelectionChangeCount = selectionChangedCount;
+            var result = await continueTouchAndDragFromPointToPoint(pressPointX, pressPointY, pressPointX, pressPointY + (fontHeight * 2));
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to reduce selection to a single character by dragging down. Incorrect Selection: ' + document.getSelection().toString();
+                output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
             output += '<br>';
             output += result;
             document.getElementById('target').innerHTML = output;
@@ -45,20 +53,26 @@
     </script>
     <style>
         #target {
-            height: 400px;
+            height: 50px;
             width: 300px;
             background-color: silver;
             font-family: monospace;
             font-size: 18px;
         }
+        #editable {
+            height: 300px;
+            width: 300px;
+            background-color: silver;
+            font-family: monospace;
+            font-size: 30px;
+        }
     </style>
-    <meta name="viewport" content="initial-scale=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
 </head>
 <body>
     <div id="target">
-        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut <span id="secondSelection">labore</span> et dolore <span id="firstSelection">magna</span> aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
-        
-        This test requires UIScriptController to run.
+        <p>Here's to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes.</p>
+        <p>This test requires UIScriptController to run.</p>
     </div>
 </body>
 </html>

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text-expected.txt (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text-expected.txt	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text-expected.txt	2022-03-07 22:08:28 UTC (rev 290908)
@@ -1,7 +1,5 @@
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
-PASS: Correct Selection
+PASS: Has Selection
+PASS: Selection Changed
+PASS: Selection Changed
+PASS: Selection Changed
 

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html	2022-03-07 22:08:28 UTC (rev 290908)
@@ -1,14 +1,14 @@
 <!DOCTYPE html>
-
 <html>
 <head>
     <script src=""
+    <script src=""
     <script>
         if (window.testRunner) {
             testRunner.dumpAsText();
             testRunner.waitUntilDone();
         }
-    
+
         async function runTest()
         {
             if (!testRunner.runUIScript)
@@ -15,60 +15,56 @@
                 return;
 
             var output = '';
-            var firstTargetRect = document.getElementById('firstSelection').getBoundingClientRect();
-            var secondTargetRect = document.getElementById('secondSelection').getBoundingClientRect();
-            var thirdTargetRect = document.getElementById('thirdSelection').getBoundingClientRect();
-        
-            var pressPointX = firstTargetRect.x+firstTargetRect.width / 2;
-            var pressPointY = firstTargetRect.y+firstTargetRect.height / 2;
-            var dragY = firstTargetRect.y;
-            var dragX = firstTargetRect.x;
-            var dragY2 = secondTargetRect.y;
-            var dragY3 = thirdTargetRect.y;
-            var dragY4 = firstTargetRect.y + firstTargetRect.height;
-        
+            var targetRect = document.getElementById('target').getBoundingClientRect();
+
+            var pressPointX = targetRect.x + targetRect.width / 2;
+            var pressPointY = targetRect.y + targetRect.height * .65;
+            
+            var fontHeight = 30;
+
+            var selectionChangedCount = 0;
+            document.addEventListener("selectionchange", () => {
+                selectionChangedCount++;
+            });
+
             await longPressAtPoint(pressPointX, pressPointY);
-            if (document.getSelection().toString() == "ut")
-                output += 'PASS: Correct Selection';
-            else
-                output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
 
-            await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY2);
-            if (document.getSelection().toString() == "o eiusmod tempor incididunt ut")
-                output += 'PASS: Correct Selection';
+            await UIHelper.waitForSelectionToAppear();
+
+            if (document.getSelection().toString() != "")
+                output += 'PASS: Has Selection';
             else
-                output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+                output += 'FAIL: failed to select a word as a result of a long press.';
             output += '<br>';
 
-            await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY3);
-            if (document.getSelection().toString() == " adipiscing elit, sed do eiusmod tempor incididunt ut")
-                output += 'PASS: Correct Selection';
+            lastSelectionChangeCount = selectionChangedCount;
+            var grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionStartGrabberViewRect());
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y , grabberMidpoint.x, grabberMidpoint.y - (fontHeight * 2));
+
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+                output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
 
-            await touchAndDragFromPointToPoint(dragX, dragY3, dragX, dragY2);
-            if (document.getSelection().toString() == "o eiusmod tempor incididunt ut")
-                output += 'PASS: Correct Selection';
+            lastSelectionChangeCount = selectionChangedCount;
+            grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionStartGrabberViewRect());
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y , grabberMidpoint.x, grabberMidpoint.y + (fontHeight * 3));
+            await liftUpAtPoint(grabberMidpoint.x, grabberMidpoint.y - (fontHeight * 3));
+
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+                output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
+            
+            lastSelectionChangeCount = selectionChangedCount;
+            grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionStartGrabberViewRect());
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y , grabberMidpoint.x, grabberMidpoint.y + (fontHeight * 2));
 
-            await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY);
-            if (document.getSelection().toString() == "ut")
-                output += 'PASS: Correct Selection';
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
+                output += 'FAIL: Selection changed <br>' + selectionChangedCount;
 
-            var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY4);
-            if (document.getSelection().toString() == "ut")
-                output += 'PASS: Correct Selection';
-            else
-                output += 'FAIL: failed to reduce selection to a single character by dragging down. Incorrect Selection: ' + document.getSelection().toString();
-            output += '<br>';
-            output += result;
             document.getElementById('target').innerHTML = output;
             testRunner.notifyDone();
         }
@@ -77,20 +73,27 @@
     </script>
     <style>
         #target {
-            height: 400px;
+            height: 50px;
             width: 300px;
             background-color: silver;
             font-family: monospace;
             font-size: 18px;
         }
+        #editable {
+            height: 300px;
+            width: 300px;
+            background-color: silver;
+            font-family: monospace;
+            font-size: 30px;
+        }
     </style>
-    <meta name="viewport" content="initial-scale=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
 </head>
 <body>
     <div id="target">
-        <p>Lorem ipsum dolor sit amet, consectetur<span id="thirdSelection"></span> adipiscing elit, sed d<span id="secondSelection"></span>o eiusmod tempor incididunt <span id="firstSelection">ut</span> labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
-        
-        This test requires UIScriptController to run.
+        <p>Here's to the crazy ones. The misfits. The rebels. The trouble makers. The round pegs in the square holes.</p>
+        <p>This test requires UIScriptController to run.</p>
     </div>
 </body>
 </html>
+

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/touch-event-radius-expected.txt (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/touch-event-radius-expected.txt	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/touch-event-radius-expected.txt	2022-03-07 22:08:28 UTC (rev 290908)
@@ -1,3 +1,3 @@
-PASS: radiusX is 56.8
-PASS: radiusY is 56.8
+PASS: radiusX is correct.
+PASS: radiusY is correct.
 

Modified: branches/safari-613-branch/LayoutTests/fast/events/touch/ios/touch-event-radius.html (290907 => 290908)


--- branches/safari-613-branch/LayoutTests/fast/events/touch/ios/touch-event-radius.html	2022-03-07 21:55:08 UTC (rev 290907)
+++ branches/safari-613-branch/LayoutTests/fast/events/touch/ios/touch-event-radius.html	2022-03-07 22:08:28 UTC (rev 290908)
@@ -63,16 +63,16 @@
             var forces = [];
             
             target.addEventListener('touchstart', function(event) {
-                var expected = Math.round(0.10 * 568 * 10) / 10;
+                var expected = Math.round(0.10 * window.screen.height * 10) / 10;
                 var radiusX = Math.round(event.touches[0].radiusX * 10) / 10;
                 if (radiusX == expected)
-                    output += 'PASS: radiusX is ' + expected + '<br>';
+                    output += 'PASS: radiusX is correct.<br>';
                 else
                     output += 'FAIL: radiusX should be ' + expected + ', was ' + radiusX + '<br>';
 
                 var radiusY = Math.round(event.touches[0].radiusY * 10) / 10;
                 if (radiusY == expected)
-                    output += 'PASS: radiusY is ' + expected + '<br>';
+                    output += 'PASS: radiusY is correct.<br>';
                 else
                     output += 'FAIL: radiusY should be ' + expected + ', was ' + radiusY + '<br>';
             });
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to