Title: [248069] branches/safari-608-branch
Revision
248069
Author
[email protected]
Date
2019-07-31 13:56:49 -0700 (Wed, 31 Jul 2019)

Log Message

Cherry-pick r248037. rdar://problem/53764079

    AX: Re-enable accessibility/set-selected-text-range-after-newline.html test.
    https://bugs.webkit.org/show_bug.cgi?id=199431
    <rdar://problem/52563340>

    Patch by Andres Gonzalez <[email protected]> on 2019-07-31
    Reviewed by Chris Fleizach.

    Source/WebCore:

    - Re-enabled LayoutTests/accessibility/set-selected-text-range-after-newline.html.
    - Put back workaround in visiblePositionForIndexUsingCharacterIterator
    that is needed for several accessibility issues.
    - This workaround was rolled back because it was thought the cause of:
    https://bugs.webkit.org/show_bug.cgi?id=199434
    It turned out that the actual cause of that hang was unrelated and was
    fixed in:
    https://bugs.webkit.org/show_bug.cgi?id=199845

    * editing/Editing.cpp:
    (WebCore::visiblePositionForIndexUsingCharacterIterator):

    LayoutTests:

    * TestExpectations:
    * accessibility/ios-simulator/set-selected-text-range-after-newline.html: Removed because it was the same as the one in the parent accessibility directory, so enabling it for iOS in ios-wk2/TestExpectations.
    * platform/ios-wk2/TestExpectations:

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

Modified Paths

Removed Paths

Diff

Modified: branches/safari-608-branch/LayoutTests/ChangeLog (248068 => 248069)


--- branches/safari-608-branch/LayoutTests/ChangeLog	2019-07-31 20:56:46 UTC (rev 248068)
+++ branches/safari-608-branch/LayoutTests/ChangeLog	2019-07-31 20:56:49 UTC (rev 248069)
@@ -1,5 +1,50 @@
 2019-07-31  Alan Coon  <[email protected]>
 
+        Cherry-pick r248037. rdar://problem/53764079
+
+    AX: Re-enable accessibility/set-selected-text-range-after-newline.html test.
+    https://bugs.webkit.org/show_bug.cgi?id=199431
+    <rdar://problem/52563340>
+    
+    Patch by Andres Gonzalez <[email protected]> on 2019-07-31
+    Reviewed by Chris Fleizach.
+    
+    Source/WebCore:
+    
+    - Re-enabled LayoutTests/accessibility/set-selected-text-range-after-newline.html.
+    - Put back workaround in visiblePositionForIndexUsingCharacterIterator
+    that is needed for several accessibility issues.
+    - This workaround was rolled back because it was thought the cause of:
+    https://bugs.webkit.org/show_bug.cgi?id=199434
+    It turned out that the actual cause of that hang was unrelated and was
+    fixed in:
+    https://bugs.webkit.org/show_bug.cgi?id=199845
+    
+    * editing/Editing.cpp:
+    (WebCore::visiblePositionForIndexUsingCharacterIterator):
+    
+    LayoutTests:
+    
+    * TestExpectations:
+    * accessibility/ios-simulator/set-selected-text-range-after-newline.html: Removed because it was the same as the one in the parent accessibility directory, so enabling it for iOS in ios-wk2/TestExpectations.
+    * platform/ios-wk2/TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-31  Andres Gonzalez  <[email protected]>
+
+            AX: Re-enable accessibility/set-selected-text-range-after-newline.html test.
+            https://bugs.webkit.org/show_bug.cgi?id=199431
+            <rdar://problem/52563340>
+
+            Reviewed by Chris Fleizach.
+
+            * TestExpectations:
+            * accessibility/ios-simulator/set-selected-text-range-after-newline.html: Removed because it was the same as the one in the parent accessibility directory, so enabling it for iOS in ios-wk2/TestExpectations.
+            * platform/ios-wk2/TestExpectations:
+
+2019-07-31  Alan Coon  <[email protected]>
+
         Cherry-pick r248015. rdar://problem/53764191
 
     Can't scroll on yummly.co.uk recipe (scale(0) div covers the content and hit-tests)

