Changeset 167286 in webkit


Ignore:
Timestamp:
Apr 14, 2014 5:47:46 PM (10 years ago)
Author:
Simon Fraser
Message:

REGRESSION (WebKit2): Programmatic scrolls in overflow-scrolling:touch don't work
https://bugs.webkit.org/show_bug.cgi?id=131649

Reviewed by Tim Horton.

Update the UIScrollView's contentOffset when we're told that the scroll position
changed.

Also refactor slightly to have a single exception-protected block.

  • UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:

(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r167285 r167286  
     12014-04-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (WebKit2): Programmatic scrolls in overflow-scrolling:touch don't work
     4        https://bugs.webkit.org/show_bug.cgi?id=131649
     5
     6        Reviewed by Tim Horton.
     7       
     8        Update the UIScrollView's contentOffset when we're told that the scroll position
     9        changed.
     10       
     11        Also refactor slightly to have a single exception-protected block.
     12
     13        * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
     14        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
     15
    1162014-04-14  Tim Horton  <timothy_horton@apple.com>
    217
  • trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm

    r166531 r167286  
    116116    const auto& scrollingStateNode = toScrollingStateScrollingNode(stateNode);
    117117
    118     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)) {
     118    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)
     119        || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)
     120        || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollPosition)) {
    119121        BEGIN_BLOCK_OBJC_EXCEPTIONS
    120122        UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate];
    121123        ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
    122124
    123         if (!m_scrollViewDelegate)
    124             m_scrollViewDelegate = adoptNS([[WKOverflowScrollViewDelegate alloc] initWithScrollingTreeNode:this]);
     125        if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)) {
     126            if (!m_scrollViewDelegate)
     127                m_scrollViewDelegate = adoptNS([[WKOverflowScrollViewDelegate alloc] initWithScrollingTreeNode:this]);
    125128
    126         scrollView.delegate = m_scrollViewDelegate.get();
    127         END_BLOCK_OBJC_EXCEPTIONS
    128     }
     129            scrollView.delegate = m_scrollViewDelegate.get();
     130        }
    129131
    130     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)) {
    131         BEGIN_BLOCK_OBJC_EXCEPTIONS
    132         UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate];
    133         ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
     132        if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize))
     133            scrollView.contentSize = scrollingStateNode.totalContentsSize();
    134134
    135         scrollView.contentSize = scrollingStateNode.totalContentsSize();
     135        if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollPosition))
     136            scrollView.contentOffset = scrollingStateNode.scrollPosition();
    136137
    137138        END_BLOCK_OBJC_EXCEPTIONS
Note: See TracChangeset for help on using the changeset viewer.