Title: [250449] branches/safari-608-branch
Revision
250449
Author
[email protected]
Date
2019-09-27 13:25:43 -0700 (Fri, 27 Sep 2019)

Log Message

Cherry-pick r250365. rdar://problem/55770710

    Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
    https://bugs.webkit.org/show_bug.cgi?id=202125

    Reviewed by Tim Horton.

    Source/WebCore:

    Test: editing/selection/ios/update-selection-after-iframe-scroll.html

    When we end scrolling, make sure that iframes get a final update to ensure that the
    selection is in the correct position. Pipe that to WebKit/UIProcess via
    frame specific plath.

    * loader/EmptyClients.cpp:
    * page/EditorClient.h:
    * page/scrolling/AsyncScrollingCoordinator.cpp:
    (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):

    Source/WebKit:

    Add additional calls into UIKit differentiate between main frame scrolling and overflow/iframe scrolling.
    Add piping for iframe specific scrolling.

    * Platform/spi/ios/UIKitSPI.h:
    * UIProcess/ios/WKContentViewInteraction.mm:
    (-[WKContentView _willStartScrollingOrZooming]):
    (-[WKContentView _didEndScrollingOrZooming]):
    * WebProcess/WebCoreSupport/WebEditorClient.cpp:
    (WebKit::WebEditorClient::subFrameScrollPositionChanged):
    * WebProcess/WebCoreSupport/WebEditorClient.h:
    * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
    (WebKit::WebEditorClient::subFrameScrollPositionChanged):

    Source/WebKitLegacy/mac:

    Filling out unused functions needed for new fix.

    * WebCoreSupport/WebEditorClient.h:

    LayoutTests:

    Test that an iframe selection is updated after a scroll is completed.

    * editing/selection/ios/update-selection-after-iframe-scroll-expected.txt: Added.
    * editing/selection/ios/update-selection-after-iframe-scroll.html: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-608-branch/LayoutTests/ChangeLog (250448 => 250449)


--- branches/safari-608-branch/LayoutTests/ChangeLog	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/LayoutTests/ChangeLog	2019-09-27 20:25:43 UTC (rev 250449)
@@ -1,5 +1,70 @@
 2019-09-27  Alan Coon  <[email protected]>
 