Modified: branches/safari-608-branch/LayoutTests/TestExpectations (248068 => 248069)


--- branches/safari-608-branch/LayoutTests/TestExpectations	2019-07-31 20:56:46 UTC (rev 248068)
+++ branches/safari-608-branch/LayoutTests/TestExpectations	2019-07-31 20:56:49 UTC (rev 248069)
@@ -2207,7 +2207,6 @@
 ########################################
 ### START OF -disabled tests
 
-webkit.org/b/199431 accessibility/set-selected-text-range-after-newline.html [ Skip ]
 webkit.org/b/20871 js/garbage-collect-after-string-appends.html [ Skip ]
 webkit.org/b/58323 compositing/objects/composited-object-alignment.html [ Skip ]
 webkit.org/b/48454 compositing/tiling/huge-layer-resize.html [ Skip ]

Deleted: branches/safari-608-branch/LayoutTests/accessibility/ios-simulator/set-selected-text-range-after-newline.html (248068 => 248069)


--- branches/safari-608-branch/LayoutTests/accessibility/ios-simulator/set-selected-text-range-after-newline.html	2019-07-31 20:56:46 UTC (rev 248068)
+++ branches/safari-608-branch/LayoutTests/accessibility/ios-simulator/set-selected-text-range-after-newline.html	2019-07-31 20:56:49 UTC (rev 248069)
@@ -1,40 +0,0 @@
-<html>
-<head>
-<script src=""
-</head>
-<body>
-
-<div id="content" contenteditable tabindex="0">helloworld</div>
-
-<div id="console"></div>
-
-<script>
-    if (window.accessibilityController) {
-        window.jsTestIsAsync = true;
-
-        var content = document.getElementById("content");
-        content.focus();
-
-        var text = accessibilityController.focusedElement;
-        text.setSelectedTextRange(5, 0);
-        shouldBecomeEqual("text.selectedTextRange", "'{5, 0}'", function() {
-            text.replaceTextInRange("\n", 5, 0);
-
-            var t = text.stringForRange(0, 11);
-            t = t.replace(/(?:\r\n|\r|\n)/g, '[newline]');
-            debug("There must be only one [newline] between hello and world: " + t);
-
-            text.setSelectedTextRange(6, 0);
-            shouldBecomeEqual("text.selectedTextRange", "'{6, 0}'", function() {
-                var t = text.stringForRange(6, 5);
-                t = t.replace(/(?:\r\n|\r|\n)/g, '[newline]');
-                debug("The text after the newline should be world: " + t);
-
-                finishJSTest();
-            });
-        });
-    }
-</script>
-<script src=""
-</body>
-</html>

Modified: branches/safari-608-branch/LayoutTests/platform/ios-wk2/TestExpectations (248068 => 248069)


--- branches/safari-608-branch/LayoutTests/platform/ios-wk2/TestExpectations	2019-07-31 20:56:46 UTC (rev 248068)
+++ branches/safari-608-branch/LayoutTests/platform/ios-wk2/TestExpectations	2019-07-31 20:56:49 UTC (rev 248069)
@@ -24,6 +24,7 @@
 editing/pasteboard/ios [ Pass ]
 editing/undo-manager [ Pass ]
 
+accessibility/set-selected-text-range-after-newline.html [ Pass ]
 accessibility/smart-invert.html [ Pass ]
 accessibility/smart-invert-reference.html [ Pass ]
 fast/media/mq-inverted-colors-live-update.html [ Pass ]
@@ -996,7 +997,6 @@
 fast/forms/input-appearance-spinbutton.html [ Failure ]
 fast/replaced/border-radius-clip.html [ Failure ]
 accessibility/ios-simulator/press-fires-touch-events.html [ Skip ]
-webkit.org/b/199431 accessibility/ios-simulator/set-selected-text-range-after-newline.html [ Skip ]
 
 fast/text/combining-character-sequence-vertical.html [ ImageOnlyFailure ]
 fast/text/vertical-quotation-marks.html [ ImageOnlyFailure ]

Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (248068 => 248069)


