REGRESSION: changing iPad orientation on blogger.com crashes under RemoteScrollingCoo...
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2019 18:09:56 +0000 (18:09 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2019 18:09:56 +0000 (18:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196813
<rdar://problem/49393264>

Reviewed by Simon Fraser.

No test, can't repro.

* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):

Null check the nodes.

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm

index c688ba1..c0f0e92 100644 (file)
@@ -1,3 +1,18 @@
+2019-04-11  Antti Koivisto  <antti@apple.com>
+
+        REGRESSION: changing iPad orientation on blogger.com crashes under RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations()
+        https://bugs.webkit.org/show_bug.cgi?id=196813
+        <rdar://problem/49393264>
+
+        Reviewed by Simon Fraser.
+
+        No test, can't repro.
+
+        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
+        (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
+
+        Null check the nodes.
+
 2019-04-10  Chris Dumez  <cdumez@apple.com>
 
         Regression(r244144) ProcessSwap.ReuseSuspendedProcessLoadHTMLString API test is flaky
index 70a01ef..97dbcb4 100644 (file)
@@ -131,15 +131,26 @@ void RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations(const
     // To do overlap hit testing correctly we tell layers about such relations.
     for (auto positionedNodeID : m_scrollingTree->positionedNodesWithRelatedOverflow()) {
         auto* positionedNode = downcast<ScrollingTreePositionedNode>(m_scrollingTree->nodeForID(positionedNodeID));
-        auto* positionedLayerNode = RemoteLayerTreeNode::forCALayer(positionedNode->layer());
-
+        if (!positionedNode) {
+            ASSERT_NOT_REACHED();
+            continue;
+        }
         Vector<GraphicsLayer::PlatformLayerID> scrollContainerLayerIDs;
 
         for (auto overflowNodeID : positionedNode->relatedOverflowScrollingNodes()) {
             auto* overflowNode = downcast<ScrollingTreeOverflowScrollingNode>(m_scrollingTree->nodeForID(overflowNodeID));
+            if (!overflowNode) {
+                ASSERT_NOT_REACHED();
+                continue;
+            }
             scrollContainerLayerIDs.append(RemoteLayerTreeNode::layerID(overflowNode->scrollContainerLayer()));
         }
 
+        auto* positionedLayerNode = RemoteLayerTreeNode::forCALayer(positionedNode->layer());
+        if (!positionedLayerNode) {
+            ASSERT_NOT_REACHED();
+            continue;
+        }
         positionedLayerNode->setRelatedScrollContainerBehaviorAndIDs(positionedNode->scrollPositioningBehavior(), WTFMove(scrollContainerLayerIDs));
 
         m_layersWithScrollingRelations.add(positionedLayerNode->layerID());