[iOS WK2] www.france24.com doesn't always load the page, sections stay white
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Aug 2014 02:43:35 +0000 (02:43 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Aug 2014 02:43:35 +0000 (02:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=135684
<rdar://problem/17931712>

Reviewed by Tim Horton.

It's possible for a UIScrollView for overflow to move between one scrolling tree node
and another. When this happens, we need to avoid unconditionally clearing the delegate
on the node that's being destroyed, because the new node will already have set the
UIScrollView delegate to its own delegate.

* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm

index 94e3e70..5a3384a 100644 (file)
@@ -1,3 +1,19 @@
+2014-08-06  Simon Fraser  <simon.fraser@apple.com>
+
+        [iOS WK2] www.france24.com doesn't always load the page, sections stay white
+        https://bugs.webkit.org/show_bug.cgi?id=135684
+        <rdar://problem/17931712>
+
+        Reviewed by Tim Horton.
+        
+        It's possible for a UIScrollView for overflow to move between one scrolling tree node
+        and another. When this happens, we need to avoid unconditionally clearing the delegate
+        on the node that's being destroyed, because the new node will already have set the
+        UIScrollView delegate to its own delegate.
+
+        * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
+        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS):
+
 2014-08-06  Dean Jackson  <dino@apple.com>
 
         ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED is not used anywhere. Remove it.
index c3650f0..eb0acca 100644 (file)
@@ -111,7 +111,9 @@ ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS()
     BEGIN_BLOCK_OBJC_EXCEPTIONS
     if (UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate]) {
         ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
-        scrollView.delegate = nil;
+        // The scrollView may have been adopted by another node, so only clear the delegate if it's ours.
+        if (scrollView.delegate == m_scrollViewDelegate.get())
+            scrollView.delegate = nil;
     }
     END_BLOCK_OBJC_EXCEPTIONS
 }