Title: [165088] trunk/Source/WebKit2
Revision
165088
Author
[email protected]
Date
2014-03-04 18:13:16 -0800 (Tue, 04 Mar 2014)

Log Message

[iOS][WK2] Consider the entire view state on update to find if a change is stable or not
https://bugs.webkit.org/show_bug.cgi?id=129721

Patch by Benjamin Poulain <[email protected]> on 2014-03-04
Reviewed by Simon Fraser.

Changes in scroll, zoom and obscuredRect can happen simultaneously. To compute if the current state
is stable or not, we should consider the complete picture from all the type of updates.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didFinishScrolling]):
(-[WKWebView scrollViewDidScroll:]):
(-[WKWebView scrollViewDidZoom:]):
(-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _updateVisibleContentRects]):
(-[WKWebView _setObscuredInsets:]):
(-[WKWebView _endInteractiveObscuredInsetsChange]):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (165087 => 165088)


--- trunk/Source/WebKit2/ChangeLog	2014-03-05 01:51:53 UTC (rev 165087)
+++ trunk/Source/WebKit2/ChangeLog	2014-03-05 02:13:16 UTC (rev 165088)
@@ -1,3 +1,23 @@
+2014-03-04  Benjamin Poulain  <[email protected]>
+
+        [iOS][WK2] Consider the entire view state on update to find if a change is stable or not
+        https://bugs.webkit.org/show_bug.cgi?id=129721
+
+        Reviewed by Simon Fraser.
+
+        Changes in scroll, zoom and obscuredRect can happen simultaneously. To compute if the current state
+        is stable or not, we should consider the complete picture from all the type of updates.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _didFinishScrolling]):
+        (-[WKWebView scrollViewDidScroll:]):
+        (-[WKWebView scrollViewDidZoom:]):
+        (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
+        (-[WKWebView _frameOrBoundsChanged]):
+        (-[WKWebView _updateVisibleContentRects]):
+        (-[WKWebView _setObscuredInsets:]):
+        (-[WKWebView _endInteractiveObscuredInsetsChange]):
+
 2014-03-04  Jeremy Jones  <[email protected]>
 
         WebVideoFullscreen, should make the hand off of the video layer explicit.

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (165087 => 165088)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-03-05 01:51:53 UTC (rev 165087)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-03-05 02:13:16 UTC (rev 165088)
@@ -483,7 +483,7 @@
 
 - (void)_didFinishScrolling
 {
-    [self _updateVisibleContentRectsWithStableState:YES];
+    [self _updateVisibleContentRects];
     [_contentView didFinishScrolling];
 }
 
@@ -506,18 +506,18 @@
 
 - (void)scrollViewDidScroll:(UIScrollView *)scrollView
 {
-    [self _updateVisibleContentRectsWithStableState:NO];
+    [self _updateVisibleContentRects];
 }
 
 - (void)scrollViewDidZoom:(UIScrollView *)scrollView
 {
-    [self _updateVisibleContentRectsWithStableState:NO];
+    [self _updateVisibleContentRects];
 }
 
 - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale
 {
     ASSERT(scrollView == _scrollView);
-    [self _updateVisibleContentRectsWithStableState:YES];
+    [self _updateVisibleContentRects];
     [_contentView didZoomToScale:scale];
 }
 
@@ -529,10 +529,10 @@
         [_contentView setMinimumLayoutSize:bounds.size];
     [_scrollView setFrame:bounds];
     [_contentView setMinimumSize:bounds.size];
-    [self _updateVisibleContentRectsWithStableState:YES];
+    [self _updateVisibleContentRects];
 }
 
-- (void)_updateVisibleContentRectsWithStableState:(BOOL)isStateStable
+- (void)_updateVisibleContentRects
 {
     CGRect fullViewRect = self.bounds;
     CGRect visibleRectInContentCoordinates = [self convertRect:fullViewRect toView:_contentView.get()];
@@ -542,7 +542,8 @@
 
     CGFloat scaleFactor = [_scrollView zoomScale];
 
-    [_contentView didUpdateVisibleRect:visibleRectInContentCoordinates unobscuredRect:unobscuredRectInContentCoordinates scale:scaleFactor inStableState:isStateStable];
+    BOOL isStableState = !(_isChangingObscuredInsetsInteractively || [_scrollView isDragging] || [_scrollView isDecelerating] || [_scrollView isZooming] || [_scrollView isZoomBouncing] || [_scrollView _isAnimatingZoom]);
+    [_contentView didUpdateVisibleRect:visibleRectInContentCoordinates unobscuredRect:unobscuredRectInContentCoordinates scale:scaleFactor inStableState:isStableState];
 }
 
 - (void)_keyboardChangedWithInfo:(NSDictionary *)keyboardInfo adjustScrollView:(BOOL)adjustScrollView
@@ -805,7 +806,7 @@
     ASSERT(obscuredInsets.bottom >= 0);
     ASSERT(obscuredInsets.right >= 0);
     _obscuredInsets = obscuredInsets;
-    [self _updateVisibleContentRectsWithStableState:!_isChangingObscuredInsetsInteractively];
+    [self _updateVisibleContentRects];
 }
 
 - (UIColor *)_pageExtendedBackgroundColor
@@ -837,7 +838,7 @@
 {
     ASSERT(_isChangingObscuredInsetsInteractively);
     _isChangingObscuredInsetsInteractively = NO;
-    [self _updateVisibleContentRectsWithStableState:YES];
+    [self _updateVisibleContentRects];
 }
 
 #else
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to