REGRESSION (r253634): cricbuzz.com media controls vanish depending on page scale
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jan 2020 06:15:09 +0000 (06:15 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jan 2020 06:15:09 +0000 (06:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=206788
rdar://problem/58780584

Reviewed by Tim Horton.
Source/WebCore:

r253634 changed "delegatesPageScaling"'" to a flag on ScrollView. However, this changed behavior
for subframes; Settings are propagated down, but only the main ScrollView had delegatesPageScaling
set on it.

"delegatesPageScaling" is a page-level thing (subframes don't independently zoom), so it
should live on Page. Move it there.

The bug was triggered by incorrectly taking page scale into account for rects in the compositing
overlap map (see RenderLayerCompositor::addToOverlapMap()) in subframes, and those rects
changing on zoom.

Test: compositing/backing/page-scale-overlap-in-iframe.html

* page/Frame.cpp:
(WebCore::Frame::frameScaleFactor const):
* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
* page/FrameView.cpp:
(WebCore::FrameView::visibleContentScaleFactor const):
* page/Page.cpp:
(WebCore::Page::setPageScaleFactor):
(WebCore::Page::setDelegatesScaling):
* page/Page.h:
(WebCore::Page::delegatesScaling const):
* platform/ScrollView.cpp:
(WebCore::ScrollView::setDelegatesPageScaling): Deleted.
* platform/ScrollView.h:
(WebCore::ScrollView::delegatesPageScaling const): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::addToOverlapMap const):

Source/WebKit:

r253634 changed "delegatesPageScaling"'" to a flag on ScrollView. However, this changed behavior
for subframes; Settings are propagated down, but only the main ScrollView had delegatesPageScaling
set on it.

"delegatesPageScaling" is a page-level thing (subframes don't independently zoom), so it
should live on Page. Move it there.

The bug was triggered by incorrectly taking page scale into account for rects in the compositing
overlap map (see RenderLayerCompositor::addToOverlapMap()) in subframes, and those rects
changing on zoom.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindIndicatorOverlayClientIOS::drawRect):

Source/WebKitLegacy/mac:

r253634 changed "delegatesPageScaling"'" to a flag on ScrollView. However, this changed behavior
for subframes; Settings are propagated down, but only the main ScrollView had delegatesPageScaling
set on it.

"delegatesPageScaling" is a page-level thing (subframes don't independently zoom), so it
should live on Page. Move it there.

The bug was triggered by incorrectly taking page scale into account for rects in the compositing
overlap map (see RenderLayerCompositor::addToOverlapMap()) in subframes, and those rects
changing on zoom.

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::transitionToCommittedForNewPage):

LayoutTests:

Test only really makes sense on iOS where the viewport tag is respected, but include
macOS results instead of skipping.

* compositing/backing/page-scale-overlap-in-iframe-expected.txt: Added.
* compositing/backing/page-scale-overlap-in-iframe.html: Added.
* platform/ios-wk2/compositing/backing/page-scale-overlap-in-iframe-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255226 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/backing/page-scale-overlap-in-iframe-expected.txt [new file with mode: 0644]
LayoutTests/compositing/backing/page-scale-overlap-in-iframe.html [new file with mode: 0644]
LayoutTests/platform/ios-wk2/compositing/backing/page-scale-overlap-in-iframe-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/Frame.cpp
Source/WebCore/page/FrameSnapshotting.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollView.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm

index 75a1763..faf7b1a 100644 (file)
@@ -1,3 +1,18 @@
+2020-01-27  Simon Fraser  <simon.fraser@apple.com>
+
+        REGRESSION (r253634): cricbuzz.com media controls vanish depending on page scale
+        https://bugs.webkit.org/show_bug.cgi?id=206788
+        rdar://problem/58780584
+
+        Reviewed by Tim Horton.
+
+        Test only really makes sense on iOS where the viewport tag is respected, but include
+        macOS results instead of skipping.
+
+        * compositing/backing/page-scale-overlap-in-iframe-expected.txt: Added.
+        * compositing/backing/page-scale-overlap-in-iframe.html: Added.
+        * platform/ios-wk2/compositing/backing/page-scale-overlap-in-iframe-expected.txt: Added.
+
 2020-01-27  Ryosuke Niwa  <rniwa@webkit.org>
 
         http/tests/loading/remove-child-triggers-parser.html is flaky
diff --git a/LayoutTests/compositing/backing/page-scale-overlap-in-iframe-expected.txt b/LayoutTests/compositing/backing/page-scale-overlap-in-iframe-expected.txt
new file mode 100644 (file)
index 0000000..c83e128
--- /dev/null
@@ -0,0 +1,80 @@
+
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (backingStoreAttached 1)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (backingStoreAttached 1)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 302.00 152.00)
+          (drawsContent 1)
+          (backingStoreAttached 1)
+          (children 1
+            (GraphicsLayer
+              (position 1.00 1.00)
+              (backingStoreAttached 0)
+              (children 1
+                (GraphicsLayer
+                  (anchor 0.00 0.00)
+                  (bounds 300.00 150.00)
+                  (backingStoreAttached 1)
+                  (children 1
+                    (GraphicsLayer
+                      (anchor 0.00 0.00)
+                      (backingStoreAttached 0)
+                      (children 1
+                        (GraphicsLayer
+                          (anchor 0.00 0.00)
+                          (bounds 300.00 150.00)
+                          (backingStoreAttached 1)
+                          (children 1
+                            (GraphicsLayer
+                              (bounds 300.00 150.00)
+                              (drawsContent 1)
+                              (backingStoreAttached 1)
+                              (children 2
+                                (GraphicsLayer
+                                  (bounds 300.00 150.00)
+                                  (backingStoreAttached 1)
+                                  (children 1
+                                    (GraphicsLayer
+                                      (bounds 300.00 150.00)
+                                      (backingStoreAttached 1)
+                                    )
+                                  )
+                                )
+                                (GraphicsLayer
+                                  (bounds 300.00 150.00)
+                                  (backingStoreAttached 1)
+                                  (children 1
+                                    (GraphicsLayer
+                                      (position 0.00 109.00)
+                                      (bounds 300.00 41.00)
+                                      (contentsOpaque 1)
+                                      (drawsContent 1)
+                                      (backingStoreAttached 1)
+                                    )
+                                  )
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/compositing/backing/page-scale-overlap-in-iframe.html b/LayoutTests/compositing/backing/page-scale-overlap-in-iframe.html
new file mode 100644 (file)
index 0000000..e64da3d
--- /dev/null
@@ -0,0 +1,61 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+<html>
+<head>
+    <meta name="viewport" content="width=800">
+    <style>
+        iframe {
+            border: 1px solid black;
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        function dumpLayers()
+        {
+            var layersResult = document.getElementById('layers');
+            if (window.testRunner)
+                layersResult.innerText = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED);
+        }
+
+        window.addEventListener('load', dumpLayers, false);
+    </script>
+</head>
+<body>
+    <iframe srcdoc="
+        <style>
+            html, body {
+                height: 100%;
+                width: 100%;
+                margin: 0;
+            }
+            .container {
+                position: relative;
+                width: 100%;
+                height: 100%;
+                overflow: hidden;
+            }
+            .media {
+                position: absolute;
+                width: 100%;
+                height: 100%;
+                will-change: transform;
+                background-color: rgba(255, 1255, 255, 0.75);
+            }
+            .bar {
+                position: absolute;
+                left: 0;
+                bottom: 0;
+                width: 100%;
+                height: 41px;
+                background-color: gray;
+            }
+        </style>
+        <div class=container>
+            <div class=media></div>
+            <div class=bar>This layer should be in front</div>
+        </div>
+    "></iframe>
+<pre id="layers"></pre>
+</body>
+</html>
diff --git a/LayoutTests/platform/ios-wk2/compositing/backing/page-scale-overlap-in-iframe-expected.txt b/LayoutTests/platform/ios-wk2/compositing/backing/page-scale-overlap-in-iframe-expected.txt
new file mode 100644 (file)
index 0000000..5e4aa2b
--- /dev/null
@@ -0,0 +1,67 @@
+
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 1370.00)
+  (backingStoreAttached 1)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 1370.00)
+      (contentsOpaque 1)
+      (backingStoreAttached 1)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 302.00 152.00)
+          (drawsContent 1)
+          (backingStoreAttached 1)
+          (children 1
+            (GraphicsLayer
+              (position 1.00 1.00)
+              (backingStoreAttached 0)
+              (children 1
+                (GraphicsLayer
+                  (anchor 0.00 0.00)
+                  (bounds 300.00 150.00)
+                  (backingStoreAttached 1)
+                  (children 1
+                    (GraphicsLayer
+                      (anchor 0.00 0.00)
+                      (backingStoreAttached 0)
+                      (children 1
+                        (GraphicsLayer
+                          (anchor 0.00 0.00)
+                          (bounds 300.00 150.00)
+                          (backingStoreAttached 1)
+                          (children 1
+                            (GraphicsLayer
+                              (bounds 300.00 150.00)
+                              (drawsContent 1)
+                              (backingStoreAttached 1)
+                              (children 1
+                                (GraphicsLayer
+                                  (bounds 300.00 150.00)
+                                  (backingStoreAttached 1)
+                                  (children 1
+                                    (GraphicsLayer
+                                      (bounds 300.00 150.00)
+                                      (backingStoreAttached 1)
+                                    )
+                                  )
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
index 0269f87..4f4fcc0 100644 (file)
@@ -1,3 +1,42 @@
+2020-01-27  Simon Fraser  <simon.fraser@apple.com>
+
+        REGRESSION (r253634): cricbuzz.com media controls vanish depending on page scale
+        https://bugs.webkit.org/show_bug.cgi?id=206788
+        rdar://problem/58780584
+
+        Reviewed by Tim Horton.
+        
+        r253634 changed "delegatesPageScaling"'" to a flag on ScrollView. However, this changed behavior
+        for subframes; Settings are propagated down, but only the main ScrollView had delegatesPageScaling
+        set on it.
+        
+        "delegatesPageScaling" is a page-level thing (subframes don't independently zoom), so it
+        should live on Page. Move it there.
+        
+        The bug was triggered by incorrectly taking page scale into account for rects in the compositing
+        overlap map (see RenderLayerCompositor::addToOverlapMap()) in subframes, and those rects
+        changing on zoom.
+
+        Test: compositing/backing/page-scale-overlap-in-iframe.html
+
+        * page/Frame.cpp:
+        (WebCore::Frame::frameScaleFactor const):
+        * page/FrameSnapshotting.cpp:
+        (WebCore::snapshotFrameRectWithClip):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::visibleContentScaleFactor const):
+        * page/Page.cpp:
+        (WebCore::Page::setPageScaleFactor):
+        (WebCore::Page::setDelegatesScaling):
+        * page/Page.h:
+        (WebCore::Page::delegatesScaling const):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::setDelegatesPageScaling): Deleted.
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::delegatesPageScaling const): Deleted.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::addToOverlapMap const):
+
 2020-01-27  Sam Weinig  <weinig@apple.com>
 
         Need a way to mark a DOM attribute as runtime conditionally read-write
index 6f434d9..9e6b7fe 100644 (file)
@@ -922,10 +922,8 @@ float Frame::frameScaleFactor() const
     if (!page || !isMainFrame())
         return 1;
 
-    if (FrameView* view = this->view()) {
-        if (view->delegatesPageScaling())
-            return 1;
-    }
+    if (page->delegatesScaling())
+        return 1;
 
     return page->pageScaleFactor();
 }
index e24d92e..7358778 100644 (file)
@@ -105,7 +105,7 @@ std::unique_ptr<ImageBuffer> snapshotFrameRectWithClip(Frame& frame, const IntRe
 
     float scaleFactor = frame.page()->deviceScaleFactor();
 
-    if (frame.view()->delegatesPageScaling())
+    if (frame.page()->delegatesScaling())
         scaleFactor *= frame.page()->pageScaleFactor();
 
     if (options & SnapshotOptionsPaintWithIntegralScaleFactor)
index 0a528e6..7cca9f7 100644 (file)
@@ -3707,12 +3707,13 @@ void FrameView::invalidateScrollbarRect(Scrollbar& scrollbar, const IntRect& rec
 
 float FrameView::visibleContentScaleFactor() const
 {
-    // FIXME: This !delegatesPageScaling() is confusing. This function should probably be renamed to delegatedPageScaleFactor().
-    if (!frame().isMainFrame() || !delegatesPageScaling())
+    if (!frame().isMainFrame())
         return 1;
 
     Page* page = frame().page();
-    if (!page)
+    // FIXME: This !delegatesScaling() is confusing, and the opposite behavior to Frame::frameScaleFactor().
+    // This function should probably be renamed to delegatedPageScaleFactor().
+    if (!page || !page->delegatesScaling())
         return 1;
 
     return page->pageScaleFactor();
index 4f8cf25..23accc0 100644 (file)
@@ -1034,12 +1034,12 @@ void Page::setPageScaleFactor(float scale, const IntPoint& origin, bool inStable
     RefPtr<FrameView> view = document->view();
 
     if (scale == m_pageScaleFactor) {
-        if (view && view->scrollPosition() != origin && !view->delegatesPageScaling())
+        if (view && view->scrollPosition() != origin && !delegatesScaling())
             document->updateLayoutIgnorePendingStylesheets();
     } else {
         m_pageScaleFactor = scale;
 
-        if (view && !view->delegatesPageScaling()) {
+        if (view && !delegatesScaling()) {
             view->setNeedsLayoutAfterViewConfigurationChange();
             view->setNeedsCompositingGeometryUpdate();
 
@@ -1054,7 +1054,7 @@ void Page::setPageScaleFactor(float scale, const IntPoint& origin, bool inStable
         if (view && view->fixedElementsLayoutRelativeToFrame())
             view->setViewportConstrainedObjectsNeedLayout();
 
-        if (view && view->scrollPosition() != origin && !view->delegatesPageScaling() && document->renderView() && document->renderView()->needsLayout() && view->didFirstLayout())
+        if (view && view->scrollPosition() != origin && !delegatesScaling() && document->renderView() && document->renderView()->needsLayout() && view->didFirstLayout())
             view->layoutContext().layout();
     }
 
@@ -1078,6 +1078,11 @@ void Page::setPageScaleFactor(float scale, const IntPoint& origin, bool inStable
 #endif
 }
 
+void Page::setDelegatesScaling(bool delegatesScaling)
+{
+    m_delegatesScaling = delegatesScaling;
+}
+
 void Page::setViewScaleFactor(float scale)
 {
     if (m_viewScaleFactor == scale)
index f1ae43f..62bcf09 100644 (file)
@@ -336,6 +336,9 @@ public:
     void didStartProvisionalLoad();
     void didFinishLoad(); // Called when the load has been committed in the main frame.
 
+    bool delegatesScaling() const { return m_delegatesScaling; }
+    WEBCORE_EXPORT void setDelegatesScaling(bool);
+
     // The view scale factor is multiplied into the page scale factor by all
     // callers of setPageScaleFactor.
     WEBCORE_EXPORT void setViewScaleFactor(float);
@@ -951,6 +954,13 @@ private:
     bool m_controlledByAutomation { false };
     bool m_resourceCachingDisabledByWebInspector { false };
     bool m_isUtilityPage;
+    bool m_shouldEnableICECandidateFilteringByDefault { true };
+    bool m_mediaPlaybackIsSuspended { false };
+    bool m_mediaBufferingIsSuspended { false };
+    bool m_inUpdateRendering { false };
+    bool m_hasResourceLoadClient { false };
+    bool m_delegatesScaling { false };
+
     UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { UserInterfaceLayoutDirection::LTR };
     
     // For testing.
@@ -992,11 +1002,6 @@ private:
     RefPtr<DeviceOrientationUpdateProvider> m_deviceOrientationUpdateProvider;
 #endif
 
-    bool m_shouldEnableICECandidateFilteringByDefault { true };
-    bool m_mediaPlaybackIsSuspended { false };
-    bool m_mediaBufferingIsSuspended { false };
-    bool m_inUpdateRendering { false };
-    bool m_hasResourceLoadClient { false };
     Vector<UserContentURLPattern> m_corsDisablingPatterns;
     OptionSet<ThrottlingReason> m_throttlingReasons;
 };
index ca3bdd0..dd08336 100644 (file)
@@ -197,11 +197,6 @@ void ScrollView::setDelegatesScrolling(bool delegatesScrolling)
     delegatesScrollingDidChange();
 }
 
-void ScrollView::setDelegatesPageScaling(bool delegatesPageScaling)
-{
-    m_delegatesPageScaling = delegatesPageScaling;
-}
-
 IntPoint ScrollView::contentsScrollPosition() const
 {
 #if PLATFORM(IOS_FAMILY)
index ea80214..dfbecef 100644 (file)
@@ -136,9 +136,6 @@ public:
     bool delegatesScrolling() const { return m_delegatesScrolling; }
     WEBCORE_EXPORT void setDelegatesScrolling(bool);
 
-    bool delegatesPageScaling() const { return m_delegatesPageScaling; }
-    WEBCORE_EXPORT void setDelegatesPageScaling(bool);
-
     // Overridden by FrameView to create custom CSS scrollbars if applicable.
     virtual Ref<Scrollbar> createScrollbar(ScrollbarOrientation);
 
@@ -542,7 +539,6 @@ private:
 
     bool m_paintsEntireContents { false };
     bool m_delegatesScrolling { false };
-    bool m_delegatesPageScaling { false };
 
 }; // class ScrollView
 
index 4e92e6e..43dbac0 100644 (file)
@@ -1908,8 +1908,7 @@ void RenderLayerCompositor::addToOverlapMap(LayerOverlapMap& overlapMap, const R
     auto clippedBounds = extent.bounds;
     if (!clipRect.isInfinite()) {
         // With delegated page scaling, pageScaleFactor() is not applied by RenderView, so we should not scale here.
-        auto& frameView = m_renderView.frameView();
-        if (!frameView.delegatesPageScaling())
+        if (!page().delegatesScaling())
             clipRect.scale(pageScaleFactor());
 
         clippedBounds.intersect(clipRect);
index 6ab6542..fc61854 100644 (file)
@@ -1,3 +1,27 @@
+2020-01-27  Simon Fraser  <simon.fraser@apple.com>
+
+        REGRESSION (r253634): cricbuzz.com media controls vanish depending on page scale
+        https://bugs.webkit.org/show_bug.cgi?id=206788
+        rdar://problem/58780584
+
+        Reviewed by Tim Horton.
+
+        r253634 changed "delegatesPageScaling"'" to a flag on ScrollView. However, this changed behavior
+        for subframes; Settings are propagated down, but only the main ScrollView had delegatesPageScaling
+        set on it.
+        
+        "delegatesPageScaling" is a page-level thing (subframes don't independently zoom), so it
+        should live on Page. Move it there.
+        
+        The bug was triggered by incorrectly taking page scale into account for rects in the compositing
+        overlap map (see RenderLayerCompositor::addToOverlapMap()) in subframes, and those rects
+        changing on zoom.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
+        * WebProcess/WebPage/ios/FindControllerIOS.mm:
+        (WebKit::FindIndicatorOverlayClientIOS::drawRect):
+
 2020-01-27  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [WinCairo][curl] ASSERTION FAILED: sessionID != PAL::SessionID::defaultSessionID() in WebKit::CacheStorage::Engine::destroyEngine since r255137
index e01e82c..62ff60a 100644 (file)
@@ -1527,10 +1527,10 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
 #if PLATFORM(COCOA)
     auto* drawingArea = webPage->drawingArea();
     view->setViewExposedRect(drawingArea->viewExposedRect());
-    if (isMainFrame) {
+    if (isMainFrame)
         view->setDelegatesScrolling(drawingArea->usesDelegatedScrolling());
-        view->setDelegatesPageScaling(drawingArea->usesDelegatedPageScaling());
-    }
+
+    webPage->corePage()->setDelegatesScaling(drawingArea->usesDelegatedPageScaling());
 #endif
 
     if (webPage->scrollPinningBehavior() != DoNotPin)
index eb14a86..a95d5ca 100644 (file)
@@ -62,7 +62,7 @@ void FindIndicatorOverlayClientIOS::drawRect(PageOverlay& overlay, GraphicsConte
 {
     float scaleFactor = m_frame.page()->deviceScaleFactor();
 
-    if (m_frame.view() && m_frame.view()->delegatesPageScaling())
+    if (m_frame.page()->delegatesScaling())
         scaleFactor *= m_frame.page()->pageScaleFactor();
 
     // If the page scale changed, we need to paint a new TextIndicator.
index c5a28c5..8b8fc2d 100644 (file)
@@ -1,3 +1,25 @@
+2020-01-27  Simon Fraser  <simon.fraser@apple.com>
+
+        REGRESSION (r253634): cricbuzz.com media controls vanish depending on page scale
+        https://bugs.webkit.org/show_bug.cgi?id=206788
+        rdar://problem/58780584
+
+        Reviewed by Tim Horton.
+
+        r253634 changed "delegatesPageScaling"'" to a flag on ScrollView. However, this changed behavior
+        for subframes; Settings are propagated down, but only the main ScrollView had delegatesPageScaling
+        set on it.
+        
+        "delegatesPageScaling" is a page-level thing (subframes don't independently zoom), so it
+        should live on Page. Move it there.
+        
+        The bug was triggered by incorrectly taking page scale into account for rects in the compositing
+        overlap map (see RenderLayerCompositor::addToOverlapMap()) in subframes, and those rects
+        changing on zoom.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::transitionToCommittedForNewPage):
+
 2020-01-27  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: unable to evaluate in the isolated world of content scripts injected by safari app extensions
index eeda3a7..0e5c9ae 100644 (file)
@@ -1468,13 +1468,16 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
     auto coreView = WebCore::FrameView::create(*coreFrame);
     coreFrame->setView(coreView.copyRef());
 
+#if PLATFORM(IOS_FAMILY)
+    page->setDelegatesScaling(true);
+#endif
+
     [m_webFrame.get() _updateBackgroundAndUpdatesWhileOffscreen];
     [m_webFrame->_private->webFrameView _install];
 
     if (isMainFrame) {
 #if PLATFORM(IOS_FAMILY)
         coreView->setDelegatesScrolling(true);
-        coreView->setDelegatesPageScaling(true);
 #endif
         coreView->setParentVisible(true);
     }