Changeset 246766 in webkit


Ignore:
Timestamp:
Jun 24, 2019 3:44:09 PM (5 years ago)
Author:
Simon Fraser
Message:

REGRESSION (r246725 ): Crashes on twitch.tv
https://bugs.webkit.org/show_bug.cgi?id=199176
Source/WebCore:

rdar://problem/52071249

Reviewed by Zalan Bujtas.

With a composited negative z-index child inside a scroller, we can register the overflow scroll
proxy node before we've traversed the overflow layer, so it that layer hasn't got its OverflowScrollingNode
yet. Thus, AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes() can be called with an empty vector.
Avoid crashing when this happens.

Test: scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child.html

  • page/scrolling/AsyncScrollingCoordinator.cpp:

(WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):

  • page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:

(WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):

LayoutTests:

Reviewed by Zalan Bujtas.

  • scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child-expected.txt: Added.
  • scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r246765 r246766  
     12019-06-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r246725 ): Crashes on twitch.tv
     4        https://bugs.webkit.org/show_bug.cgi?id=199176
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        * scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child-expected.txt: Added.
     9        * scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child.html: Added.
     10
    1112019-06-24  Alexey Shvayka  <shvaikalesh@gmail.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r246764 r246766  
     12019-06-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r246725 ): Crashes on twitch.tv
     4        https://bugs.webkit.org/show_bug.cgi?id=199176
     5        rdar://problem/52071249
     6
     7        Reviewed by Zalan Bujtas.
     8       
     9        With a composited negative z-index child inside a scroller, we can register the overflow scroll
     10        proxy node before we've traversed the overflow layer, so it that layer hasn't got its OverflowScrollingNode
     11        yet. Thus, AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes() can be called with an empty vector.
     12        Avoid crashing when this happens.
     13
     14        Test: scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child.html
     15
     16        * page/scrolling/AsyncScrollingCoordinator.cpp:
     17        (WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):
     18        * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
     19        (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
     20
    1212019-06-24  Chris Dumez  <cdumez@apple.com>
    222
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r246725 r246766  
    716716    else if (is<ScrollingStateOverflowScrollProxyNode>(node)) {
    717717        auto* overflowScrollProxyNode = downcast<ScrollingStateOverflowScrollProxyNode>(node);
    718         ASSERT(relatedNodes.size() == 1);
    719         overflowScrollProxyNode->setOverflowScrollingNode(relatedNodes[0]);
     718        if (!relatedNodes.isEmpty())
     719            overflowScrollProxyNode->setOverflowScrollingNode(relatedNodes[0]);
     720        else
     721            overflowScrollProxyNode->setOverflowScrollingNode(0);
    720722    } else
    721723        ASSERT_NOT_REACHED();
  • trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm

    r246725 r246766  
    5858        m_overflowScrollingNodeID = overflowProxyStateNode.overflowScrollingNode();
    5959
    60     auto& relatedNodes = scrollingTree().overflowRelatedNodes();
    61     relatedNodes.ensure(m_overflowScrollingNodeID, [] {
    62         return Vector<ScrollingNodeID>();
    63     }).iterator->value.append(scrollingNodeID());
     60    if (m_overflowScrollingNodeID) {
     61        auto& relatedNodes = scrollingTree().overflowRelatedNodes();
     62        relatedNodes.ensure(m_overflowScrollingNodeID, [] {
     63            return Vector<ScrollingNodeID>();
     64        }).iterator->value.append(scrollingNodeID());
     65    }
    6466
    6567    scrollingTree().nodesWithRelatedOverflow().add(scrollingNodeID());
Note: See TracChangeset for help on using the changeset viewer.