⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 248466 in webkit


Ignore:
Timestamp:
Aug 9, 2019, 8:53:59 AM (7 years ago)
Author:
Kocsen Chung
Message:

Cherry-pick r248447. rdar://problem/54109873

Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
https://bugs.webkit.org/show_bug.cgi?id=200374
rdar://problem/54095519

Reviewed by Tim Horton.
Source/WebCore:

Add to InteractionInformationAtPosition a ScrollingNodeID which represents the enclosing scrolling
node that affects the targeted element's position. We use this to find a UIScrollView in the UI process.

The entrypoint to finding the enclosing scrolling node is ScrollingCoordinator::scrollableContainerNodeID(),
which calls RenderLayerCompositor::asyncScrollableContainerNodeID() to look for a scrolling ancestor in
the current frame, and then looks for an enclosing scrollable frame, or a scrolling ancestor in
the enclosing frame.

There's a bit of subtlety in RenderLayerCompositor::asyncScrollableContainerNodeID() because if you're asking
for the node that scrolls the renderer, if the renderer itself has a layer and is scrollable, you want
its enclosing scroller.

  • page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::scrollableContainerNodeID const):
  • page/scrolling/AsyncScrollingCoordinator.h:
  • page/scrolling/ScrollingCoordinator.cpp: (WebCore::scrollableContainerNodeID const):
  • page/scrolling/ScrollingCoordinator.h:
  • rendering/RenderLayer.h:
  • rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::asyncScrollableContainerNodeID):
  • rendering/RenderLayerCompositor.h:

Source/WebKit:

Add InteractionInformationAtPosition.containerScrollingNodeID and initialize it in elementPositionInformation()
by asking the scrolling coordinator.

Also add a way to get from a ScrollingNodeID to a UIScrollView to RemoteScrollingCoordinatorProxy,
which gets the scrolling node and asks the delegate for the UIView.

  • Shared/ios/InteractionInformationAtPosition.h:
  • Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode):
  • UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
  • UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
  • UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
  • UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollView const):
  • UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
  • WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::elementPositionInformation):

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

