Title: [219934] branches/safari-604-branch

Diff

Modified: branches/safari-604-branch/LayoutTests/ChangeLog (219933 => 219934)


--- branches/safari-604-branch/LayoutTests/ChangeLog	2017-07-26 09:52:16 UTC (rev 219933)
+++ branches/safari-604-branch/LayoutTests/ChangeLog	2017-07-26 09:52:20 UTC (rev 219934)
@@ -1,5 +1,22 @@
 2017-07-26  Jason Marcell  <[email protected]>
 
+        Cherry-pick r219594. rdar://problem/33523357
+
+    2017-07-17  Timothy Horton  <[email protected]>
+
+            Page using safe area constant properties jumps to correct layout after resize
+            https://bugs.webkit.org/show_bug.cgi?id=174598
+            <rdar://problem/33364275>
+
+            Reviewed by Simon Fraser.
+
+            * fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation-expected.txt: Added.
+            * fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html: Added.
+            Add a test making sure that dynamic-viewport-update-based rotation
+            updates safe area insets when needed.
+
+2017-07-26  Jason Marcell  <[email protected]>
+
         Cherry-pick r219841. rdar://problem/33524930
 
     2017-07-24  Jeremy Jones  <[email protected]>

Added: branches/safari-604-branch/LayoutTests/fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation-expected.txt (0 => 219934)


--- branches/safari-604-branch/LayoutTests/fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation-expected.txt	                        (rev 0)
+++ branches/safari-604-branch/LayoutTests/fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation-expected.txt	2017-07-26 09:52:20 UTC (rev 219934)
@@ -0,0 +1,15 @@
+Before rotation
+layoutViewport: 0, 0 - 320 x 548
+visualViewport: 0, 0 - 320 x 548
+client rect of fixed object:0, 0 - 320 x 548
+
+In resize event handler:
+layoutViewport: 0, 0 - 568 x 320
+visualViewport: 0, 0 - 568 x 320
+client rect of fixed object:100, 50 - 443 x 195
+
+After rotation
+layoutViewport: 0, 0 - 568 x 320
+visualViewport: 0, 0 - 568 x 320
+client rect of fixed object:100, 50 - 443 x 195
+

Added: branches/safari-604-branch/LayoutTests/fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html (0 => 219934)


--- branches/safari-604-branch/LayoutTests/fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html	                        (rev 0)
+++ branches/safari-604-branch/LayoutTests/fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html	2017-07-26 09:52:20 UTC (rev 219934)
@@ -0,0 +1,52 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<head>
+    <meta name="viewport" content="initial-scale=1, viewport-fit=cover">
+    <style>
+        body {
+            height: 2000px;
+        }
+
+        #extent {
+            position: fixed;
+            border: 10px solid rgba(0, 0, 128, 0.5);
+            left: constant(safe-area-inset-left);
+            top: constant(safe-area-inset-top);
+            right: constant(safe-area-inset-right);
+            bottom: constant(safe-area-inset-bottom);
+        }
+    </style>
+    <script src=""
+    <script src=""
+    <script>
+        if (window.internals) {
+            internals.settings.setConstantPropertiesEnabled(true);
+            internals.settings.setViewportFitEnabled(true);
+        }
+
+        function getRotationUIScript()
+        {
+            return `
+            (function() {
+                uiController.setSafeAreaInsets(50, 25, 75, 100);
+                uiController.simulateRotationLikeSafari('landscape-right', function() {
+                    uiController.uiScriptComplete();
+                });
+            })();`
+        }
+        
+        window.addEventListener('resize', function() {
+            accumulateLog('');
+            accumulateLog('In resize event handler:');
+            logFixedAndViewports();
+        }, false);
+
+        window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+    <div id="extent"></div>
+<script src=""
+</body>
+</html>

Modified: branches/safari-604-branch/Source/WebKit/ChangeLog (219933 => 219934)


--- branches/safari-604-branch/Source/WebKit/ChangeLog	2017-07-26 09:52:16 UTC (rev 219933)
+++ branches/safari-604-branch/Source/WebKit/ChangeLog	2017-07-26 09:52:20 UTC (rev 219934)
@@ -1,5 +1,34 @@
 2017-07-26  Jason Marcell  <[email protected]>
 
+        Cherry-pick r219594. rdar://problem/33523357
+
+    2017-07-17  Timothy Horton  <[email protected]>
+
+            Page using safe area constant properties jumps to correct layout after resize
+            https://bugs.webkit.org/show_bug.cgi?id=174598
+            <rdar://problem/33364275>
+
+            Reviewed by Simon Fraser.
+
+            Test: fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html
+
+            * UIProcess/API/Cocoa/WKWebView.mm:
+            (-[WKWebView _beginAnimatedResizeWithUpdates:]):
+            * UIProcess/WebPageProxy.h:
+            * UIProcess/ios/WebPageProxyIOS.mm:
+            (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
+            * WebProcess/WebPage/WebPage.h:
+            * WebProcess/WebPage/WebPage.messages.in:
+            * WebProcess/WebPage/ios/WebPageIOS.mm:
+            (WebKit::WebPage::dynamicViewportSizeUpdate):
+            Plumb unobscured safe area insets through in the dynamicViewportSizeUpdate,
+            like we do in VisibleContentRectUpdate (once again sad that these aren't
+            more similar), so that it will be correct in the during-rotation snapshot,
+            instead of only becoming correct in the first visible content rect update
+            post-rotation.
+
+2017-07-26  Jason Marcell  <[email protected]>
+
         Cherry-pick r219845. rdar://problem/33523884
 
     2017-07-24  Chris Dumez  <[email protected]>

Modified: branches/safari-604-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (219933 => 219934)


--- branches/safari-604-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2017-07-26 09:52:16 UTC (rev 219933)
+++ branches/safari-604-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2017-07-26 09:52:20 UTC (rev 219934)
@@ -4859,7 +4859,10 @@
     CGRect visibleRectInContentCoordinates = [self convertRect:newBounds toView:_contentView.get()];
     CGRect unobscuredRectInContentCoordinates = [self convertRect:futureUnobscuredRectInSelfCoordinates toView:_contentView.get()];
 
-    _page->dynamicViewportSizeUpdate(newMinimumLayoutSize, newMaximumUnobscuredSize, visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, futureUnobscuredRectInSelfCoordinates, targetScale, newOrientation);
+    UIEdgeInsets unobscuredSafeAreaInsets = [self _computedUnobscuredSafeAreaInset];
+    WebCore::FloatBoxExtent unobscuredSafeAreaInsetsExtent(unobscuredSafeAreaInsets.top, unobscuredSafeAreaInsets.right, unobscuredSafeAreaInsets.bottom, unobscuredSafeAreaInsets.left);
+
+    _page->dynamicViewportSizeUpdate(newMinimumLayoutSize, newMaximumUnobscuredSize, visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, futureUnobscuredRectInSelfCoordinates, unobscuredSafeAreaInsetsExtent, targetScale, newOrientation);
     if (WebKit::DrawingAreaProxy* drawingArea = _page->drawingArea())
         drawingArea->setSize(WebCore::IntSize(newBounds.size), WebCore::IntSize(), WebCore::IntSize());
 }

Modified: branches/safari-604-branch/Source/WebKit/UIProcess/WebPageProxy.h (219933 => 219934)


--- branches/safari-604-branch/Source/WebKit/UIProcess/WebPageProxy.h	2017-07-26 09:52:16 UTC (rev 219933)
+++ branches/safari-604-branch/Source/WebKit/UIProcess/WebPageProxy.h	2017-07-26 09:52:20 UTC (rev 219934)
@@ -499,7 +499,7 @@
     void overflowScrollWillStartScroll();
     void overflowScrollDidEndScroll();
 
-    void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, double targetScale, int32_t deviceOrientation);
+    void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation);
     void synchronizeDynamicViewportUpdate();
 
     void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&);

Modified: branches/safari-604-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (219933 => 219934)


--- branches/safari-604-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2017-07-26 09:52:16 UTC (rev 219933)
+++ branches/safari-604-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2017-07-26 09:52:20 UTC (rev 219934)
@@ -287,7 +287,7 @@
     m_pageClient.overflowScrollDidEndScroll();
 }
 
