Title: [255627] branches/safari-610.1.1-branch
Revision
255627
Author
[email protected]
Date
2020-02-03 19:08:29 -0800 (Mon, 03 Feb 2020)

Log Message

Cherry-pick r255226. rdar://problem/58780584

    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.
    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

Modified Paths

Added Paths

Diff

Modified: branches/safari-610.1.1-branch/LayoutTests/ChangeLog (255626 => 255627)


--- branches/safari-610.1.1-branch/LayoutTests/ChangeLog	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/LayoutTests/ChangeLog	2020-02-04 03:08:29 UTC (rev 255627)
@@ -1,5 +1,108 @@
 2020-02-03  Russell Epstein  <[email protected]>
 
+        Cherry-pick r255226. rdar://problem/58780584
+
+    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.
+    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
+
+    2020-01-27  Simon Fraser  <[email protected]>
+
+            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-02-03  Russell Epstein  <[email protected]>
+
         Cherry-pick r255058. rdar://problem/58830068
 
     Make sure fetch tasks go to network if service worker never gets to activated

Added: branches/safari-610.1.1-branch/LayoutTests/compositing/backing/page-scale-overlap-in-iframe-expected.txt (0 => 255627)


--- branches/safari-610.1.1-branch/LayoutTests/compositing/backing/page-scale-overlap-in-iframe-expected.txt	                        (rev 0)
+++ branches/safari-610.1.1-branch/LayoutTests/compositing/backing/page-scale-overlap-in-iframe-expected.txt	2020-02-04 03:08:29 UTC (rev 255627)
@@ -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)
+                                    )
+                                  )
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+

Added: branches/safari-610.1.1-branch/LayoutTests/compositing/backing/page-scale-overlap-in-iframe.html (0 => 255627)


--- branches/safari-610.1.1-branch/LayoutTests/compositing/backing/page-scale-overlap-in-iframe.html	                        (rev 0)
+++ branches/safari-610.1.1-branch/LayoutTests/compositing/backing/page-scale-overlap-in-iframe.html	2020-02-04 03:08:29 UTC (rev 255627)
@@ -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>

Added: branches/safari-610.1.1-branch/LayoutTests/platform/ios-wk2/compositing/backing/page-scale-overlap-in-iframe-expected.txt (0 => 255627)


--- branches/safari-610.1.1-branch/LayoutTests/platform/ios-wk2/compositing/backing/page-scale-overlap-in-iframe-expected.txt	                        (rev 0)
+++ branches/safari-610.1.1-branch/LayoutTests/platform/ios-wk2/compositing/backing/page-scale-overlap-in-iframe-expected.txt	2020-02-04 03:08:29 UTC (rev 255627)
@@ -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)
+                                    )
+                                  )
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+