Location:
branches/safari-608.1-branch/Source
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-608.1-branch/Source/WebCore/ChangeLog

    r248458 r248466  
    1 2019-08-08  Kocsen Chung  <kocsen_chung@apple.com>
    2 
    3         Cherry-pick r248438. rdar://problem/54093226
    4 
    5     [iOS] Position image information should respect the image orientation
    6     https://bugs.webkit.org/show_bug.cgi?id=200487
    7    
    8     Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-08-08
    9     Reviewed by Simon Fraser.
    10    
     12019-08-09  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r248447. rdar://problem/54109873
     4
     5    Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
     6    https://bugs.webkit.org/show_bug.cgi?id=200374
     7    rdar://problem/54095519
     8   
     9    Reviewed by Tim Horton.
    1110    Source/WebCore:
    1211   
    13     Re-factor CachedImage::imageSizeForRenderer() into another overriding
    14     function which does not scale the imageSize. Therefore the new function
    15     returns FloatSize while the original function returns LayoutSize.
    16    
    17     * loader/cache/CachedImage.cpp:
    18     (WebCore::CachedImage::imageSizeForRenderer const):
    19     * loader/cache/CachedImage.h:
    20     * rendering/RenderElement.h:
     12    Add to InteractionInformationAtPosition a ScrollingNodeID which represents the enclosing scrolling
     13    node that affects the targeted element's position. We use this to find a UIScrollView in the UI process.
     14   
     15    The entrypoint to finding the enclosing scrolling node is ScrollingCoordinator::scrollableContainerNodeID(),
     16    which calls RenderLayerCompositor::asyncScrollableContainerNodeID() to look for a scrolling ancestor in
     17    the current frame, and then looks for an enclosing scrollable frame, or a scrolling ancestor in
     18    the enclosing frame.
     19   
     20    There's a bit of subtlety in RenderLayerCompositor::asyncScrollableContainerNodeID() because if you're asking
     21    for the node that scrolls the renderer, if the renderer itself has a layer and is scrollable, you want
     22    its enclosing scroller.
     23   
     24    * page/scrolling/AsyncScrollingCoordinator.cpp:
     25    (WebCore::AsyncScrollingCoordinator::scrollableContainerNodeID const):
     26    * page/scrolling/AsyncScrollingCoordinator.h:
     27    * page/scrolling/ScrollingCoordinator.cpp:
     28    (WebCore::scrollableContainerNodeID const):
     29    * page/scrolling/ScrollingCoordinator.h:
     30    * rendering/RenderLayer.h:
     31    * rendering/RenderLayerCompositor.cpp:
     32    (WebCore::RenderLayerCompositor::asyncScrollableContainerNodeID):
     33    * rendering/RenderLayerCompositor.h:
    2134   
    2235    Source/WebKit:
    2336   
    24     imagePositionInformation() should respect the image orientation when
    25     drawing an Image to a ShareableBitmap context.
    26    
    27     boundsPositionInformation() already takes care of the image orientation
    28     because it gets RenderImage::enclosingBoundingBox().
    29    
     37    Add InteractionInformationAtPosition.containerScrollingNodeID and initialize it in elementPositionInformation()
     38    by asking the scrolling coordinator.
     39   
     40    Also add a way to get from a ScrollingNodeID to a UIScrollView to RemoteScrollingCoordinatorProxy,
     41    which gets the scrolling node and asks the delegate for the UIView.
     42   
     43    * Shared/ios/InteractionInformationAtPosition.h:
     44    * Shared/ios/InteractionInformationAtPosition.mm:
     45    (WebKit::InteractionInformationAtPosition::encode const):
     46    (WebKit::InteractionInformationAtPosition::decode):
     47    * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
     48    * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
     49    (WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
     50    * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
     51    * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
     52    (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollView const):
     53    * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
    3054    * WebProcess/WebPage/ios/WebPageIOS.mm:
    31     (WebKit::imagePositionInformation):
    32    
    33     Tools:
    34    
    35     Add an API test to verify the position image information is drawn rotated
    36     because of respecting its image orientation.
    37    
    38     * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    39     * TestWebKitAPI/Tests/WebKitCocoa/WKRequestActivatedElementInfo.mm:
    40     (TestWebKitAPI::TEST):
    41     * TestWebKitAPI/Tests/WebKitCocoa/exif-orientation-8-llo.jpg: Added.
    42     * TestWebKitAPI/Tests/WebKitCocoa/img-with-rotated-image.html: Added.
    43    
    44     git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    45 
    46     2019-08-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
    47 
    48             [iOS] Position image information should respect the image orientation
    49             https://bugs.webkit.org/show_bug.cgi?id=200487
    50 
    51             Reviewed by Simon Fraser.
    52 
    53             Re-factor CachedImage::imageSizeForRenderer() into another overriding
    54             function which does not scale the imageSize. Therefore the new function
    55             returns FloatSize while the original function returns LayoutSize.
    56 
    57             * loader/cache/CachedImage.cpp:
    58             (WebCore::CachedImage::imageSizeForRenderer const):
    59             * loader/cache/CachedImage.h:
    60             * rendering/RenderElement.h:
     55    (WebKit::elementPositionInformation):
     56   
     57    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     58
     59    2019-08-08  Kocsen Chung  <kocsen_chung@apple.com>
     60
     61            Cherry-pick r248438. rdar://problem/54093226
     62
     63        [iOS] Position image information should respect the image orientation
     64        https://bugs.webkit.org/show_bug.cgi?id=200487
     65
     66        Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-08-08
     67        Reviewed by Simon Fraser.
     68
     69        Source/WebCore:
     70
     71        Re-factor CachedImage::imageSizeForRenderer() into another overriding
     72        function which does not scale the imageSize. Therefore the new function
     73        returns FloatSize while the original function returns LayoutSize.
     74
     75        * loader/cache/CachedImage.cpp:
     76        (WebCore::CachedImage::imageSizeForRenderer const):
     77        * loader/cache/CachedImage.h:
     78        * rendering/RenderElement.h:
     79
     80        Source/WebKit:
     81
     82        imagePositionInformation() should respect the image orientation when
     83        drawing an Image to a ShareableBitmap context.
     84
     85        boundsPositionInformation() already takes care of the image orientation
     86        because it gets RenderImage::enclosingBoundingBox().
     87
     88        * WebProcess/WebPage/ios/WebPageIOS.mm:
     89        (WebKit::imagePositionInformation):
     90
     91        Tools:
     92
     93        Add an API test to verify the position image information is drawn rotated
     94        because of respecting its image orientation.
     95
     96        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     97        * TestWebKitAPI/Tests/WebKitCocoa/WKRequestActivatedElementInfo.mm:
     98        (TestWebKitAPI::TEST):
     99        * TestWebKitAPI/Tests/WebKitCocoa/exif-orientation-8-llo.jpg: Added.
     100        * TestWebKitAPI/Tests/WebKitCocoa/img-with-rotated-image.html: Added.
     101
     102        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     103
     104        2019-08-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
     105
     106                [iOS] Position image information should respect the image orientation
     107                https://bugs.webkit.org/show_bug.cgi?id=200487
     108
     109                Reviewed by Simon Fraser.
     110
     111                Re-factor CachedImage::imageSizeForRenderer() into another overriding
     112                function which does not scale the imageSize. Therefore the new function
     113                returns FloatSize while the original function returns LayoutSize.
     114
     115                * loader/cache/CachedImage.cpp:
     116                (WebCore::CachedImage::imageSizeForRenderer const):
     117                * loader/cache/CachedImage.h:
     118                * rendering/RenderElement.h:
    61119
    621202019-08-08  Alan Coon  <alancoon@apple.com>
     
    378436
    379437            Reviewed by Darin Adler.
     438
     4392019-08-08  Simon Fraser  <simon.fraser@apple.com>
     440
     441        Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
     442        https://bugs.webkit.org/show_bug.cgi?id=200374
     443        rdar://problem/54095519
     444
     445        Reviewed by Tim Horton.
     446
     447        Add to InteractionInformationAtPosition a ScrollingNodeID which represents the enclosing scrolling
     448        node that affects the targeted element's position. We use this to find a UIScrollView in the UI process.
     449       
     450        The entrypoint to finding the enclosing scrolling node is ScrollingCoordinator::scrollableContainerNodeID(),
     451        which calls RenderLayerCompositor::asyncScrollableContainerNodeID() to look for a scrolling ancestor in
     452        the current frame, and then looks for an enclosing scrollable frame, or a scrolling ancestor in
     453        the enclosing frame.
     454       
     455        There's a bit of subtlety in RenderLayerCompositor::asyncScrollableContainerNodeID() because if you're asking
     456        for the node that scrolls the renderer, if the renderer itself has a layer and is scrollable, you want
     457        its enclosing scroller.
     458
     459        * page/scrolling/AsyncScrollingCoordinator.cpp:
     460        (WebCore::AsyncScrollingCoordinator::scrollableContainerNodeID const):
     461        * page/scrolling/AsyncScrollingCoordinator.h:
     462        * page/scrolling/ScrollingCoordinator.cpp:
     463        (WebCore::scrollableContainerNodeID const):
     464        * page/scrolling/ScrollingCoordinator.h:
     465        * rendering/RenderLayer.h:
     466        * rendering/RenderLayerCompositor.cpp:
     467        (WebCore::RenderLayerCompositor::asyncScrollableContainerNodeID):
     468        * rendering/RenderLayerCompositor.h:
    380469
    381470            We normally prevent page caching if there were any pending subresource loads when navigating,
  • branches/safari-608.1-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r247344 r248466  
    3838#include "Page.h"
    3939#include "PerformanceLoggingClient.h"
     40#include "RenderLayerCompositor.h"
     41#include "RenderView.h"
    4042#include "ScrollAnimator.h"
    4143#include "ScrollingConstraints.h"
     
    785787}
    786788
     789ScrollingNodeID AsyncScrollingCoordinator::scrollableContainerNodeID(const RenderObject& renderer) const
     790{
     791    if (auto overflowScrollingNodeID = renderer.view().compositor().asyncScrollableContainerNodeID(renderer))
     792        return overflowScrollingNodeID;
     793
     794    // If we're in a scrollable frame, return that.
     795    auto* frameView = renderer.frame().view();
     796    if (!frameView)
     797        return 0;
     798
     799    if (auto scrollingNodeID = frameView->scrollingNodeID())
     800        return scrollingNodeID;
     801
     802    // Otherwise, look for a scrollable element in the containing frame.
     803    if (auto* ownerElement = renderer.document().ownerElement()) {
     804        if (auto* frameRenderer = ownerElement->renderer())
     805            return scrollableContainerNodeID(*frameRenderer);
     806    }
     807
     808    return 0;
     809}
     810
    787811String AsyncScrollingCoordinator::scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior behavior) const
    788812{
  • branches/safari-608.1-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h

    r247344 r248466  
    9292    bool asyncFrameOrOverflowScrollingEnabled() const;
    9393
     94    WEBCORE_EXPORT ScrollingNodeID scrollableContainerNodeID(const RenderObject&) const override;
     95
    9496    WEBCORE_EXPORT void frameViewLayoutUpdated(FrameView&) override;
    9597    WEBCORE_EXPORT void frameViewRootLayerDidChange(FrameView&) override;
  • branches/safari-608.1-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

    r247306 r248466  
    9797}
    9898
     99ScrollingNodeID ScrollingCoordinator::scrollableContainerNodeID(const RenderObject&) const
     100{
     101    return 0;
     102}
     103
    99104EventTrackingRegions ScrollingCoordinator::absoluteEventTrackingRegionsForFrame(const Frame& frame) const
    100105{
  • branches/safari-608.1-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r247344 r248466  
    6060class Page;
    6161class Region;
     62class RenderObject;
    6263class RenderLayer;
    6364class ScrollableArea;
     
    8384    // Return whether this scrolling coordinator handles scrolling for the given overflow scroll layer.
    8485    WEBCORE_EXPORT virtual bool coordinatesScrollingForOverflowLayer(const RenderLayer&) const;
     86
     87    // Returns the ScrollingNodeID of the innermost scrolling node that scrolls the renderer.
     88    WEBCORE_EXPORT virtual ScrollingNodeID scrollableContainerNodeID(const RenderObject&) const;
    8589
    8690    // Should be called whenever the given frame view has been laid out.
  • branches/safari-608.1-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r247610 r248466  
    27092709}
    27102710
     2711// Note that this returns the ScrollingNodeID of the scroller this layer is embedded in, not the layer's own ScrollingNodeID if it has one.
     2712ScrollingNodeID RenderLayerCompositor::asyncScrollableContainerNodeID(const RenderObject& renderer)
     2713{
     2714    auto* enclosingLayer = renderer.enclosingLayer();
     2715    if (!enclosingLayer)
     2716        return 0;
     2717   
     2718    auto layerScrollingNodeID = [](const RenderLayer& layer) -> ScrollingNodeID {
     2719        if (layer.isComposited())
     2720            return layer.backing()->scrollingNodeIDForRole(ScrollCoordinationRole::Scrolling);
     2721        return 0;
     2722    };
     2723
     2724    // If the renderer is inside the layer, we care about the layer's scrollability. Otherwise, we let traverseAncestorLayers look at ancestors.
     2725    if (!renderer.hasLayer()) {
     2726        if (auto scrollingNodeID = layerScrollingNodeID(*enclosingLayer))
     2727            return scrollingNodeID;
     2728    }
     2729
     2730    ScrollingNodeID containerScrollingNodeID = 0;
     2731    traverseAncestorLayers(*enclosingLayer, [&](const RenderLayer& ancestorLayer, bool isContainingBlockChain, bool /*isPaintOrderAncestor*/) {
     2732        if (isContainingBlockChain && ancestorLayer.hasCompositedScrollableOverflow()) {
     2733            containerScrollingNodeID = layerScrollingNodeID(ancestorLayer);
     2734            return AncestorTraversal::Stop;
     2735        }
     2736        return AncestorTraversal::Continue;
     2737    });
     2738
     2739    return containerScrollingNodeID;
     2740}
     2741
    27112742// Return true if the given layer is a stacking context and has compositing child
    27122743// layers that it needs to clip. In this case we insert a clipping GraphicsLayer
  • branches/safari-608.1-branch/Source/WebCore/rendering/RenderLayerCompositor.h

    r247246 r248466  
    215215    bool updateAncestorClippingStack(const RenderLayer&, const RenderLayer* compositingAncestor) const;
    216216
     217    // Returns the ScrollingNodeID for the containing async-scrollable layer that scrolls this renderer's border box.
     218    // May return 0 for position-fixed content.
     219    static ScrollingNodeID asyncScrollableContainerNodeID(const RenderObject&);
     220
    217221    // Whether layer's backing needs a graphics layer to clip z-order children of the given layer.
    218222    static bool clipsCompositingDescendants(const RenderLayer&);
  • branches/safari-608.1-branch/Source/WebKit/ChangeLog

    r248461 r248466  
    1 2019-08-08  Kocsen Chung  <kocsen_chung@apple.com>
    2 
    3         Cherry-pick r248039. rdar://problem/54087592
    4 
    5     [iOS 13] Safari crashes when closing a tab with a focused element if the unified field has focus
    6     https://bugs.webkit.org/show_bug.cgi?id=200291
    7     <rdar://problem/53717946>
    8    
    9     Reviewed by Megan Gardner.
     12019-08-09  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r248447. rdar://problem/54109873
     4
     5    Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
     6    https://bugs.webkit.org/show_bug.cgi?id=200374
     7    rdar://problem/54095519
     8   
     9    Reviewed by Tim Horton.
     10    Source/WebCore:
     11   
     12    Add to InteractionInformationAtPosition a ScrollingNodeID which represents the enclosing scrolling
     13    node that affects the targeted element's position. We use this to find a UIScrollView in the UI process.
     14   
     15    The entrypoint to finding the enclosing scrolling node is ScrollingCoordinator::scrollableContainerNodeID(),
     16    which calls RenderLayerCompositor::asyncScrollableContainerNodeID() to look for a scrolling ancestor in
     17    the current frame, and then looks for an enclosing scrollable frame, or a scrolling ancestor in
     18    the enclosing frame.
     19   
     20    There's a bit of subtlety in RenderLayerCompositor::asyncScrollableContainerNodeID() because if you're asking
     21    for the node that scrolls the renderer, if the renderer itself has a layer and is scrollable, you want
     22    its enclosing scroller.
     23   
     24    * page/scrolling/AsyncScrollingCoordinator.cpp:
     25    (WebCore::AsyncScrollingCoordinator::scrollableContainerNodeID const):
     26    * page/scrolling/AsyncScrollingCoordinator.h:
     27    * page/scrolling/ScrollingCoordinator.cpp:
     28    (WebCore::scrollableContainerNodeID const):
     29    * page/scrolling/ScrollingCoordinator.h:
     30    * rendering/RenderLayer.h:
     31    * rendering/RenderLayerCompositor.cpp:
     32    (WebCore::RenderLayerCompositor::asyncScrollableContainerNodeID):
     33    * rendering/RenderLayerCompositor.h:
    1034   
    1135    Source/WebKit:
    1236   
    13     Makes -requestAutocorrectionContextWithCompletionHandler: robust in the case where the web page has been closed,
    14     and there is no Connection object to use when waiting for a sync IPC response.
    15    
    16     Test: AutocorrectionTests.RequestAutocorrectionContextAfterClosingPage
    17    
    18     * UIProcess/ios/WKContentViewInteraction.mm:
    19     (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
    20    
    21     Tools:
    22    
    23     Add an API test to exercise the scenario of synchronously requesting the autocorrection context immediately
    24     after closing the web view, while the web view's content view isn't the first responder.
    25    
    26     * TestWebKitAPI/Tests/ios/AutocorrectionTestsIOS.mm:
    27     * TestWebKitAPI/ios/UIKitSPI.h:
    28    
    29    
    30     git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    31 
    32     2019-07-31  Wenson Hsieh  <wenson_hsieh@apple.com>
    33 
    34             [iOS 13] Safari crashes when closing a tab with a focused element if the unified field has focus
    35             https://bugs.webkit.org/show_bug.cgi?id=200291
    36             <rdar://problem/53717946>
    37 
    38             Reviewed by Megan Gardner.
    39 
    40             Makes -requestAutocorrectionContextWithCompletionHandler: robust in the case where the web page has been closed,
    41             and there is no Connection object to use when waiting for a sync IPC response.
    42 
    43             Test: AutocorrectionTests.RequestAutocorrectionContextAfterClosingPage
    44 
    45             * UIProcess/ios/WKContentViewInteraction.mm:
    46             (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
     37    Add InteractionInformationAtPosition.containerScrollingNodeID and initialize it in elementPositionInformation()
     38    by asking the scrolling coordinator.
     39   
     40    Also add a way to get from a ScrollingNodeID to a UIScrollView to RemoteScrollingCoordinatorProxy,
     41    which gets the scrolling node and asks the delegate for the UIView.
     42   
     43    * Shared/ios/InteractionInformationAtPosition.h:
     44    * Shared/ios/InteractionInformationAtPosition.mm:
     45    (WebKit::InteractionInformationAtPosition::encode const):
     46    (WebKit::InteractionInformationAtPosition::decode):
     47    * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
     48    * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
     49    (WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
     50    * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
     51    * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
     52    (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollView const):
     53    * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
     54    * WebProcess/WebPage/ios/WebPageIOS.mm:
     55    (WebKit::elementPositionInformation):
     56   
     57    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     58
     59    2019-08-08  Kocsen Chung  <kocsen_chung@apple.com>
     60
     61            Cherry-pick r248039. rdar://problem/54087592
     62
     63        [iOS 13] Safari crashes when closing a tab with a focused element if the unified field has focus
     64        https://bugs.webkit.org/show_bug.cgi?id=200291
     65        <rdar://problem/53717946>
     66
     67        Reviewed by Megan Gardner.
     68
     69        Source/WebKit:
     70
     71        Makes -requestAutocorrectionContextWithCompletionHandler: robust in the case where the web page has been closed,
     72        and there is no Connection object to use when waiting for a sync IPC response.
     73
     74        Test: AutocorrectionTests.RequestAutocorrectionContextAfterClosingPage
     75
     76        * UIProcess/ios/WKContentViewInteraction.mm:
     77        (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
     78
     79        Tools:
     80
     81        Add an API test to exercise the scenario of synchronously requesting the autocorrection context immediately
     82        after closing the web view, while the web view's content view isn't the first responder.
     83
     84        * TestWebKitAPI/Tests/ios/AutocorrectionTestsIOS.mm:
     85        * TestWebKitAPI/ios/UIKitSPI.h:
     86
     87
     88        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     89
     90        2019-07-31  Wenson Hsieh  <wenson_hsieh@apple.com>
     91
     92                [iOS 13] Safari crashes when closing a tab with a focused element if the unified field has focus
     93                https://bugs.webkit.org/show_bug.cgi?id=200291
     94                <rdar://problem/53717946>
     95
     96                Reviewed by Megan Gardner.
     97
     98                Makes -requestAutocorrectionContextWithCompletionHandler: robust in the case where the web page has been closed,
     99                and there is no Connection object to use when waiting for a sync IPC response.
     100
     101                Test: AutocorrectionTests.RequestAutocorrectionContextAfterClosingPage
     102
     103                * UIProcess/ios/WKContentViewInteraction.mm:
     104                (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
    47105
    481062019-08-08  Kocsen Chung  <kocsen_chung@apple.com>
     
    310368            would then destroy them on the main thread when the WebResourceLoadStatisticsStore is destroyed on the
    311369            main thread.
     370
     3712019-08-08  Simon Fraser  <simon.fraser@apple.com>
     372
     373        Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
     374        https://bugs.webkit.org/show_bug.cgi?id=200374
     375        rdar://problem/54095519
     376
     377        Reviewed by Tim Horton.
     378       
     379        Add InteractionInformationAtPosition.containerScrollingNodeID and initialize it in elementPositionInformation()
     380        by asking the scrolling coordinator.
     381       
     382        Also add a way to get from a ScrollingNodeID to a UIScrollView to RemoteScrollingCoordinatorProxy,
     383        which gets the scrolling node and asks the delegate for the UIView.
     384
     385        * Shared/ios/InteractionInformationAtPosition.h:
     386        * Shared/ios/InteractionInformationAtPosition.mm:
     387        (WebKit::InteractionInformationAtPosition::encode const):
     388        (WebKit::InteractionInformationAtPosition::decode):
     389        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
     390        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
     391        (WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
     392        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
     393        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
     394        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollView const):
     395        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
     396        * WebProcess/WebPage/ios/WebPageIOS.mm:
     397        (WebKit::elementPositionInformation):
    312398
    313399            * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
  • branches/safari-608.1-branch/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h

    r246892 r248466  
    3232#include "ShareableBitmap.h"
    3333#include <WebCore/IntPoint.h>
     34#include <WebCore/ScrollTypes.h>
    3435#include <WebCore/SelectionRect.h>
    3536#include <WebCore/TextIndicator.h>
     
    6263    bool isAnimatedImage { false };
    6364    bool isElement { false };
     65    WebCore::ScrollingNodeID containerScrollingNodeID { 0 };
    6466#if ENABLE(DATA_DETECTION)
    6567    bool isDataDetectorLink { false };
  • branches/safari-608.1-branch/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm

    r246892 r248466  
    5757    encoder << isAnimatedImage;
    5858    encoder << isElement;
     59    encoder << containerScrollingNodeID;
    5960    encoder << adjustedPointForNodeRespondingToClickEvents;
    6061    encoder << url;
     
    126127        return false;
    127128
     129    if (!decoder.decode(result.containerScrollingNodeID))
     130        return false;
     131
    128132    if (!decoder.decode(result.adjustedPointForNodeRespondingToClickEvents))
    129133        return false;
  • branches/safari-608.1-branch/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h

    r246490 r248466  
    3434#include <wtf/Noncopyable.h>
    3535#include <wtf/RefPtr.h>
     36
     37OBJC_CLASS UIScrollView;
    3638
    3739namespace WebCore {
     
    8890
    8991#if PLATFORM(IOS_FAMILY)
     92    UIScrollView *scrollViewForScrollingNodeID(WebCore::ScrollingNodeID) const;
     93
    9094    WebCore::FloatRect currentLayoutViewport() const;
    9195    void scrollingTreeNodeWillStartPanGesture();
  • branches/safari-608.1-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm

    r246962 r248466  
    3232#import "RemoteLayerTreeHost.h"
    3333#import "RemoteLayerTreeNode.h"
     34#import "ScrollingTreeOverflowScrollingNodeIOS.h"
    3435#import "WebPageProxy.h"
    3536#import <UIKit/UIView.h>
     
    5354using namespace WebCore;
    5455
     56UIScrollView *RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID(WebCore::ScrollingNodeID nodeID) const
     57{
     58    auto* treeNode = m_scrollingTree->nodeForID(nodeID);
     59    if (!is<ScrollingTreeOverflowScrollingNode>(treeNode))
     60        return nil;
     61
     62    auto* scrollingNode = downcast<ScrollingTreeOverflowScrollingNode>(treeNode);
     63    // All ScrollingTreeOverflowScrollingNodes are ScrollingTreeOverflowScrollingNodeIOS on iOS.
     64    return static_cast<ScrollingTreeOverflowScrollingNodeIOS*>(scrollingNode)->scrollView();
     65}
     66
    5567void RemoteScrollingCoordinatorProxy::connectStateNodeLayers(ScrollingStateTree& stateTree, const RemoteLayerTreeHost& layerTreeHost)
    5668{
  • branches/safari-608.1-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h

    r243926 r248466  
    3030#include <WebCore/ScrollingTreeOverflowScrollingNode.h>
    3131
     32OBJC_CLASS UIScrollView;
     33
    3234namespace WebKit {
    3335
     
    3840    static Ref<ScrollingTreeOverflowScrollingNodeIOS> create(WebCore::ScrollingTree&, WebCore::ScrollingNodeID);
    3941    virtual ~ScrollingTreeOverflowScrollingNodeIOS();
     42
     43    UIScrollView* scrollView() const;
    4044
    4145private:
  • branches/safari-608.1-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm

    r243926 r248466  
    5252}
    5353
     54UIScrollView* ScrollingTreeOverflowScrollingNodeIOS::scrollView() const
     55{
     56    return m_scrollingNodeDelegate->scrollView();
     57}
     58
    5459void ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren(const WebCore::ScrollingStateNode& stateNode)
    5560{
  • branches/safari-608.1-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h

    r246926 r248466  
    7575
    7676    UIScrollView *findActingScrollParent(UIScrollView *);
     77    UIScrollView *scrollView() const;
    7778
    7879private:
    79     UIScrollView *scrollView() const;
    80 
    8180    RetainPtr<CALayer> m_scrollLayer;
    8281    RetainPtr<CALayer> m_scrolledContentsLayer;
  • branches/safari-608.1-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r248458 r248466  
    27112711    }
    27122712
     2713    auto* elementForScrollTesting = linkElement ? linkElement : &element;
     2714    if (auto* renderer = elementForScrollTesting->renderer()) {
     2715#if ENABLE(ASYNC_SCROLLING)
     2716        if (auto* scrollingCoordinator = page.scrollingCoordinator())
     2717            info.containerScrollingNodeID = scrollingCoordinator->scrollableContainerNodeID(*renderer);
     2718#endif
     2719    }
     2720
    27132721    if (auto* renderer = element.renderer()) {
    27142722        if (renderer->isRenderImage())
Note: See TracChangeset for help on using the changeset viewer.