Title: [285549] trunk
Revision
285549
Author
megan_gard...@apple.com
Date
2021-11-09 17:17:01 -0800 (Tue, 09 Nov 2021)

Log Message

Turn on selection flipping by default.
https://bugs.webkit.org/show_bug.cgi?id=232853

Reviewed by Wenson Hsieh.

Source/WTF:

* Scripts/Preferences/WebPreferencesInternal.yaml:

LayoutTests:

* fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-right-to-change-selected-text.html:
* fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text-expected.txt:
* fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text.html:
* fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text-expected.txt:
* 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-right-to-change-selected-text.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (285548 => 285549)


--- trunk/LayoutTests/ChangeLog	2021-11-10 01:09:29 UTC (rev 285548)
+++ trunk/LayoutTests/ChangeLog	2021-11-10 01:17:01 UTC (rev 285549)
@@ -1,3 +1,17 @@
+2021-11-09  Megan Gardner  <megan_gard...@apple.com>
+
+        Turn on selection flipping by default.
+        https://bugs.webkit.org/show_bug.cgi?id=232853
+
+        Reviewed by Wenson Hsieh.
+
+        * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-right-to-change-selected-text.html:
+        * fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text-expected.txt:
+        * fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text.html:
+        * fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text-expected.txt:
+        * 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-right-to-change-selected-text.html:
+
 2021-11-09  Antoine Quint  <grao...@webkit.org>
 
         REGRESSION(r272201): Safari showed red distortion on webview after using Web Inspector, returning from another app

Modified: trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-right-to-change-selected-text.html (285548 => 285549)


--- trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-right-to-change-selected-text.html	2021-11-10 01:09:29 UTC (rev 285548)
+++ trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-right-to-change-selected-text.html	2021-11-10 01:17:01 UTC (rev 285549)
@@ -79,10 +79,10 @@
             output += '<br>';
 
             var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX4, dragY);
-            if (document.getSelection().toString() == "m")
+            if (document.getSelection().toString() == "lore ")
                 output += 'PASS: Correct Selection';
             else
-                output += 'FAIL: failed to reduce selection to a single character by dragging left. Incorrect Selection: ' + document.getSelection().toString();
+                output += 'FAIL: failed to flip selection by dragging left. Incorrect Selection: "' + document.getSelection().toString() + '"';
             output += '<br>';
             output += result;
 

Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text-expected.txt (285548 => 285549)


--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text-expected.txt	2021-11-10 01:09:29 UTC (rev 285548)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text-expected.txt	2021-11-10 01:17:01 UTC (rev 285549)
@@ -1,5 +1,5 @@
 PASS: Has Selection
 PASS: Selection Changed
 PASS: Selection Changed
-PASS: Selection Did Not Change
+PASS: Selection Changed
 

Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text.html (285548 => 285549)


--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text.html	2021-11-10 01:09:29 UTC (rev 285548)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text.html	2021-11-10 01:17:01 UTC (rev 285549)
@@ -23,6 +23,7 @@
             var fontHeight = 30;
 
             var selectionChangedCount = 0;
+            var lastSelectionChangeCount = 0;
             document.addEventListener("selectionchange", () => {
                 selectionChangedCount++;
             });
@@ -41,26 +42,28 @@
 
             await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y, grabberMidpoint.x, grabberMidpoint.y + (fontHeight * 2));
 
-            if (selectionChangedCount == 2)
+            if (selectionChangedCount > lastSelectionChangeCount)
                 output += 'PASS: Selection Changed </br>';
             else
                 output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
 
+            lastSelectionChangeCount = selectionChangedCount;
             grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionEndGrabberViewRect());
-            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y, grabberMidpoint.x, grabberMidpoint.y - (fontHeight * 2));
+            await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y, grabberMidpoint.x, grabberMidpoint.y - (fontHeight));
 
-            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.getSelectionEndGrabberViewRect());
             await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y, grabberMidpoint.x, grabberMidpoint.y - (fontHeight * 4));
 
-            if (selectionChangedCount == 3)
-                output += 'PASS: Selection Did Not Change </br>';
+            if (selectionChangedCount > lastSelectionChangeCount)
+                output += 'PASS: Selection Changed </br>';
             else
-                output += 'FAIL: Selection changed <br>' + selectionChangedCount;
+                output += 'FAIL: Selection did not change <br>' + selectionChangedCount;
 
             var editableElement = document.getElementById('editable');
             editableElement.parentNode.removeChild(editableElement);

Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text-expected.txt (285548 => 285549)


--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text-expected.txt	2021-11-10 01:09:29 UTC (rev 285548)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text-expected.txt	2021-11-10 01:17:01 UTC (rev 285549)
@@ -1,5 +1,5 @@
 PASS: Has Selection
 PASS: Selection Changed
 PASS: Selection Changed
-PASS: Selection Did Not Change
+PASS: Selection Changed
 

Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html (285548 => 285549)


--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html	2021-11-10 01:09:29 UTC (rev 285548)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html	2021-11-10 01:17:01 UTC (rev 285549)
@@ -57,8 +57,8 @@
             grabberMidpoint = UIHelper.midPointOfRect(await UIHelper.getSelectionStartGrabberViewRect());
             await touchAndDragFromPointToPoint(grabberMidpoint.x, grabberMidpoint.y , grabberMidpoint.x, grabberMidpoint.y + (fontHeight * 2));
 
-            if (selectionChangedCount == 5)
-                output += 'PASS: Selection Did Not Change </br>';
+            if (selectionChangedCount == 7)
+                output += 'PASS: Selection Changed </br>';
             else
                 output += 'FAIL: Selection changed <br>' + selectionChangedCount;
 

Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html (285548 => 285549)


--- trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html	2021-11-10 01:09:29 UTC (rev 285548)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html	2021-11-10 01:17:01 UTC (rev 285549)
@@ -63,10 +63,10 @@
             output += '<br>';
 
             var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX4, dragY);
-            if (document.getSelection().toString() == "m")
+            if (document.getSelection().toString() == "lore ")
                 output += 'PASS: Correct Selection';
             else
-                output += 'FAIL: failed to reduce selection to a single character by dragging left. Incorrect Selection: ' + document.getSelection().toString();
+                output += 'FAIL: failed to flip selection by dragging left. Incorrect Selection: ' + document.getSelection().toString();
             output += '<br>';
             output += result;
             document.getElementById('target').innerHTML = output;

Modified: trunk/Source/WTF/ChangeLog (285548 => 285549)


--- trunk/Source/WTF/ChangeLog	2021-11-10 01:09:29 UTC (rev 285548)
+++ trunk/Source/WTF/ChangeLog	2021-11-10 01:17:01 UTC (rev 285549)
@@ -1,3 +1,12 @@
+2021-11-09  Megan Gardner  <megan_gard...@apple.com>
+
+        Turn on selection flipping by default.
+        https://bugs.webkit.org/show_bug.cgi?id=232853
+
+        Reviewed by Wenson Hsieh.
+
+        * Scripts/Preferences/WebPreferencesInternal.yaml:
+
 2021-11-09  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, reverting r285536.

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml (285548 => 285549)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2021-11-10 01:09:29 UTC (rev 285548)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2021-11-10 01:17:01 UTC (rev 285549)
@@ -703,7 +703,7 @@
   webcoreBinding: none
   defaultValue:
     WebKit:
-      default: false
+      default: true
 
 # FIXME: This is not implemented for WebKitLegacy, so should be excluded from WebKitLegacy entirely.
 ServiceWorkersEnabled:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to