+        Cherry-pick r250365. rdar://problem/55770710
+
+    Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
+    https://bugs.webkit.org/show_bug.cgi?id=202125
+    
+    Reviewed by Tim Horton.
+    
+    Source/WebCore:
+    
+    Test: editing/selection/ios/update-selection-after-iframe-scroll.html
+    
+    When we end scrolling, make sure that iframes get a final update to ensure that the
+    selection is in the correct position. Pipe that to WebKit/UIProcess via
+    frame specific plath.
+    
+    * loader/EmptyClients.cpp:
+    * page/EditorClient.h:
+    * page/scrolling/AsyncScrollingCoordinator.cpp:
+    (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+    
+    Source/WebKit:
+    
+    Add additional calls into UIKit differentiate between main frame scrolling and overflow/iframe scrolling.
+    Add piping for iframe specific scrolling.
+    
+    * Platform/spi/ios/UIKitSPI.h:
+    * UIProcess/ios/WKContentViewInteraction.mm:
+    (-[WKContentView _willStartScrollingOrZooming]):
+    (-[WKContentView _didEndScrollingOrZooming]):
+    * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+    (WebKit::WebEditorClient::subFrameScrollPositionChanged):
+    * WebProcess/WebCoreSupport/WebEditorClient.h:
+    * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
+    (WebKit::WebEditorClient::subFrameScrollPositionChanged):
+    
+    Source/WebKitLegacy/mac:
+    
+    Filling out unused functions needed for new fix.
+    
+    * WebCoreSupport/WebEditorClient.h:
+    
+    LayoutTests:
+    
+    Test that an iframe selection is updated after a scroll is completed.
+    
+    * editing/selection/ios/update-selection-after-iframe-scroll-expected.txt: Added.
+    * editing/selection/ios/update-selection-after-iframe-scroll.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-09-25  Megan Gardner  <[email protected]>
+
+            Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
+            https://bugs.webkit.org/show_bug.cgi?id=202125
+
+            Reviewed by Tim Horton.
+
+            Test that an iframe selection is updated after a scroll is completed.
+
+            * editing/selection/ios/update-selection-after-iframe-scroll-expected.txt: Added.
+            * editing/selection/ios/update-selection-after-iframe-scroll.html: Added.
+
+2019-09-27  Alan Coon  <[email protected]>
+
         Cherry-pick r250361. rdar://problem/55770728
 
     Page temporarily jumps to an excessively small viewport scale while loading usatoday.com

Added: branches/safari-608-branch/LayoutTests/editing/selection/ios/update-selection-after-iframe-scroll-expected.txt (0 => 250449)


--- branches/safari-608-branch/LayoutTests/editing/selection/ios/update-selection-after-iframe-scroll-expected.txt	                        (rev 0)
+++ branches/safari-608-branch/LayoutTests/editing/selection/ios/update-selection-after-iframe-scroll-expected.txt	2019-09-27 20:25:43 UTC (rev 250449)
@@ -0,0 +1,23 @@
+PASS selectionRectsBefore[0].top is 74
+PASS selectionRectsBefore[0].width is 184
+PASS selectionRectsBefore[0].left is 10
+PASS selectionRectsBefore[0].height is 19
+PASS selectionRectsBefore[1].top is 93
+PASS selectionRectsBefore[1].width is 167
+PASS selectionRectsBefore[1].left is 10
+PASS selectionRectsBefore[1].height is 20
+PASS selectionRectsAfter[0].top is 24
+PASS selectionRectsAfter[0].width is 184
+PASS selectionRectsAfter[0].left is 10
+PASS selectionRectsAfter[0].height is 19
+PASS selectionRectsAfter[1].top is 43
+PASS selectionRectsAfter[1].width is 167
+PASS selectionRectsAfter[1].left is 10
+PASS selectionRectsAfter[1].height is 20
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+This test verifies that a selection in an iframe area is kept up to date after scrolling. To test manually, tap the frame and scroll the editable area down; the selection move to account for the new scroll position.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

Added: branches/safari-608-branch/LayoutTests/editing/selection/ios/update-selection-after-iframe-scroll.html (0 => 250449)


--- branches/safari-608-branch/LayoutTests/editing/selection/ios/update-selection-after-iframe-scroll.html	                        (rev 0)
+++ branches/safari-608-branch/LayoutTests/editing/selection/ios/update-selection-after-iframe-scroll.html	2019-09-27 20:25:43 UTC (rev 250449)
@@ -0,0 +1,104 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true internal:AsyncFrameScrollingEnabled=true ] -->
+<html>
+<head>
+<script src=""
+<script src=''></script>
+<script src=''></script>
+<meta name=viewport content='width=device-width'>
+<style>
+body, html {
+    width: 100%;
+    height: 100%;
+    margin: 0;
+}
+
+#target {
+    width: 320px;
+    height: 160px;
+}
+</style>
+<script>
+
+jsTestIsAsync = true;
+function rectsAreEqual(rects, otherRects)
+{
+    if (rects.length != otherRects.length)
+        return false;
+
+    for (let i = 0; i < rects.length; ++i) {
+        if (rects[i].top != otherRects[i].top
+            || rects[i].left != otherRects[i].left
+            || rects[i].width != otherRects[i].width
+            || rects[i].height != otherRects[i].height)
+            return false;
+    }
+
+    return true;
+}
+
+async function waitForSelectionRectsToChange(fromRects)
+{
+    let rects = fromRects;
+    while (rectsAreEqual(rects, fromRects))
+        rects = await UIHelper.getUISelectionViewRects();
+    return rects;
+}
+
+addEventListener('load', async function() {
+    description('This test verifies that a selection in an iframe area is kept up to date after scrolling. To test manually, tap the frame and scroll the editable area down; the selection move to account for the new scroll position.');
+
+    const iframe = document.getElementById('scrollingiframe');
+
+    await UIHelper.activateElementAndWaitForInputSession(iframe);
+    selectionRectsBefore = await waitForSelectionRectsToChange([]);
+
+    await UIHelper.immediateScrollElementAtContentPointToOffset(100, 400, 0, 50);
+    selectionRectsAfter = await waitForSelectionRectsToChange(selectionRectsBefore);
+
+    shouldBe('selectionRectsBefore[0].top', '74');
+    shouldBe('selectionRectsBefore[0].width', '184');
+    shouldBe('selectionRectsBefore[0].left', '10');
+    shouldBe('selectionRectsBefore[0].height', '19');
+    shouldBe('selectionRectsBefore[1].top', '93');
+    shouldBe('selectionRectsBefore[1].width', '167');
+    shouldBe('selectionRectsBefore[1].left', '10');
+    shouldBe('selectionRectsBefore[1].height', '20');
+
+    shouldBe('selectionRectsAfter[0].top', '24');
+    shouldBe('selectionRectsAfter[0].width', '184');
+    shouldBe('selectionRectsAfter[0].left', '10');
+    shouldBe('selectionRectsAfter[0].height', '19');
+    shouldBe('selectionRectsAfter[1].top', '43');
+    shouldBe('selectionRectsAfter[1].width', '167');
+    shouldBe('selectionRectsAfter[1].left', '10');
+    shouldBe('selectionRectsAfter[1].height', '20');
+
+    finishJSTest();
+});
+</script>
+</head>
+
+<body>
+<iframe width="200" height="500" scrolling="yes" srcdoc="
+    <div id='editor' contenteditable>
+        <p>The quick brown fox jumped over the lazy dog.</p>
+        <p id='select-target'>The quick brown fox jumped over the lazy dog.</p>
+        <p>The quick brown fox jumped over the lazy dog.</p>
+        <p>The quick brown fox jumped over the lazy dog.</p>
+        <p>The quick brown fox jumped over the lazy dog.</p>
+        <p>The quick brown fox jumped over the lazy dog.</p>
+        <p>The quick brown fox jumped over the lazy dog.</p>
+        <p>The quick brown fox jumped over the lazy dog.</p>
+        <p>The quick brown fox jumped over the lazy dog.</p>
+    </div>
+    <script>
+        addEventListener('click', event => {
+        getSelection().selectAllChildren(document.getElementById('select-target'));
+        event.preventDefault();
+    });
+    </script>
+        " id="scrollingiframe"></iframe>
+<div id="description"></div>
+
+</body>
+</html>
\ No newline at end of file

Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (250448 => 250449)


