Changeset 250365 in webkit


Ignore:
Timestamp:
Sep 25, 2019 3:54:16 PM (5 years ago)
Author:
Megan Gardner
Message:

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.
Location:
trunk
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r250362 r250365  
     12019-09-25  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
     4        https://bugs.webkit.org/show_bug.cgi?id=202125
     5
     6        Reviewed by Tim Horton.
     7
     8        Test that an iframe selection is updated after a scroll is completed.
     9
     10        * editing/selection/ios/update-selection-after-iframe-scroll-expected.txt: Added.
     11        * editing/selection/ios/update-selection-after-iframe-scroll.html: Added.
     12
    1132019-09-25  Alicia Boya García  <aboya@igalia.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r250361 r250365  
     12019-09-25  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
     4        https://bugs.webkit.org/show_bug.cgi?id=202125
     5
     6        Reviewed by Tim Horton.
     7
     8        Test: editing/selection/ios/update-selection-after-iframe-scroll.html
     9
     10        When we end scrolling, make sure that iframes get a final update to ensure that the
     11        selection is in the correct position. Pipe that to WebKit/UIProcess via
     12        frame specific plath.
     13
     14        * loader/EmptyClients.cpp:
     15        * page/EditorClient.h:
     16        * page/scrolling/AsyncScrollingCoordinator.cpp:
     17        (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
     18
    1192019-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>
    220
  • trunk/Source/WebCore/loader/EmptyClients.cpp

    r250043 r250365  
    217217    void textDidChangeInTextArea(Element*) final { }
    218218    void overflowScrollPositionChanged() final { }
     219    void subFrameScrollPositionChanged() final { }
    219220
    220221#if PLATFORM(IOS_FAMILY)
  • trunk/Source/WebCore/page/EditorClient.h

    r248974 r250365  
    130130    virtual void textDidChangeInTextArea(Element*) = 0;
    131131    virtual void overflowScrollPositionChanged() = 0;
     132    virtual void subFrameScrollPositionChanged() = 0;
    132133
    133134#if PLATFORM(IOS_FAMILY)
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r248846 r250365  
    343343
    344344    auto& frameView = *frameViewPtr;
     345   
     346    if (!frameViewPtr->frame().isMainFrame()) {
     347        if (scrollingLayerPositionAction == ScrollingLayerPositionAction::Set)
     348            m_page->editorClient().subFrameScrollPositionChanged();
     349    }
    345350
    346351    if (scrollingNodeID == frameView.scrollingNodeID()) {
  • trunk/Source/WebKit/ChangeLog

    r250361 r250365  
     12019-09-25  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
     4        https://bugs.webkit.org/show_bug.cgi?id=202125
     5
     6        Reviewed by Tim Horton.
     7
     8        Add additional calls into UIKit differentiate between main frame scrolling and overflow/iframe scrolling.
     9        Add piping for iframe specific scrolling.
     10
     11        * Platform/spi/ios/UIKitSPI.h:
     12        * UIProcess/ios/WKContentViewInteraction.mm:
     13        (-[WKContentView _willStartScrollingOrZooming]):
     14        (-[WKContentView _didEndScrollingOrZooming]):
     15        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
     16        (WebKit::WebEditorClient::subFrameScrollPositionChanged):
     17        * WebProcess/WebCoreSupport/WebEditorClient.h:
     18        * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
     19        (WebKit::WebEditorClient::subFrameScrollPositionChanged):
     20
    1212019-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>
    222
  • trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h

    r249006 r250365  
    10891089#endif // USE(APPLE_INTERNAL_SDK)
    10901090
     1091@interface UITextInteractionAssistant (Staging_55645619)
     1092- (void)didEndScrollingOrZooming;
     1093- (void)willStartScrollingOrZooming;
     1094@end
     1095
    10911096@interface UIGestureRecognizer (Staging_45970040)
    10921097@property (nonatomic, readonly, getter=_modifierFlags) UIKeyModifierFlags modifierFlags;
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r250345 r250365  
    27162716- (void)_willStartScrollingOrZooming
    27172717{
    2718     [_textSelectionAssistant willStartScrollingOverflow];
     2718    if ([_textSelectionAssistant respondsToSelector:@selector(willStartScrollingOrZooming)])
     2719        [_textSelectionAssistant willStartScrollingOrZooming];
     2720    else
     2721        [_textSelectionAssistant willStartScrollingOverflow];
    27192722    _page->setIsScrollingOrZooming(true);
    27202723
     
    27362739{
    27372740    if (!_needsDeferredEndScrollingSelectionUpdate) {
    2738         [_textSelectionAssistant didEndScrollingOverflow];
     2741        if ([_textSelectionAssistant respondsToSelector:@selector(didEndScrollingOrZooming)])
     2742            [_textSelectionAssistant didEndScrollingOrZooming];
     2743        else
     2744            [_textSelectionAssistant didEndScrollingOverflow];
    27392745    }
    27402746    _page->setIsScrollingOrZooming(false);
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp

    r245796 r250365  
    425425    notImplemented();
    426426}
     427
     428void WebEditorClient::subFrameScrollPositionChanged()
     429{
     430    notImplemented();
     431}
    427432#endif
    428433
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h

    r248974 r250365  
    114114    void textDidChangeInTextArea(WebCore::Element*) final;
    115115    void overflowScrollPositionChanged() final;
     116    void subFrameScrollPositionChanged() final;
    116117
    117118#if PLATFORM(COCOA)
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm

    r248974 r250365  
    103103}
    104104
     105void WebEditorClient::subFrameScrollPositionChanged()
     106{
     107    m_page->didChangeOverflowScrollPosition();
     108}
     109
    105110bool WebEditorClient::shouldAllowSingleClickToChangeSelection(WebCore::Node& targetNode, const WebCore::VisibleSelection& newSelection) const
    106111{
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r250333 r250365  
     12019-09-25  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
     4        https://bugs.webkit.org/show_bug.cgi?id=202125
     5
     6        Reviewed by Tim Horton.
     7
     8        Filling out unused functions needed for new fix.
     9
     10        * WebCoreSupport/WebEditorClient.h:
     11
    1122019-09-24  Alex Christensen  <achristensen@webkit.org>
    213
  • trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h

    r248974 r250365  
    139139    void textDidChangeInTextArea(WebCore::Element*) final;
    140140    void overflowScrollPositionChanged() final { };
     141    void subFrameScrollPositionChanged() final { };
    141142
    142143#if PLATFORM(IOS_FAMILY)
Note: See TracChangeset for help on using the changeset viewer.