Title: [168799] branches/safari-538.34-branch/Source/WebKit2
Diff
Modified: branches/safari-538.34-branch/Source/WebKit2/ChangeLog (168798 => 168799)
--- branches/safari-538.34-branch/Source/WebKit2/ChangeLog 2014-05-14 07:23:35 UTC (rev 168798)
+++ branches/safari-538.34-branch/Source/WebKit2/ChangeLog 2014-05-14 07:26:15 UTC (rev 168799)
@@ -1,5 +1,29 @@
2014-05-14 Lucas Forschler <[email protected]>
+ Merge r168568
+
+ 2014-05-09 Benjamin Poulain <[email protected]>
+
+ [iOS][WK2] Reset the scroll position on the first frame after didCommitLoad
+ https://bugs.webkit.org/show_bug.cgi?id=132765
+
+ Reviewed by Tim Horton.
+
+ Since WebCore does not update our scroll view on load, we need to do that ourself.
+
+ In case where we need to restore the state from the history, RemoteLayerTreeDrawingAreaProxy
+ will always invoke the scrolling after didCommitLayerTree() (since r167916).
+ Consequently, it is now safe again to reset the scroll position ourself on the first frame.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _didCommitLoadForMainFrame]):
+ (-[WKWebView _didCommitLayerTree:WebKit::]):
+ * UIProcess/API/Cocoa/WKWebViewInternal.h:
+ * UIProcess/ios/WKContentView.mm:
+ (-[WKContentView _didCommitLoadForMainFrame]):
+
+2014-05-14 Lucas Forschler <[email protected]>
+
Merge r168566
2014-05-09 Anders Carlsson <[email protected]>
Modified: branches/safari-538.34-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (168798 => 168799)
--- branches/safari-538.34-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2014-05-14 07:23:35 UTC (rev 168798)
+++ branches/safari-538.34-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2014-05-14 07:26:15 UTC (rev 168799)
@@ -114,6 +114,7 @@
UIView *_extendedBackgroundLayerTopInset;
UIView *_extendedBackgroundLayerBottomInset;
+ BOOL _needsResetViewStateAfterCommitLoadForMainFrame;
BOOL _isAnimatingResize;
CATransform3D _resizeAnimationTransformAdjustments;
RetainPtr<UIView> _resizeAnimationView;
@@ -456,6 +457,11 @@
_extendedBackgroundLayerBottomInset.backgroundColor = uiBackgroundColor.get();
}
+- (void)_didCommitLoadForMainFrame
+{
+ _needsResetViewStateAfterCommitLoadForMainFrame = YES;
+}
+
- (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)layerTreeTransaction
{
if (_customContentView)
@@ -477,6 +483,11 @@
if (_gestureController)
_gestureController->setRenderTreeSize(layerTreeTransaction.renderTreeSize());
+
+ if (_needsResetViewStateAfterCommitLoadForMainFrame) {
+ _needsResetViewStateAfterCommitLoadForMainFrame = NO;
+ [_scrollView setContentOffset:CGPointMake(-_obscuredInsets.left, -_obscuredInsets.top)];
+ }
}
- (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition
Modified: branches/safari-538.34-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (168798 => 168799)
--- branches/safari-538.34-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h 2014-05-14 07:23:35 UTC (rev 168798)
+++ branches/safari-538.34-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h 2014-05-14 07:26:15 UTC (rev 168799)
@@ -58,6 +58,7 @@
}
#if PLATFORM(IOS)
+- (void)_didCommitLoadForMainFrame;
- (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)layerTreeTransaction;
- (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition;
Modified: branches/safari-538.34-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm (168798 => 168799)
--- branches/safari-538.34-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm 2014-05-14 07:23:35 UTC (rev 168798)
+++ branches/safari-538.34-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm 2014-05-14 07:26:15 UTC (rev 168799)
@@ -413,6 +413,7 @@
- (void)_didCommitLoadForMainFrame
{
[self _stopAssistingNode];
+ [_webView _didCommitLoadForMainFrame];
}
- (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)layerTreeTransaction
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes