Title: [227654] branches/safari-605-branch

Diff

Modified: branches/safari-605-branch/LayoutTests/ChangeLog (227653 => 227654)


--- branches/safari-605-branch/LayoutTests/ChangeLog	2018-01-26 05:02:53 UTC (rev 227653)
+++ branches/safari-605-branch/LayoutTests/ChangeLog	2018-01-26 05:02:57 UTC (rev 227654)
@@ -1,3 +1,18 @@
+2018-01-25  Jason Marcell  <[email protected]>
+
+        Cherry-pick r227430. rdar://problem/36873610
+
+    2018-01-23  Simon Fraser  <[email protected]>
+
+            Element with position:fixed stops scrolling at the bottom of the page, but is painted in the right place on Chacos.com.
+            https://bugs.webkit.org/show_bug.cgi?id=181741
+            rdar://problem/36593581
+
+            Reviewed by Tim Horton.
+
+            * fast/visual-viewport/ios/min-scale-greater-than-one-expected.txt: Added.
+            * fast/visual-viewport/ios/min-scale-greater-than-one.html: Added.
+
 2018-01-25  Ryan Haddad  <[email protected]>
 
         Cherry-pick r227421. rdar://problem/36837397

Added: branches/safari-605-branch/LayoutTests/fast/visual-viewport/ios/min-scale-greater-than-one-expected.txt (0 => 227654)


--- branches/safari-605-branch/LayoutTests/fast/visual-viewport/ios/min-scale-greater-than-one-expected.txt	                        (rev 0)
+++ branches/safari-605-branch/LayoutTests/fast/visual-viewport/ios/min-scale-greater-than-one-expected.txt	2018-01-26 05:02:57 UTC (rev 227654)
@@ -0,0 +1,10 @@
+PASS Math.round(boundingClientRect.top) is expectedTop
+Scrolling to bottom
+PASS window.scrollY is expectedTop
+PASS Math.round(boundingClientRect.top) is expectedTop
+Tap dispatched
+Target clicked
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: branches/safari-605-branch/LayoutTests/fast/visual-viewport/ios/min-scale-greater-than-one.html (0 => 227654)


--- branches/safari-605-branch/LayoutTests/fast/visual-viewport/ios/min-scale-greater-than-one.html	                        (rev 0)
+++ branches/safari-605-branch/LayoutTests/fast/visual-viewport/ios/min-scale-greater-than-one.html	2018-01-26 05:02:57 UTC (rev 227654)
@@ -0,0 +1,83 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<head>
+    <meta name="viewport" content="width=256, initial-scale=1.25">
+    <script src=""
+    <script src=""
+    <script>
+        jsTestIsAsync = true;
+
+        function scrollToBottom(offsetTop)
+        {
+            return `(function() {
+                uiController.immediateScrollToOffset(0, ${offsetTop});
+                uiController.doAfterPresentationUpdate(function() {
+                    uiController.uiScriptComplete();
+                });
+            })()`;
+        }
+
+        var boundingClientRect;
+        var expectedTop;
+        function checkBoundingClientRect(top)
+        {
+            var target = document.getElementById('target');
+            boundingClientRect = target.getBoundingClientRect();
+            expectedTop = top;
+            shouldBe('Math.round(boundingClientRect.top)', 'expectedTop');
+        }
+        
+        function targetClicked()
+        {
+            debug('Target clicked');
+            finishJSTest();
+        }
+
+        function doTest()
+        {
+            var scale = 320 / 250;
+
+            checkBoundingClientRect(300);
+            debug('Scrolling to bottom');
+            testRunner.runUIScript(scrollToBottom(2000), function() {
+
+                expectedTop = 1578;
+                shouldBe('window.scrollY', 'expectedTop');
+                checkBoundingClientRect(300);
+                
+                // Tap coordinates are document coordinates.
+                var top = window.scrollY + 300 + 10;
+                UIHelper.tapAt(50, top).then(() => {
+                    debug('Tap dispatched');
+                    setTimeout(function watchdog() {
+                        debug('Failed to receive click');
+                        finishJSTest();
+                    }, 400);
+                });
+            });
+        }
+
+        window.addEventListener('load', doTest, false);
+    </script>
+    <style>
+        body {
+            height: 2000px;
+        }
+        #target {
+            position: fixed;
+            top: 300px;
+            left: 20px;
+            width: 120px;
+            height: 100px;
+            background-color: gray;
+        }
+    </style>
+</head>
+<body>
+    
+    <div id="target" _onclick_="targetClicked()"></div>
+
+    <script src=""
+</body>
+</html>

Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (227653 => 227654)


--- branches/safari-605-branch/Source/WebCore/ChangeLog	2018-01-26 05:02:53 UTC (rev 227653)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog	2018-01-26 05:02:57 UTC (rev 227654)
@@ -1,3 +1,24 @@
+2018-01-25  Jason Marcell  <[email protected]>
+
+        Cherry-pick r227430. rdar://problem/36873610
+
+    2018-01-23  Simon Fraser  <[email protected]>
+
+            Element with position:fixed stops scrolling at the bottom of the page, but is painted in the right place on Chacos.com.
+            https://bugs.webkit.org/show_bug.cgi?id=181741
+            rdar://problem/36593581
+
+            Reviewed by Tim Horton.
+
+            The #ifdef for iOS was wrong; on iOS, visibleSize() is in content coordinates and matches
+            unscaledDocumentRect, so there's no need to scale it. Doing so computed the wrong unscaledMaximumScrollPosition
+            which broke hit-testing when the document minimum scale was > 1.
+
+            Test: fast/visual-viewport/ios/min-scale-greater-than-one.html
+
+            * page/FrameView.cpp:
+            (WebCore::FrameView::unscaledMaximumScrollPosition const):
+
 2018-01-24  Jason Marcell  <[email protected]>
 
         Cherry-pick r227581. rdar://problem/36846010

Modified: branches/safari-605-branch/Source/WebCore/page/FrameView.cpp (227653 => 227654)


--- branches/safari-605-branch/Source/WebCore/page/FrameView.cpp	2018-01-26 05:02:53 UTC (rev 227653)
+++ branches/safari-605-branch/Source/WebCore/page/FrameView.cpp	2018-01-26 05:02:57 UTC (rev 227654)
@@ -1929,12 +1929,7 @@
     if (RenderView* renderView = this->renderView()) {
         IntRect unscaledDocumentRect = renderView->unscaledDocumentRect();
         unscaledDocumentRect.expand(0, headerHeight() + footerHeight());
-        IntSize visibleSize = this->visibleSize();
-#if PLATFORM(IOS)
-        // FIXME: visibleSize() is the unscaled size on macOS, but the scaled size on iOS. This should be consistent. webkit.org/b/174648.
-        visibleSize.scale(visibleContentScaleFactor());
-#endif        
-        ScrollPosition maximumPosition = ScrollPosition(unscaledDocumentRect.maxXMaxYCorner() - visibleSize).expandedTo({ 0, 0 });
+        ScrollPosition maximumPosition = ScrollPosition(unscaledDocumentRect.maxXMaxYCorner() - visibleSize()).expandedTo({ 0, 0 });
         if (frame().isMainFrame() && m_scrollPinningBehavior == PinToTop)
             maximumPosition.setY(unscaledMinimumScrollPosition().y());
 

Modified: branches/safari-605-branch/Tools/ChangeLog (227653 => 227654)


--- branches/safari-605-branch/Tools/ChangeLog	2018-01-26 05:02:53 UTC (rev 227653)
+++ branches/safari-605-branch/Tools/ChangeLog	2018-01-26 05:02:57 UTC (rev 227654)
@@ -1,3 +1,21 @@
+2018-01-25  Jason Marcell  <[email protected]>
+
+        Cherry-pick r227430. rdar://problem/36873610
+
+    2018-01-23  Simon Fraser  <[email protected]>
+
+            Element with position:fixed stops scrolling at the bottom of the page, but is painted in the right place on Chacos.com.
+            https://bugs.webkit.org/show_bug.cgi?id=181741
+            rdar://problem/36593581
+
+            Reviewed by Tim Horton.
+
+            If zoomToScale:animated: is called with the current zoom level, call the callback
+            rather than doing nothing.
+
+            * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
+            (-[TestRunnerWKWebView zoomToScale:animated:completionHandler:]):
+
 2018-01-24  Jason Marcell  <[email protected]>
 
         Cherry-pick r227527. rdar://problem/36830339

Modified: branches/safari-605-branch/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm (227653 => 227654)


--- branches/safari-605-branch/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm	2018-01-26 05:02:53 UTC (rev 227653)
+++ branches/safari-605-branch/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm	2018-01-26 05:02:57 UTC (rev 227654)
@@ -129,6 +129,13 @@
     ASSERT(!self.zoomToScaleCompletionHandler);
     self.zoomToScaleCompletionHandler = completionHandler;
 
+    if (self.scrollView.zoomScale == scale) {
+        dispatch_async(dispatch_get_main_queue(), ^{
+            completionHandler();
+        });
+        return;
+    }
+
     [self.scrollView setZoomScale:scale animated:animated];
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to