Title: [295504] trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
Revision
295504
Author
[email protected]
Date
2022-06-13 15:48:33 -0700 (Mon, 13 Jun 2022)

Log Message

CrashTracer: MobileSafari at WebKit: -[WKWebView(WKViewInternalIOS) _updateScrollViewForTransaction:]
https://bugs.webkit.org/show_bug.cgi?id=241563
<rdar://94621991>

Reviewed by Wenson Hsieh.

Protect against a null root scrolling node.

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _updateScrollViewForTransaction:]):

Canonical link: https://commits.webkit.org/251509@main

Modified Paths

Diff

Modified: trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm (295503 => 295504)


--- trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm	2022-06-13 22:33:43 UTC (rev 295503)
+++ trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm	2022-06-13 22:48:33 UTC (rev 295504)
@@ -876,9 +876,17 @@
     [_scrollView setMinimumZoomScale:layerTreeTransaction.minimumScaleFactor()];
     [_scrollView setMaximumZoomScale:layerTreeTransaction.maximumScaleFactor()];
     [_scrollView _setZoomEnabledInternal:layerTreeTransaction.allowsUserScaling()];
-    auto rootNode = _page->scrollingCoordinatorProxy()->rootNode();
-    WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateScrollViewForOverscrollBehavior(_scrollView.get(), rootNode->horizontalOverscrollBehavior(), rootNode->verticalOverscrollBehavior(), WebKit::ScrollingTreeScrollingNodeDelegateIOS::AllowOverscrollToPreventScrollPropagation::No);
 
+    auto horizontalOverscrollBehavior = WebCore::OverscrollBehavior::Auto;
+    auto verticalOverscrollBehavior = WebCore::OverscrollBehavior::Auto;
+
+    if (auto rootNode = _page->scrollingCoordinatorProxy()->rootNode()) {
+        horizontalOverscrollBehavior = rootNode->horizontalOverscrollBehavior();
+        verticalOverscrollBehavior = rootNode->verticalOverscrollBehavior();
+    }
+
+    WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateScrollViewForOverscrollBehavior(_scrollView.get(), horizontalOverscrollBehavior, verticalOverscrollBehavior, WebKit::ScrollingTreeScrollingNodeDelegateIOS::AllowOverscrollToPreventScrollPropagation::No);
+
     bool hasDockedInputView = !CGRectIsEmpty(_inputViewBoundsInWindow);
     bool isZoomed = layerTreeTransaction.pageScaleFactor() > layerTreeTransaction.initialScaleFactor();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to