Modified: branches/safari-610.1.1-branch/Source/WebCore/ChangeLog (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebCore/ChangeLog	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebCore/ChangeLog	2020-02-04 03:08:29 UTC (rev 255627)
@@ -1,5 +1,132 @@
 2020-02-03  Russell Epstein  <[email protected]>
 
+        Cherry-pick r255226. rdar://problem/58780584
+
+    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.
+    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
+
+    2020-01-27  Simon Fraser  <[email protected]>
+
+            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-02-03  Russell Epstein  <[email protected]>
+
         Cherry-pick r255058. rdar://problem/58830068
 
     Make sure fetch tasks go to network if service worker never gets to activated

Modified: branches/safari-610.1.1-branch/Source/WebCore/page/Frame.cpp (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebCore/page/Frame.cpp	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebCore/page/Frame.cpp	2020-02-04 03:08:29 UTC (rev 255627)
@@ -922,10 +922,8 @@
     if (!page || !isMainFrame())
         return 1;
 
-    if (FrameView* view = this->view()) {
-        if (view->delegatesPageScaling())
-            return 1;
-    }
+    if (page->delegatesScaling())
+        return 1;
 
     return page->pageScaleFactor();
 }

Modified: branches/safari-610.1.1-branch/Source/WebCore/page/FrameSnapshotting.cpp (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebCore/page/FrameSnapshotting.cpp	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebCore/page/FrameSnapshotting.cpp	2020-02-04 03:08:29 UTC (rev 255627)
@@ -105,7 +105,7 @@
 
     float scaleFactor = frame.page()->deviceScaleFactor();
 
-    if (frame.view()->delegatesPageScaling())
+    if (frame.page()->delegatesScaling())
         scaleFactor *= frame.page()->pageScaleFactor();
 
     if (options & SnapshotOptionsPaintWithIntegralScaleFactor)

Modified: branches/safari-610.1.1-branch/Source/WebCore/page/FrameView.cpp (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebCore/page/FrameView.cpp	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebCore/page/FrameView.cpp	2020-02-04 03:08:29 UTC (rev 255627)
@@ -3707,12 +3707,13 @@
 
 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();

Modified: branches/safari-610.1.1-branch/Source/WebCore/page/Page.cpp (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebCore/page/Page.cpp	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebCore/page/Page.cpp	2020-02-04 03:08:29 UTC (rev 255627)
@@ -1037,12 +1037,12 @@
     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();
 
@@ -1057,7 +1057,7 @@
         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();
     }
 
@@ -1081,6 +1081,11 @@
 #endif
 }
 
+void Page::setDelegatesScaling(bool delegatesScaling)
+{
+    m_delegatesScaling = delegatesScaling;
+}
+
 void Page::setViewScaleFactor(float scale)
 {
     if (m_viewScaleFactor == scale)

Modified: branches/safari-610.1.1-branch/Source/WebCore/page/Page.h (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebCore/page/Page.h	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebCore/page/Page.h	2020-02-04 03:08:29 UTC (rev 255627)
@@ -335,6 +335,9 @@
     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);
@@ -949,6 +952,13 @@
     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.
@@ -990,11 +1000,6 @@
     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;
 };
 

Modified: branches/safari-610.1.1-branch/Source/WebCore/platform/ScrollView.cpp (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebCore/platform/ScrollView.cpp	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebCore/platform/ScrollView.cpp	2020-02-04 03:08:29 UTC (rev 255627)
@@ -197,11 +197,6 @@
     delegatesScrollingDidChange();
 }
 
-void ScrollView::setDelegatesPageScaling(bool delegatesPageScaling)
-{
-    m_delegatesPageScaling = delegatesPageScaling;
-}
-
 IntPoint ScrollView::contentsScrollPosition() const
 {
 #if PLATFORM(IOS_FAMILY)

Modified: branches/safari-610.1.1-branch/Source/WebCore/platform/ScrollView.h (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebCore/platform/ScrollView.h	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebCore/platform/ScrollView.h	2020-02-04 03:08:29 UTC (rev 255627)
@@ -137,9 +137,6 @@
     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);
 
@@ -543,7 +540,6 @@
 
     bool m_paintsEntireContents { false };
     bool m_delegatesScrolling { false };
-    bool m_delegatesPageScaling { false };
 
 }; // class ScrollView
 

Modified: branches/safari-610.1.1-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp	2020-02-04 03:08:29 UTC (rev 255627)
@@ -1908,8 +1908,7 @@
     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);

Modified: branches/safari-610.1.1-branch/Source/WebKit/ChangeLog (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebKit/ChangeLog	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebKit/ChangeLog	2020-02-04 03:08:29 UTC (rev 255627)
@@ -1,5 +1,117 @@
 2020-02-03  Russell Epstein  <[email protected]>
 
+        Cherry-pick r255226. rdar://problem/58780584
+
+    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.
+    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
+
+    2020-01-27  Simon Fraser  <[email protected]>
+
+            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-02-03  Russell Epstein  <[email protected]>
+
         Cherry-pick r255058. rdar://problem/58830068
 
     Make sure fetch tasks go to network if service worker never gets to activated

Modified: branches/safari-610.1.1-branch/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2020-02-04 03:08:29 UTC (rev 255627)
@@ -1527,10 +1527,10 @@
 #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)

Modified: branches/safari-610.1.1-branch/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm	2020-02-04 03:08:29 UTC (rev 255627)
@@ -62,7 +62,7 @@
 {
     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.

Modified: branches/safari-610.1.1-branch/Source/WebKitLegacy/mac/ChangeLog (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebKitLegacy/mac/ChangeLog	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebKitLegacy/mac/ChangeLog	2020-02-04 03:08:29 UTC (rev 255627)
@@ -1,3 +1,113 @@
+2020-02-03  Russell Epstein  <[email protected]>
+
+        Cherry-pick r255226. rdar://problem/58780584
+
+    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.
+    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
+
+    2020-01-27  Simon Fraser  <[email protected]>
+
+            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-09  Tim Horton  <[email protected]>
 
         Adopt TARGET_OS_MACCATALYST in more places

Modified: branches/safari-610.1.1-branch/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm (255626 => 255627)


--- branches/safari-610.1.1-branch/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm	2020-02-04 03:08:22 UTC (rev 255626)
+++ branches/safari-610.1.1-branch/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm	2020-02-04 03:08:29 UTC (rev 255627)
@@ -1468,6 +1468,10 @@
     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];
 
@@ -1474,7 +1478,6 @@
     if (isMainFrame) {
 #if PLATFORM(IOS_FAMILY)
         coreView->setDelegatesScrolling(true);
-        coreView->setDelegatesPageScaling(true);
 #endif
         coreView->setParentVisible(true);
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to