Title: [171080] trunk/Source/WebKit2
- Revision
- 171080
- Author
- [email protected]
- Date
- 2014-07-14 14:07:43 -0700 (Mon, 14 Jul 2014)
Log Message
[iOS][WK2] On rotation, RemoteLayerTreeDrawingArea renders one extra frame at the wrong orientation
https://bugs.webkit.org/show_bug.cgi?id=134875
Reviewed by Tim Horton.
On animated resize, the size of the DrawingAreaProxy was changed before the layout parameters were
changed. This in turn caused the WebProcess's DrawingArea to flush the layer tree while still
at the wrong orientation.
This patch fixes the issue by making a special case for animated resize:
-While starting animated resize, _frameOrBoundsChanged can be called several times in response to
the API's client changing the WKWebView. In that case, we do not update the drawing area.
-After the "updateBlock" is executed and the size have been changed, the dynamic viewport update
is computed, the dynamicViewportSizeUpdate is sent to the WebProcess, followed by the message
DrawingArea::updateGeometry(). Since both messages are asynchronous, they are received in that
order, and the updateGeometry() is always done after the viewport configuration has been updated.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView setMinimumSize:]): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (171079 => 171080)
--- trunk/Source/WebKit2/ChangeLog 2014-07-14 21:06:02 UTC (rev 171079)
+++ trunk/Source/WebKit2/ChangeLog 2014-07-14 21:07:43 UTC (rev 171080)
@@ -1,3 +1,29 @@
+2014-07-14 Benjamin Poulain <[email protected]>
+
+ [iOS][WK2] On rotation, RemoteLayerTreeDrawingArea renders one extra frame at the wrong orientation
+ https://bugs.webkit.org/show_bug.cgi?id=134875
+
+ Reviewed by Tim Horton.
+
+ On animated resize, the size of the DrawingAreaProxy was changed before the layout parameters were
+ changed. This in turn caused the WebProcess's DrawingArea to flush the layer tree while still
+ at the wrong orientation.
+
+ This patch fixes the issue by making a special case for animated resize:
+ -While starting animated resize, _frameOrBoundsChanged can be called several times in response to
+ the API's client changing the WKWebView. In that case, we do not update the drawing area.
+ -After the "updateBlock" is executed and the size have been changed, the dynamic viewport update
+ is computed, the dynamicViewportSizeUpdate is sent to the WebProcess, followed by the message
+ DrawingArea::updateGeometry(). Since both messages are asynchronous, they are received in that
+ order, and the updateGeometry() is always done after the viewport configuration has been updated.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _frameOrBoundsChanged]):
+ (-[WKWebView _beginAnimatedResizeWithUpdates:]):
+ * UIProcess/ios/WKContentView.h:
+ * UIProcess/ios/WKContentView.mm:
+ (-[WKContentView setMinimumSize:]): Deleted.
+
2014-07-14 Benjamin Poulain <[email protected]>
[iOS][WK2] Fix withinEpsilon()
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (171079 => 171080)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2014-07-14 21:06:02 UTC (rev 171079)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2014-07-14 21:07:43 UTC (rev 171080)
@@ -1309,6 +1309,8 @@
- (void)_frameOrBoundsChanged
{
CGRect bounds = self.bounds;
+ [_scrollView setFrame:bounds];
+
if (!_isAnimatingResize) {
if (!_overridesMinimumLayoutSize)
_page->setViewportConfigurationMinimumLayoutSize(WebCore::FloatSize(bounds.size));
@@ -1316,10 +1318,9 @@
_page->setViewportConfigurationMinimumLayoutSizeForMinimalUI(WebCore::FloatSize(bounds.size));
if (!_overridesMaximumUnobscuredSize)
_page->setMaximumUnobscuredSize(WebCore::FloatSize(bounds.size));
+ _page->drawingArea()->setSize(IntSize(size), IntSize(), IntSize());
}
- [_scrollView setFrame:bounds];
- [_contentView setMinimumSize:bounds.size];
[_customContentView web_setMinimumSize:bounds.size];
[self _updateVisibleContentRects];
}
@@ -2198,6 +2199,7 @@
CGRect unobscuredRectInContentCoordinates = [self convertRect:futureUnobscuredRectInSelfCoordinates toView:_contentView.get()];
_page->dynamicViewportSizeUpdate(newMinimumLayoutSize, newMinimumLayoutSizeForMinimalUI, newMaximumUnobscuredSize, visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, futureUnobscuredRectInSelfCoordinates, targetScale, newOrientation);
+ _page->drawingArea()->setSize(IntSize(newBounds.size), IntSize(), IntSize());
}
- (void)_endAnimatedResize
Modified: trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm (171079 => 171080)
--- trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm 2014-07-14 21:06:02 UTC (rev 171079)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm 2014-07-14 21:07:43 UTC (rev 171080)
@@ -251,7 +251,7 @@
webPageProxy->setMaximumUnobscuredSize(size);
[_scrollView setFrame:bounds];
- [_contentView setMinimumSize:bounds.size];
+ webPageProxy->drawingArea()->setSize(IntSize(bounds.size), IntSize(), IntSize());
[self _updateVisibleContentRects];
}
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.h (171079 => 171080)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.h 2014-07-14 21:06:02 UTC (rev 171079)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.h 2014-07-14 21:07:43 UTC (rev 171080)
@@ -63,7 +63,6 @@
- (instancetype)initWithFrame:(CGRect)frame context:(WebKit::WebContext&)context configuration:(WebKit::WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView;
-- (void)setMinimumSize:(CGSize)size;
- (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect
unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
scale:(CGFloat)scale minimumScale:(CGFloat)minimumScale
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (171079 => 171080)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm 2014-07-14 21:06:02 UTC (rev 171079)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm 2014-07-14 21:07:43 UTC (rev 171080)
@@ -356,11 +356,6 @@
[self updateFixedClippingView:fixedPositionRect];
}
-- (void)setMinimumSize:(CGSize)size
-{
- _page->drawingArea()->setSize(IntSize(size), IntSize(), IntSize());
-}
-
- (void)didFinishScrolling
{
[self _didEndScrollingOrZooming];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes