Title: [167286] trunk/Source/WebKit2
Revision
167286
Author
[email protected]
Date
2014-04-14 17:47:46 -0700 (Mon, 14 Apr 2014)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (167285 => 167286)


--- trunk/Source/WebKit2/ChangeLog	2014-04-15 00:47:28 UTC (rev 167285)
+++ trunk/Source/WebKit2/ChangeLog	2014-04-15 00:47:46 UTC (rev 167286)
@@ -1,3 +1,18 @@
+2014-04-14  Simon Fraser  <[email protected]>
+
+        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):
+
 2014-04-14  Tim Horton  <[email protected]>
 
         Fix the 32-bit build.

Modified: trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm (167285 => 167286)


--- trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm	2014-04-15 00:47:28 UTC (rev 167285)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm	2014-04-15 00:47:46 UTC (rev 167286)
@@ -115,24 +115,25 @@
 
     const auto& scrollingStateNode = toScrollingStateScrollingNode(stateNode);
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)) {
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)
+        || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)
+        || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollPosition)) {
         BEGIN_BLOCK_OBJC_EXCEPTIONS
         UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate];
         ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
 
-        if (!m_scrollViewDelegate)
-            m_scrollViewDelegate = adoptNS([[WKOverflowScrollViewDelegate alloc] initWithScrollingTreeNode:this]);
+        if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)) {
+            if (!m_scrollViewDelegate)
+                m_scrollViewDelegate = adoptNS([[WKOverflowScrollViewDelegate alloc] initWithScrollingTreeNode:this]);
 
-        scrollView.delegate = m_scrollViewDelegate.get();
-        END_BLOCK_OBJC_EXCEPTIONS
-    }
+            scrollView.delegate = m_scrollViewDelegate.get();
+        }
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)) {
-        BEGIN_BLOCK_OBJC_EXCEPTIONS
-        UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate];
-        ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
+        if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize))
+            scrollView.contentSize = scrollingStateNode.totalContentsSize();
 
-        scrollView.contentSize = scrollingStateNode.totalContentsSize();
+        if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollPosition))
+            scrollView.contentOffset = scrollingStateNode.scrollPosition();
 
         END_BLOCK_OBJC_EXCEPTIONS
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to