--- branches/safari-608-branch/Source/WebCore/ChangeLog	2019-07-31 20:56:46 UTC (rev 248068)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog	2019-07-31 20:56:49 UTC (rev 248069)
@@ -1,5 +1,58 @@
 2019-07-31  Alan Coon  <[email protected]>
 
+        Cherry-pick r248037. rdar://problem/53764079
+
+    AX: Re-enable accessibility/set-selected-text-range-after-newline.html test.
+    https://bugs.webkit.org/show_bug.cgi?id=199431
+    <rdar://problem/52563340>
+    
+    Patch by Andres Gonzalez <[email protected]> on 2019-07-31
+    Reviewed by Chris Fleizach.
+    
+    Source/WebCore:
+    
+    - Re-enabled LayoutTests/accessibility/set-selected-text-range-after-newline.html.
+    - Put back workaround in visiblePositionForIndexUsingCharacterIterator
+    that is needed for several accessibility issues.
+    - This workaround was rolled back because it was thought the cause of:
+    https://bugs.webkit.org/show_bug.cgi?id=199434
+    It turned out that the actual cause of that hang was unrelated and was
+    fixed in:
+    https://bugs.webkit.org/show_bug.cgi?id=199845
+    
+    * editing/Editing.cpp:
+    (WebCore::visiblePositionForIndexUsingCharacterIterator):
+    
+    LayoutTests:
+    
+    * TestExpectations:
+    * accessibility/ios-simulator/set-selected-text-range-after-newline.html: Removed because it was the same as the one in the parent accessibility directory, so enabling it for iOS in ios-wk2/TestExpectations.
+    * platform/ios-wk2/TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-31  Andres Gonzalez  <[email protected]>
+
+            AX: Re-enable accessibility/set-selected-text-range-after-newline.html test.
+            https://bugs.webkit.org/show_bug.cgi?id=199431
+            <rdar://problem/52563340>
+
+            Reviewed by Chris Fleizach.
+
+            - Re-enabled LayoutTests/accessibility/set-selected-text-range-after-newline.html.
+            - Put back workaround in visiblePositionForIndexUsingCharacterIterator
+            that is needed for several accessibility issues.
+            - This workaround was rolled back because it was thought the cause of:
+            https://bugs.webkit.org/show_bug.cgi?id=199434
+            It turned out that the actual cause of that hang was unrelated and was
+            fixed in:
+            https://bugs.webkit.org/show_bug.cgi?id=199845
+
+            * editing/Editing.cpp:
+            (WebCore::visiblePositionForIndexUsingCharacterIterator):
+
+2019-07-31  Alan Coon  <[email protected]>
+
         Cherry-pick r248024. rdar://problem/53764047
 
     WorkerGlobalScope::wrapCryptoKey/unwrapCryptoKey should use local heap objects for replies

Modified: branches/safari-608-branch/Source/WebCore/editing/Editing.cpp (248068 => 248069)


--- branches/safari-608-branch/Source/WebCore/editing/Editing.cpp	2019-07-31 20:56:46 UTC (rev 248068)
+++ branches/safari-608-branch/Source/WebCore/editing/Editing.cpp	2019-07-31 20:56:49 UTC (rev 248069)
@@ -1122,6 +1122,16 @@
     CharacterIterator it(range.get());
     it.advance(index - 1);
 
+    if (!it.atEnd() && it.text()[0] == '\n') {
+        // FIXME: workaround for collapsed range (where only start position is correct) emitted for some emitted newlines.
+        auto iteratorRange = it.range();
+        if (iteratorRange->startPosition() == iteratorRange->endPosition()) {
+            it.advance(1);
+            if (!it.atEnd())
+                return VisiblePosition(it.range()->startPosition());
+        }
+    }
+
     return { it.atEnd() ? range->endPosition() : it.range()->endPosition(), UPSTREAM };
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to