--- branches/safari-608-branch/Source/WebCore/ChangeLog	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog	2019-09-27 20:25:43 UTC (rev 250449)
@@ -1,5 +1,76 @@
 2019-09-27  Alan Coon  <[email protected]>
 
+        Cherry-pick r250365. rdar://problem/55770710
+
+    Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
+    https://bugs.webkit.org/show_bug.cgi?id=202125
+    
+    Reviewed by Tim Horton.
+    
+    Source/WebCore:
+    
+    Test: editing/selection/ios/update-selection-after-iframe-scroll.html
+    
+    When we end scrolling, make sure that iframes get a final update to ensure that the
+    selection is in the correct position. Pipe that to WebKit/UIProcess via
+    frame specific plath.
+    
+    * loader/EmptyClients.cpp:
+    * page/EditorClient.h:
+    * page/scrolling/AsyncScrollingCoordinator.cpp:
+    (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+    
+    Source/WebKit:
+    
+    Add additional calls into UIKit differentiate between main frame scrolling and overflow/iframe scrolling.
+    Add piping for iframe specific scrolling.
+    
+    * Platform/spi/ios/UIKitSPI.h:
+    * UIProcess/ios/WKContentViewInteraction.mm:
+    (-[WKContentView _willStartScrollingOrZooming]):
+    (-[WKContentView _didEndScrollingOrZooming]):
+    * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+    (WebKit::WebEditorClient::subFrameScrollPositionChanged):
+    * WebProcess/WebCoreSupport/WebEditorClient.h:
+    * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
+    (WebKit::WebEditorClient::subFrameScrollPositionChanged):
+    
+    Source/WebKitLegacy/mac:
+    
+    Filling out unused functions needed for new fix.
+    
+    * WebCoreSupport/WebEditorClient.h:
+    
+    LayoutTests:
+    
+    Test that an iframe selection is updated after a scroll is completed.
+    
+    * editing/selection/ios/update-selection-after-iframe-scroll-expected.txt: Added.
+    * editing/selection/ios/update-selection-after-iframe-scroll.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-09-25  Megan Gardner  <[email protected]>
+
+            Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
+            https://bugs.webkit.org/show_bug.cgi?id=202125
+
+            Reviewed by Tim Horton.
+
+            Test: editing/selection/ios/update-selection-after-iframe-scroll.html
+
+            When we end scrolling, make sure that iframes get a final update to ensure that the
+            selection is in the correct position. Pipe that to WebKit/UIProcess via
+            frame specific plath.
+
+            * loader/EmptyClients.cpp:
+            * page/EditorClient.h:
+            * page/scrolling/AsyncScrollingCoordinator.cpp:
+            (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+
+2019-09-27  Alan Coon  <[email protected]>
+
         Cherry-pick r250361. rdar://problem/55770728
 
     Page temporarily jumps to an excessively small viewport scale while loading usatoday.com

Modified: branches/safari-608-branch/Source/WebCore/loader/EmptyClients.cpp (250448 => 250449)


--- branches/safari-608-branch/Source/WebCore/loader/EmptyClients.cpp	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/Source/WebCore/loader/EmptyClients.cpp	2019-09-27 20:25:43 UTC (rev 250449)
@@ -215,6 +215,7 @@
     void textWillBeDeletedInTextField(Element*) final { }
     void textDidChangeInTextArea(Element*) final { }
     void overflowScrollPositionChanged() final { }
+    void subFrameScrollPositionChanged() final { }
 
 #if PLATFORM(IOS_FAMILY)
     void startDelayingAndCoalescingContentChangeNotifications() final { }

Modified: branches/safari-608-branch/Source/WebCore/page/EditorClient.h (250448 => 250449)


--- branches/safari-608-branch/Source/WebCore/page/EditorClient.h	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/Source/WebCore/page/EditorClient.h	2019-09-27 20:25:43 UTC (rev 250449)
@@ -129,6 +129,7 @@
     virtual void textWillBeDeletedInTextField(Element*) = 0;
     virtual void textDidChangeInTextArea(Element*) = 0;
     virtual void overflowScrollPositionChanged() = 0;
+    virtual void subFrameScrollPositionChanged() = 0;
 
 #if PLATFORM(IOS_FAMILY)
     virtual void startDelayingAndCoalescingContentChangeNotifications() = 0;

Modified: branches/safari-608-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (250448 => 250449)


--- branches/safari-608-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2019-09-27 20:25:43 UTC (rev 250449)
@@ -342,6 +342,11 @@
     LOG_WITH_STREAM(Scrolling, stream << "AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll node " << scrollingNodeID << " scrollPosition " << scrollPosition << " action " << scrollingLayerPositionAction);
 
     auto& frameView = *frameViewPtr;
+    
+    if (!frameViewPtr->frame().isMainFrame()) {
+        if (scrollingLayerPositionAction == ScrollingLayerPositionAction::Set)
+            m_page->editorClient().subFrameScrollPositionChanged();
+    }
 
     if (scrollingNodeID == frameView.scrollingNodeID()) {
         reconcileScrollingState(frameView, scrollPosition, layoutViewportOrigin, scrollType, ViewportRectStability::Stable, scrollingLayerPositionAction);

Modified: branches/safari-608-branch/Source/WebKit/ChangeLog (250448 => 250449)


--- branches/safari-608-branch/Source/WebKit/ChangeLog	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/Source/WebKit/ChangeLog	2019-09-27 20:25:43 UTC (rev 250449)
@@ -1,5 +1,78 @@
 2019-09-27  Alan Coon  <[email protected]>
 
+        Cherry-pick r250365. rdar://problem/55770710
+
+    Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
+    https://bugs.webkit.org/show_bug.cgi?id=202125
+    
+    Reviewed by Tim Horton.
+    
+    Source/WebCore:
+    
+    Test: editing/selection/ios/update-selection-after-iframe-scroll.html
+    
+    When we end scrolling, make sure that iframes get a final update to ensure that the
+    selection is in the correct position. Pipe that to WebKit/UIProcess via
+    frame specific plath.
+    
+    * loader/EmptyClients.cpp:
+    * page/EditorClient.h:
+    * page/scrolling/AsyncScrollingCoordinator.cpp:
+    (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+    
+    Source/WebKit:
+    
+    Add additional calls into UIKit differentiate between main frame scrolling and overflow/iframe scrolling.
+    Add piping for iframe specific scrolling.
+    
+    * Platform/spi/ios/UIKitSPI.h:
+    * UIProcess/ios/WKContentViewInteraction.mm:
+    (-[WKContentView _willStartScrollingOrZooming]):
+    (-[WKContentView _didEndScrollingOrZooming]):
+    * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+    (WebKit::WebEditorClient::subFrameScrollPositionChanged):
+    * WebProcess/WebCoreSupport/WebEditorClient.h:
+    * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
+    (WebKit::WebEditorClient::subFrameScrollPositionChanged):
+    
+    Source/WebKitLegacy/mac:
+    
+    Filling out unused functions needed for new fix.
+    
+    * WebCoreSupport/WebEditorClient.h:
+    
+    LayoutTests:
+    
+    Test that an iframe selection is updated after a scroll is completed.
+    
+    * editing/selection/ios/update-selection-after-iframe-scroll-expected.txt: Added.
+    * editing/selection/ios/update-selection-after-iframe-scroll.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-09-25  Megan Gardner  <[email protected]>
+
+            Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
+            https://bugs.webkit.org/show_bug.cgi?id=202125
+
+            Reviewed by Tim Horton.
+
+            Add additional calls into UIKit differentiate between main frame scrolling and overflow/iframe scrolling.
+            Add piping for iframe specific scrolling.
+
+            * Platform/spi/ios/UIKitSPI.h:
+            * UIProcess/ios/WKContentViewInteraction.mm:
+            (-[WKContentView _willStartScrollingOrZooming]):
+            (-[WKContentView _didEndScrollingOrZooming]):
+            * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+            (WebKit::WebEditorClient::subFrameScrollPositionChanged):
+            * WebProcess/WebCoreSupport/WebEditorClient.h:
+            * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
+            (WebKit::WebEditorClient::subFrameScrollPositionChanged):
+
+2019-09-27  Alan Coon  <[email protected]>
+
         Cherry-pick r250361. rdar://problem/55770728
 
     Page temporarily jumps to an excessively small viewport scale while loading usatoday.com

Modified: branches/safari-608-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h (250448 => 250449)


--- branches/safari-608-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2019-09-27 20:25:43 UTC (rev 250449)
@@ -1085,6 +1085,11 @@
 
 #endif // USE(APPLE_INTERNAL_SDK)
 
+@interface UITextInteractionAssistant (Staging_55645619)
+- (void)didEndScrollingOrZooming;
+- (void)willStartScrollingOrZooming;
+@end
+
 @interface UIGestureRecognizer (Staging_45970040)
 @property (nonatomic, readonly, getter=_modifierFlags) UIKeyModifierFlags modifierFlags;
 @end

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (250448 => 250449)


--- branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-09-27 20:25:43 UTC (rev 250449)
@@ -2710,7 +2710,10 @@
 
 - (void)_willStartScrollingOrZooming
 {
-    [_textSelectionAssistant willStartScrollingOverflow];
+    if ([_textSelectionAssistant respondsToSelector:@selector(willStartScrollingOrZooming)])
+        [_textSelectionAssistant willStartScrollingOrZooming];
+    else
+        [_textSelectionAssistant willStartScrollingOverflow];
     _page->setIsScrollingOrZooming(true);
 
 #if PLATFORM(WATCHOS)
@@ -2730,7 +2733,10 @@
 - (void)_didEndScrollingOrZooming
 {
     if (!_needsDeferredEndScrollingSelectionUpdate) {
-        [_textSelectionAssistant didEndScrollingOverflow];
+        if ([_textSelectionAssistant respondsToSelector:@selector(didEndScrollingOrZooming)])
+            [_textSelectionAssistant didEndScrollingOrZooming];
+        else
+            [_textSelectionAssistant didEndScrollingOverflow];
     }
     _page->setIsScrollingOrZooming(false);
 

Modified: branches/safari-608-branch/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp (250448 => 250449)


--- branches/safari-608-branch/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp	2019-09-27 20:25:43 UTC (rev 250449)
@@ -424,6 +424,11 @@
 {
     notImplemented();
 }
+
+void WebEditorClient::subFrameScrollPositionChanged()
+{
+    notImplemented();
+}
 #endif
 
 static bool getActionTypeForKeyEvent(KeyboardEvent* event, WKInputFieldActionType& type)

Modified: branches/safari-608-branch/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h (250448 => 250449)


--- branches/safari-608-branch/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h	2019-09-27 20:25:43 UTC (rev 250449)
@@ -112,6 +112,7 @@
     void textWillBeDeletedInTextField(WebCore::Element*) final;
     void textDidChangeInTextArea(WebCore::Element*) final;
     void overflowScrollPositionChanged() final;
+    void subFrameScrollPositionChanged() final;
 
 #if PLATFORM(COCOA)
     void setInsertionPasteboard(const String& pasteboardName) final;

Modified: branches/safari-608-branch/Source/WebKit/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm (250448 => 250449)


--- branches/safari-608-branch/Source/WebKit/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/Source/WebKit/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm	2019-09-27 20:25:43 UTC (rev 250449)
@@ -102,6 +102,11 @@
     m_page->didChangeOverflowScrollPosition();
 }
 
+void WebEditorClient::subFrameScrollPositionChanged()
+{
+    m_page->didChangeOverflowScrollPosition();
+}
+
 bool WebEditorClient::shouldAllowSingleClickToChangeSelection(WebCore::Node& targetNode, const WebCore::VisibleSelection& newSelection) const
 {
     // The text selection assistant will handle selection in the case where we are already editing the node

Modified: branches/safari-608-branch/Source/WebKitLegacy/mac/ChangeLog (250448 => 250449)


--- branches/safari-608-branch/Source/WebKitLegacy/mac/ChangeLog	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/Source/WebKitLegacy/mac/ChangeLog	2019-09-27 20:25:43 UTC (rev 250449)
@@ -1,3 +1,67 @@
+2019-09-27  Alan Coon  <[email protected]>
+
+        Cherry-pick r250365. rdar://problem/55770710
+
+    Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
+    https://bugs.webkit.org/show_bug.cgi?id=202125
+    
+    Reviewed by Tim Horton.
+    
+    Source/WebCore:
+    
+    Test: editing/selection/ios/update-selection-after-iframe-scroll.html
+    
+    When we end scrolling, make sure that iframes get a final update to ensure that the
+    selection is in the correct position. Pipe that to WebKit/UIProcess via
+    frame specific plath.
+    
+    * loader/EmptyClients.cpp:
+    * page/EditorClient.h:
+    * page/scrolling/AsyncScrollingCoordinator.cpp:
+    (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+    
+    Source/WebKit:
+    
+    Add additional calls into UIKit differentiate between main frame scrolling and overflow/iframe scrolling.
+    Add piping for iframe specific scrolling.
+    
+    * Platform/spi/ios/UIKitSPI.h:
+    * UIProcess/ios/WKContentViewInteraction.mm:
+    (-[WKContentView _willStartScrollingOrZooming]):
+    (-[WKContentView _didEndScrollingOrZooming]):
+    * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+    (WebKit::WebEditorClient::subFrameScrollPositionChanged):
+    * WebProcess/WebCoreSupport/WebEditorClient.h:
+    * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
+    (WebKit::WebEditorClient::subFrameScrollPositionChanged):
+    
+    Source/WebKitLegacy/mac:
+    
+    Filling out unused functions needed for new fix.
+    
+    * WebCoreSupport/WebEditorClient.h:
+    
+    LayoutTests:
+    
+    Test that an iframe selection is updated after a scroll is completed.
+    
+    * editing/selection/ios/update-selection-after-iframe-scroll-expected.txt: Added.
+    * editing/selection/ios/update-selection-after-iframe-scroll.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-09-25  Megan Gardner  <[email protected]>
+
+            Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
+            https://bugs.webkit.org/show_bug.cgi?id=202125
+
+            Reviewed by Tim Horton.
+
+            Filling out unused functions needed for new fix.
+
+            * WebCoreSupport/WebEditorClient.h:
+
 2019-09-23  Alan Coon  <[email protected]>
 
         Cherry-pick r250066. rdar://problem/55608013

Modified: branches/safari-608-branch/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h (250448 => 250449)


--- branches/safari-608-branch/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h	2019-09-27 20:25:38 UTC (rev 250448)
+++ branches/safari-608-branch/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h	2019-09-27 20:25:43 UTC (rev 250449)
@@ -137,6 +137,7 @@
     void textWillBeDeletedInTextField(WebCore::Element*) final;
     void textDidChangeInTextArea(WebCore::Element*) final;
     void overflowScrollPositionChanged() final { };
+    void subFrameScrollPositionChanged() final { };
 
 #if PLATFORM(IOS_FAMILY)
     void startDelayingAndCoalescingContentChangeNotifications() final;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to