-void WebPageProxy::dynamicViewportSizeUpdate(const FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const FloatRect& targetUnobscuredRectInScrollViewCoordinates,  double targetScale, int32_t deviceOrientation)
+void WebPageProxy::dynamicViewportSizeUpdate(const FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation)
 {
     if (!isValid())
         return;
@@ -296,7 +296,7 @@
 
     m_dynamicViewportSizeUpdateWaitingForTarget = true;
     m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = true;
-    m_process->send(Messages::WebPage::DynamicViewportSizeUpdate(minimumLayoutSize, maximumUnobscuredSize, targetExposedContentRect, targetUnobscuredRect, targetUnobscuredRectInScrollViewCoordinates, targetScale, deviceOrientation, ++m_currentDynamicViewportSizeUpdateID), m_pageID);
+    m_process->send(Messages::WebPage::DynamicViewportSizeUpdate(minimumLayoutSize, maximumUnobscuredSize, targetExposedContentRect, targetUnobscuredRect, targetUnobscuredRectInScrollViewCoordinates, unobscuredSafeAreaInsets, targetScale, deviceOrientation, ++m_currentDynamicViewportSizeUpdateID), m_pageID);
 }
 
 void WebPageProxy::synchronizeDynamicViewportUpdate()

Modified: branches/safari-604-branch/Source/WebKit/WebProcess/WebPage/WebPage.h (219933 => 219934)


--- branches/safari-604-branch/Source/WebKit/WebProcess/WebPage/WebPage.h	2017-07-26 09:52:16 UTC (rev 219933)
+++ branches/safari-604-branch/Source/WebKit/WebProcess/WebPage/WebPage.h	2017-07-26 09:52:20 UTC (rev 219934)
@@ -825,7 +825,7 @@
     void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&);
     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
     void setDeviceOrientation(int32_t);
-    void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID);
+    void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID);
     void synchronizeDynamicViewportUpdate(double& newTargetScale, WebCore::FloatPoint& newScrollPosition, uint64_t& nextValidLayerTreeTransactionID);
     std::optional<float> scaleFromUIProcess(const VisibleContentRectUpdateInfo&) const;
     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, MonotonicTime oldestTimestamp);

Modified: branches/safari-604-branch/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (219933 => 219934)


--- branches/safari-604-branch/Source/WebKit/WebProcess/WebPage/WebPage.messages.in	2017-07-26 09:52:16 UTC (rev 219933)
+++ branches/safari-604-branch/Source/WebKit/WebProcess/WebPage/WebPage.messages.in	2017-07-26 09:52:20 UTC (rev 219934)
@@ -43,7 +43,7 @@
     SetViewportConfigurationMinimumLayoutSize(WebCore::FloatSize size)
     SetMaximumUnobscuredSize(WebCore::FloatSize size)
     SetDeviceOrientation(int32_t deviceOrientation)
-    DynamicViewportSizeUpdate(WebCore::FloatSize minimumLayoutSize, WebCore::FloatSize maximumUnobscuredSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, WebCore::FloatRect targetUnobscuredRectInScrollViewCoordinates, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID)
+    DynamicViewportSizeUpdate(WebCore::FloatSize minimumLayoutSize, WebCore::FloatSize maximumUnobscuredSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, WebCore::FloatRect targetUnobscuredRectInScrollViewCoordinates, WebCore::BoxExtent<float> targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID)
     SynchronizeDynamicViewportUpdate() -> (double newTargetScale, WebCore::FloatPoint newScrollPosition, uint64_t nextValidLayerTreeTransactionID)
 
     HandleTap(WebCore::IntPoint point, uint64_t lastLayerTreeTransactionId)

Modified: branches/safari-604-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (219933 => 219934)


--- branches/safari-604-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2017-07-26 09:52:16 UTC (rev 219933)
+++ branches/safari-604-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2017-07-26 09:52:20 UTC (rev 219934)
@@ -2856,7 +2856,7 @@
     }
 }
 
-void WebPage::dynamicViewportSizeUpdate(const FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, double targetScale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID)
+void WebPage::dynamicViewportSizeUpdate(const FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID)
 {
     SetForScope<bool> dynamicSizeUpdateGuard(m_inDynamicSizeUpdate, true);
     // FIXME: this does not handle the cases where the content would change the content size or scroll position from _javascript_.
@@ -2900,6 +2900,7 @@
         resetTextAutosizing();
 
     setMaximumUnobscuredSize(maximumUnobscuredSize);
+    m_page->setUnobscuredSafeAreaInsets(targetUnobscuredSafeAreaInsets);
 
     frameView.updateLayoutAndStyleIfNeededRecursive();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to