Title: [184242] branches/safari-601.1.32-branch

Diff

Modified: branches/safari-601.1.32-branch/LayoutTests/ChangeLog (184241 => 184242)


--- branches/safari-601.1.32-branch/LayoutTests/ChangeLog	2015-05-13 03:51:19 UTC (rev 184241)
+++ branches/safari-601.1.32-branch/LayoutTests/ChangeLog	2015-05-13 03:58:11 UTC (rev 184242)
@@ -1,30 +1,24 @@
 2015-05-12  Dana Burkart
-Dana Burkart  <[email protected]>
+Dana Burkart  <[email protected]
[email protected]>
 
-        Merge r183942. rdar://problem/20049088
+        Merge r183943. rdar://problem/19913748
 
-    2015-05-06  Dean Jackson  <[email protected]>
+    2015-05-07  Simon Fraser  <[email protected]>
 
-            Handle backdrop views that have to tile
-            https://bugs.webkit.org/show_bug.cgi?id=142317
-            <rdar://problem/20049088>
+            Remove the WK1-only code path for independently composited iframes
+            https://bugs.webkit.org/show_bug.cgi?id=144722
 
-            Reviewed by Simon Fraser.
+            Reviewed by Dean Jackson.
 
-            Take 2 - this was rolled out because Mavericks was crashing.
+            Results different from WK2, because WK1 does not make layers for scrollbars.
 
-            A test that creates some backdrop views, then makes them
-            big enough that it would trigger tiling (which we don't want
-            to happen).
+            * platform/mac-wk1/compositing/visible-rect/iframe-no-layers-expected.txt: Added.
 
-            * compositing/media-controls-bar-appearance-big-expected.txt: Added.
-            * compositing/media-controls-bar-appearance-big.html: Added.
-            * platform/mac-mavericks/TestExpectations: Skip tests on Mavericks.
-
     2015-05-12  Dana Burkart
     Dana Burkart  <[email protected]>
 
-            Merge r183894. rdar://problem/20049088
+            Merge r183942. rdar://problem/20049088
 
         2015-05-06  Dean Jackson  <[email protected]>
 
@@ -34,13 +28,36 @@
 
                 Reviewed by Simon Fraser.
 
+                Take 2 - this was rolled out because Mavericks was crashing.
+
                 A test that creates some backdrop views, then makes them
                 big enough that it would trigger tiling (which we don't want
                 to happen).
 
                 * compositing/media-controls-bar-appearance-big-expected.txt: Added.
                 * compositing/media-controls-bar-appearance-big.html: Added.
+                * platform/mac-mavericks/TestExpectations: Skip tests on Mavericks.
 
+        2015-05-12  Dana Burkart
+        Dana Burkart  <[email protected]>
+
+                Merge r183894. rdar://problem/20049088
+
+            2015-05-06  Dean Jackson  <[email protected]>
+
+                    Handle backdrop views that have to tile
+                    https://bugs.webkit.org/show_bug.cgi?id=142317
+                    <rdar://problem/20049088>
+
+                    Reviewed by Simon Fraser.
+
+                    A test that creates some backdrop views, then makes them
+                    big enough that it would trigger tiling (which we don't want
+                    to happen).
+
+                    * compositing/media-controls-bar-appearance-big-expected.txt: Added.
+                    * compositing/media-controls-bar-appearance-big.html: Added.
+
 2015-05-06  Brent Fulgham  <[email protected]>
 
         Scroll-snap points do not handle margins and padding propertly

Added: branches/safari-601.1.32-branch/LayoutTests/platform/mac-wk1/compositing/visible-rect/iframe-no-layers-expected.txt (0 => 184242)


--- branches/safari-601.1.32-branch/LayoutTests/platform/mac-wk1/compositing/visible-rect/iframe-no-layers-expected.txt	                        (rev 0)
+++ branches/safari-601.1.32-branch/LayoutTests/platform/mac-wk1/compositing/visible-rect/iframe-no-layers-expected.txt	2015-05-13 03:58:11 UTC (rev 184242)
@@ -0,0 +1,33 @@
+
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 1508.00 1516.00)
+  (visible rect 10.00, 100.00 285.00 x 135.00)
+  (coverage rect 10.00, 100.00 285.00 x 135.00)
+  (intersects coverage rect 1)
+  (contentsScale 1.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 1508.00 1516.00)
+      (drawsContent 1)
+      (visible rect 10.00, 100.00 285.00 x 135.00)
+      (coverage rect 10.00, 100.00 285.00 x 135.00)
+      (intersects coverage rect 1)
+      (contentsScale 1.00)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 100.00 300.00)
+          (contentsOpaque 1)
+          (drawsContent 1)
+          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
+          (visible rect 2.00, 92.00 98.00 x 135.00)
+          (coverage rect 2.00, 92.00 285.00 x 135.00)
+          (intersects coverage rect 1)
+          (contentsScale 1.00)
+        )
+      )
+    )
+  )
+)
+

Modified: branches/safari-601.1.32-branch/Source/WebCore/ChangeLog (184241 => 184242)


--- branches/safari-601.1.32-branch/Source/WebCore/ChangeLog	2015-05-13 03:51:19 UTC (rev 184241)
+++ branches/safari-601.1.32-branch/Source/WebCore/ChangeLog	2015-05-13 03:58:11 UTC (rev 184242)
@@ -2,82 +2,127 @@
 Dana Burkart  <[email protected]
 [email protected]>
 
-        Merge r183927. rdar://problem/20854785
+        Merge r183943. rdar://problem/19913748
 
-    2015-05-07  Eric Carlson  <[email protected]>
+    2015-05-07  Simon Fraser  <[email protected]>
 
-            [Mac] Playback target isn't set on new element
-            https://bugs.webkit.org/show_bug.cgi?id=144724
+            Remove the WK1-only code path for independently composited iframes
+            https://bugs.webkit.org/show_bug.cgi?id=144722
 
-            Reviewed by Jer Noble.
+            Reviewed by Dean Jackson.
 
-            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
-            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
-            (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Call setShouldPlayToPlaybackTarget
-            if necessary.
-            (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Remember
-            the setting in case we don't have an AVPlayer yet.
+            In WebKit1 on Mac, we allowed iframes to be composited independently of their
+            parent document, relying on the fact that the frame's platform view can host
+            a layer-backed view. However, this ran into bugs (rdar://problem/18862298),
+            and triggers the assertion at the end of FrameView::updateLayoutAndStyleIfNeededRecursive(),
+            because the compositing update after a layout can dirty style in notifyIFramesOfCompositingChange().
 
+            Removing the WK1-only code path solves these problems. It also eliminates the need
+            to do compositing-specific frame overlap testing.
+
+            * page/FrameView.cpp:
+            (WebCore::FrameView::setIsOverlapped): No need to do compositing-related things here.
+            Any iframe that gets composited will participate in the normal compositing overlap
+            testing in its parent frame.
+            (WebCore::FrameView::hasCompositedContentIncludingDescendants): Deleted.
+            (WebCore::FrameView::hasCompositingAncestor): Deleted.
+            * page/FrameView.h:
+            * rendering/RenderLayerCompositor.cpp: Replace ownerElement() checks in this file
+            with an isMainFrameCompositor() for readability. Some 0->nullptr.
+            (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
+            (WebCore::RenderLayerCompositor::chromeClient):
+            (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers):
+            (WebCore::RenderLayerCompositor::updateCompositingLayers):
+            (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
+            (WebCore::RenderLayerCompositor::updateBacking):
+            (WebCore::RenderLayerCompositor::layerTreeAsText):
+            (WebCore::RenderLayerCompositor::frameContentsCompositor):
+            (WebCore::RenderLayerCompositor::setIsInWindow):
+            (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame):
+            (WebCore::RenderLayerCompositor::requiresCompositingForFrame): frameRenderer.requiresAcceleratedCompositing()
+            already bails on no content RenderView, so the shouldPropagateCompositingToEnclosingFrame() check does
+            nothing and is removed.
+            (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer):
+            (WebCore::RenderLayerCompositor::requiresScrollLayer):
+            (WebCore::RenderLayerCompositor::documentUsesTiledBacking):
+            (WebCore::RenderLayerCompositor::isMainFrameCompositor):
+            (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls):
+            (WebCore::RenderLayerCompositor::requiresOverhangAreasLayer):
+            (WebCore::RenderLayerCompositor::requiresContentShadowLayer):
+            (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
+            (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
+            (WebCore::RenderLayerCompositor::updateLayerForHeader):
+            (WebCore::RenderLayerCompositor::updateLayerForFooter):
+            (WebCore::RenderLayerCompositor::ensureRootLayer): Main frame attaches via ChromeClient,
+            all other frames attach via parent frame.
+            (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange): This call to
+            scheduleSetNeedsStyleRecalc(SyntheticStyleChange) was the source of dirtying style after
+            layout, but is no longer needed so remove it.
+            (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
+            (WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers):
+            (WebCore::RenderLayerCompositor::scrollingCoordinator):
+            (WebCore::RenderLayerCompositor::graphicsLayerFactory):
+            (WebCore::RenderLayerCompositor::allowsIndependentlyCompositedFrames): Deleted.
+            (WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame): Deleted.
+            (WebCore::RenderLayerCompositor::mainFrameBackingIsTiled): Deleted. This was mis-named;
+            it really asks whether the document uses tiled backing, but does not check for main frame.
+            * rendering/RenderLayerCompositor.h:
+            * rendering/RenderWidget.cpp:
+            (WebCore::RenderWidget::paintContents): No need to do frame overlap testing for
+            compositing now.
+
     2015-05-12  Dana Burkart
     Dana Burkart  <[email protected]
     [email protected]>
 
-            Merge r183909. rdar://problem/18894598
+            Merge r183927. rdar://problem/20854785
 
-        2015-05-06  Daniel Bates  <[email protected]>
+        2015-05-07  Eric Carlson  <[email protected]>
 
-                [iOS][WK2] Pause/resume database thread when UIProcess enters/leaves the background
-                https://bugs.webkit.org/show_bug.cgi?id=144657
-                <rdar://problem/18894598>
+                [Mac] Playback target isn't set on new element
+                https://bugs.webkit.org/show_bug.cgi?id=144724
 
-                Reviewed by Andy Estes.
+                Reviewed by Jer Noble.
 
-                Export WebCore functionality to pause and resume the database thread so that we can
-                make use of this functionality from WebKit2.
+                * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+                * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+                (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Call setShouldPlayToPlaybackTarget
+                if necessary.
+                (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Remember
+                the setting in case we don't have an AVPlayer yet.
 
-                * Modules/webdatabase/AbstractDatabaseServer.h:
-                * Modules/webdatabase/DatabaseManager.cpp:
-                (WebCore::DatabaseManager::setPauseAllDatabases): Added; turns around and calls DatabaseServer::setPauseAllDatabases().
-                * Modules/webdatabase/DatabaseManager.h:
-                * Modules/webdatabase/DatabaseServer.cpp:
-                (WebCore::DatabaseServer::setPauseAllDatabases): Added; turns around and calls
-                DatabaseTracker::tracker().setDatabasesPaused() to pause or resume the database thread.
-                For now, we guard this call with PLATFORM(IOS). We'll look to remove this guard once
-                we fix <https://bugs.webkit.org/show_bug.cgi?id=144660>.
-                * Modules/webdatabase/DatabaseServer.h:
-
         2015-05-12  Dana Burkart
-        Dana Burkart  <[email protected]>
+        Dana Burkart  <[email protected]
+        [email protected]>
 
-                Merge r183942. rdar://problem/20049088
+                Merge r183909. rdar://problem/18894598
 
-            2015-05-06  Dean Jackson  <[email protected]>
+            2015-05-06  Daniel Bates  <[email protected]>
 
-                    Handle backdrop views that have to tile
-                    https://bugs.webkit.org/show_bug.cgi?id=142317
-                    <rdar://problem/20049088>
+                    [iOS][WK2] Pause/resume database thread when UIProcess enters/leaves the background
+                    https://bugs.webkit.org/show_bug.cgi?id=144657
+                    <rdar://problem/18894598>
 
-                    Reviewed by Simon Fraser.
+                    Reviewed by Andy Estes.
 
-                    Take 2 - this was rolled out because Mavericks was crashing.
+                    Export WebCore functionality to pause and resume the database thread so that we can
+                    make use of this functionality from WebKit2.
 
-                    Make sure backdrop layers don't tile. If they are big
-                    enough, we'll leave it to the platform compositor to handle.
+                    * Modules/webdatabase/AbstractDatabaseServer.h:
+                    * Modules/webdatabase/DatabaseManager.cpp:
+                    (WebCore::DatabaseManager::setPauseAllDatabases): Added; turns around and calls DatabaseServer::setPauseAllDatabases().
+                    * Modules/webdatabase/DatabaseManager.h:
+                    * Modules/webdatabase/DatabaseServer.cpp:
+                    (WebCore::DatabaseServer::setPauseAllDatabases): Added; turns around and calls
+                    DatabaseTracker::tracker().setDatabasesPaused() to pause or resume the database thread.
+                    For now, we guard this call with PLATFORM(IOS). We'll look to remove this guard once
+                    we fix <https://bugs.webkit.org/show_bug.cgi?id=144660>.
+                    * Modules/webdatabase/DatabaseServer.h:
 
-                    This also fixes a bug where if a layer changed from a backdrop
-                    type to a tiled type, it would still retain its custom appearance
-                    and we'd try to add children to the wrong layer.
-
-                    Test: compositing/media-controls-bar-appearance-big.html
-
-                    * platform/graphics/ca/GraphicsLayerCA.cpp:
-                    (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Check if
-                    a layer needs a backdrop before checking if it needs to tile.
-
             2015-05-12  Dana Burkart
             Dana Burkart  <[email protected]>
 
-                    Merge r183894. rdar://problem/20049088
+                    Merge r183942. rdar://problem/20049088
 
                 2015-05-06  Dean Jackson  <[email protected]>
 
@@ -87,6 +132,8 @@
 
                         Reviewed by Simon Fraser.
 
+                        Take 2 - this was rolled out because Mavericks was crashing.
+
                         Make sure backdrop layers don't tile. If they are big
                         enough, we'll leave it to the platform compositor to handle.
 
@@ -100,6 +147,32 @@
                         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Check if
                         a layer needs a backdrop before checking if it needs to tile.
 
+                2015-05-12  Dana Burkart
+                Dana Burkart  <[email protected]>
+
+                        Merge r183894. rdar://problem/20049088
+
+                    2015-05-06  Dean Jackson  <[email protected]>
+
+                            Handle backdrop views that have to tile
+                            https://bugs.webkit.org/show_bug.cgi?id=142317
+                            <rdar://problem/20049088>
+
+                            Reviewed by Simon Fraser.
+
+                            Make sure backdrop layers don't tile. If they are big
+                            enough, we'll leave it to the platform compositor to handle.
+
+                            This also fixes a bug where if a layer changed from a backdrop
+                            type to a tiled type, it would still retain its custom appearance
+                            and we'd try to add children to the wrong layer.
+
+                            Test: compositing/media-controls-bar-appearance-big.html
+
+                            * platform/graphics/ca/GraphicsLayerCA.cpp:
+                            (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Check if
+                            a layer needs a backdrop before checking if it needs to tile.
+
 2015-05-06  Brent Fulgham  <[email protected]>
 
         Scroll-snap points do not handle margins and padding propertly

Modified: branches/safari-601.1.32-branch/Source/WebCore/page/FrameView.cpp (184241 => 184242)


--- branches/safari-601.1.32-branch/Source/WebCore/page/FrameView.cpp	2015-05-13 03:51:19 UTC (rev 184241)
+++ branches/safari-601.1.32-branch/Source/WebCore/page/FrameView.cpp	2015-05-13 03:58:11 UTC (rev 184242)
@@ -1017,32 +1017,6 @@
     return false;
 }
 
-bool FrameView::hasCompositedContentIncludingDescendants() const
-{
-    for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr())) {
-        RenderView* renderView = frame->contentRenderer();
-        if (RenderLayerCompositor* compositor = renderView ? &renderView->compositor() : nullptr) {
-            if (compositor->inCompositingMode())
-                return true;
-
-            if (!RenderLayerCompositor::allowsIndependentlyCompositedFrames(this))
-                break;
-        }
-    }
-    return false;
-}
-
-bool FrameView::hasCompositingAncestor() const
-{
-    for (Frame* frame = this->frame().tree().parent(); frame; frame = frame->tree().parent()) {
-        if (FrameView* view = frame->view()) {
-            if (view->hasCompositedContent())
-                return true;
-        }
-    }
-    return false;
-}
-
 // Sometimes (for plug-ins) we need to eagerly go into compositing mode.
 void FrameView::enterCompositingMode()
 {
@@ -1910,30 +1884,6 @@
 
     m_isOverlapped = isOverlapped;
     updateCanBlitOnScrollRecursively();
-
-    if (hasCompositedContentIncludingDescendants()) {
-        // Overlap can affect compositing tests, so if it changes, we need to trigger
-        // a layer update in the parent document.
-        if (Frame* parentFrame = frame().tree().parent()) {
-            if (RenderView* parentView = parentFrame->contentRenderer()) {
-                RenderLayerCompositor& compositor = parentView->compositor();
-                compositor.setCompositingLayersNeedRebuild();
-                compositor.scheduleCompositingLayerUpdate();
-            }
-        }
-
-        if (RenderLayerCompositor::allowsIndependentlyCompositedFrames(this)) {
-            // We also need to trigger reevaluation for this and all descendant frames,
-            // since a frame uses compositing if any ancestor is compositing.
-            for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr())) {
-                if (RenderView* view = frame->contentRenderer()) {
-                    RenderLayerCompositor& compositor = view->compositor();
-                    compositor.setCompositingLayersNeedRebuild();
-                    compositor.scheduleCompositingLayerUpdate();
-                }
-            }
-        }
-    }
 }
 
 bool FrameView::isOverlappedIncludingAncestors() const

Modified: branches/safari-601.1.32-branch/Source/WebCore/page/FrameView.h (184241 => 184242)


--- branches/safari-601.1.32-branch/Source/WebCore/page/FrameView.h	2015-05-13 03:51:19 UTC (rev 184241)
+++ branches/safari-601.1.32-branch/Source/WebCore/page/FrameView.h	2015-05-13 03:58:11 UTC (rev 184242)
@@ -170,8 +170,6 @@
     ScrollableArea* scrollableAreaForScrollLayerID(uint64_t) const;
 
     bool hasCompositedContent() const;
-    bool hasCompositedContentIncludingDescendants() const;
-    bool hasCompositingAncestor() const;
     WEBCORE_EXPORT void enterCompositingMode();
     WEBCORE_EXPORT bool isEnclosedInCompositingLayer() const;
 

Modified: branches/safari-601.1.32-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp (184241 => 184242)


--- branches/safari-601.1.32-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp	2015-05-13 03:51:19 UTC (rev 184241)
+++ branches/safari-601.1.32-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp	2015-05-13 03:58:11 UTC (rev 184242)
@@ -346,7 +346,7 @@
     showRepaintCounter = settings.showRepaintCounter();
     forceCompositingMode = settings.forceCompositingMode() && hasAcceleratedCompositing;
 
-    if (forceCompositingMode && m_renderView.document().ownerElement())
+    if (forceCompositingMode && !isMainFrameCompositor())
         forceCompositingMode = requiresCompositingForScrollableFrame();
 
     acceleratedDrawingEnabled = settings.acceleratedDrawingEnabled();
@@ -442,7 +442,7 @@
 {
     Page* page = m_renderView.frameView().frame().page();
     if (!page)
-        return 0;
+        return nullptr;
     return &page->chrome().client();
 }
 #endif
@@ -643,7 +643,7 @@
             return compositor;
     }
     
-    return 0;
+    return nullptr;
 }
 
 void RenderLayerCompositor::scheduleCompositingLayerUpdate()
@@ -759,7 +759,7 @@
         m_secondaryBackingStoreBytes = 0;
 
         Frame& frame = m_renderView.frameView().frame();
-        bool isMainFrame = !m_renderView.document().ownerElement();
+        bool isMainFrame = isMainFrameCompositor();
         LOG(Compositing, "\nUpdate %d of %s.\n", m_rootLayerUpdateCount, isMainFrame ? "main frame" : frame.tree().uniqueName().string().utf8().data());
     }
 #endif
@@ -809,10 +809,10 @@
 
 void RenderLayerCompositor::appendDocumentOverlayLayers(Vector<GraphicsLayer*>& childList)
 {
-    Frame& frame = m_renderView.frameView().frame();
-    if (!frame.isMainFrame())
+    if (!isMainFrameCompositor())
         return;
 
+    Frame& frame = m_renderView.frameView().frame();
     Page* page = frame.page();
     if (!page)
         return;
@@ -998,7 +998,7 @@
             layer.ensureBacking();
 
             // At this time, the ScrollingCoordinator only supports the top-level frame.
-            if (layer.isRootLayer() && !m_renderView.document().ownerElement()) {
+            if (layer.isRootLayer() && isMainFrameCompositor()) {
                 updateScrollCoordinatedStatus(layer);
                 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
                     scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView());
@@ -1821,7 +1821,7 @@
 
     // Dump an empty layer tree only if the only composited layer is the main frame's tiled backing,
     // so that tests expecting us to drop out of accelerated compositing when there are no layers succeed.
-    if (!hasAnyAdditionalCompositedLayers(rootRenderLayer()) && mainFrameBackingIsTiled() && !(layerTreeBehavior & LayerTreeAsTextIncludeTileCaches))
+    if (!hasAnyAdditionalCompositedLayers(rootRenderLayer()) && documentUsesTiledBacking() && !(layerTreeBehavior & LayerTreeAsTextIncludeTileCaches))
         layerTreeText = "";
 
     // The true root layer is not included in the dump, so if we want to report
@@ -1838,7 +1838,7 @@
         if (RenderView* view = contentDocument->renderView())
             return &view->compositor();
     }
-    return 0;
+    return nullptr;
 }
 
 bool RenderLayerCompositor::parentFrameContentLayers(RenderWidget* renderer)
@@ -2064,7 +2064,7 @@
         if (m_rootLayerAttachment != RootLayerUnattached)
             return;
 
-        RootLayerAttachment attachment = shouldPropagateCompositingToEnclosingFrame() ? RootLayerAttachedViaEnclosingFrame : RootLayerAttachedViaChromeClient;
+        RootLayerAttachment attachment = isMainFrameCompositor() ? RootLayerAttachedViaChromeClient : RootLayerAttachedViaEnclosingFrame;
         attachRootLayer(attachment);
 #if PLATFORM(IOS)
         registerAllViewportConstrainedLayers();
@@ -2129,51 +2129,6 @@
     return layerHas3DContent(rootRenderLayer());
 }
 
-bool RenderLayerCompositor::allowsIndependentlyCompositedFrames(const FrameView* view)
-{
-#if PLATFORM(MAC)
-    // frames are only independently composited in Mac pre-WebKit2.
-    return view->platformWidget();
-#else
-    UNUSED_PARAM(view);
-#endif
-    return false;
-}
-
-bool RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame() const
-{
-    // Parent document content needs to be able to render on top of a composited frame, so correct behavior
-    // is to have the parent document become composited too. However, this can cause problems on platforms that
-    // use native views for frames (like Mac), so disable that behavior on those platforms for now.
-    HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerElement();
-
-    // If we are the top-level frame, don't propagate.
-    if (!ownerElement)
-        return false;
-
-    if (!allowsIndependentlyCompositedFrames(&m_renderView.frameView()))
-        return true;
-
-    RenderElement* renderer = ownerElement->renderer();
-    if (!is<RenderWidget>(renderer))
-        return false;
-
-    // On Mac, only propagate compositing if the frame is overlapped in the parent
-    // document, or the parent is already compositing, or the main frame is scaled.
-    Page* page = this->page();
-    if (page && page->pageScaleFactor() != 1)
-        return true;
-    
-    RenderWidget& frameRenderer = downcast<RenderWidget>(*renderer);
-    if (frameRenderer.widget()) {
-        FrameView& view = downcast<FrameView>(*frameRenderer.widget());
-        if (view.isOverlappedIncludingAncestors() || view.hasCompositingAncestor())
-            return true;
-    }
-
-    return false;
-}
-
 bool RenderLayerCompositor::needsToBeComposited(const RenderLayer& layer, RenderLayer::ViewportConstrainedNotCompositedReason* viewportConstrainedNotCompositedReason) const
 {
     if (!canBeComposited(layer))
@@ -2497,8 +2452,7 @@
 {
     // Need this done first to determine overflow.
     ASSERT(!m_renderView.needsLayout());
-    HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerElement();
-    if (!ownerElement)
+    if (isMainFrameCompositor())
         return false;
 
     if (!(m_compositingTriggers & ChromeClient::ScrollableInnerFrameTrigger))
@@ -2597,16 +2551,11 @@
         return false;
 
     auto& frameRenderer = downcast<RenderWidget>(renderer);
-
     if (!frameRenderer.requiresAcceleratedCompositing())
         return false;
 
     m_reevaluateCompositingAfterLayout = true;
 
-    RenderLayerCompositor* innerCompositor = frameContentsCompositor(&frameRenderer);
-    if (!innerCompositor || !innerCompositor->shouldPropagateCompositingToEnclosingFrame())
-        return false;
-
     // If we can't reliably know the size of the iframe yet, don't change compositing state.
     if (!frameRenderer.parent() || frameRenderer.needsLayout())
         return frameRenderer.hasLayer() && frameRenderer.layer()->isComposited();
@@ -2695,7 +2644,7 @@
 
 #if PLATFORM(IOS)
     // iOS WK1 has fixed/sticky support in the main frame via WebFixedPositionContent.
-    return m_renderView.frameView().frame().isMainFrame();
+    return isMainFrameCompositor();
 #else
     return false;
 #endif
@@ -2839,7 +2788,7 @@
     FrameView& frameView = m_renderView.frameView();
 
     // This applies when the application UI handles scrolling, in which case RenderLayerCompositor doesn't need to manage it.
-    if (frameView.delegatesScrolling() && frameView.frame().isMainFrame())
+    if (frameView.delegatesScrolling() && isMainFrameCompositor())
         return false;
 
     // We need to handle our own scrolling if we're:
@@ -2979,7 +2928,7 @@
     // Nothing to do here yet.
 }
 
-bool RenderLayerCompositor::mainFrameBackingIsTiled() const
+bool RenderLayerCompositor::documentUsesTiledBacking() const
 {
     RenderLayer* layer = m_renderView.layer();
     if (!layer)
@@ -2992,6 +2941,11 @@
     return backing->usingTiledBacking();
 }
 
+bool RenderLayerCompositor::isMainFrameCompositor() const
+{
+    return m_renderView.frameView().frame().isMainFrame();
+}
+
 bool RenderLayerCompositor::shouldCompositeOverflowControls() const
 {
     FrameView& frameView = m_renderView.frameView();
@@ -3002,7 +2956,7 @@
     if (frameView.delegatesScrolling())
         return false;
 
-    if (mainFrameBackingIsTiled())
+    if (documentUsesTiledBacking())
         return true;
 
     if (!frameView.hasOverlayScrollbars())
@@ -3029,12 +2983,11 @@
 #if ENABLE(RUBBER_BANDING)
 bool RenderLayerCompositor::requiresOverhangAreasLayer() const
 {
-    // We don't want a layer if this is a subframe.
-    if (m_renderView.document().ownerElement())
+    if (!isMainFrameCompositor())
         return false;
 
     // We do want a layer if we're using tiled drawing and can scroll.
-    if (mainFrameBackingIsTiled() && m_renderView.frameView().hasOpaqueBackground() && !m_renderView.frameView().prohibitsScrolling())
+    if (documentUsesTiledBacking() && m_renderView.frameView().hasOpaqueBackground() && !m_renderView.frameView().prohibitsScrolling())
         return true;
 
     return false;
@@ -3042,8 +2995,7 @@
 
 bool RenderLayerCompositor::requiresContentShadowLayer() const
 {
-    // We don't want a layer if this is a subframe.
-    if (m_renderView.document().ownerElement())
+    if (!isMainFrameCompositor())
         return false;
 
 #if PLATFORM(COCOA)
@@ -3055,7 +3007,7 @@
         return false;
 
     // On Mac, we want a content shadow layer if we're using tiled drawing and can scroll.
-    if (mainFrameBackingIsTiled() && !m_renderView.frameView().prohibitsScrolling())
+    if (documentUsesTiledBacking() && !m_renderView.frameView().prohibitsScrolling())
         return true;
 #endif
 
@@ -3064,15 +3016,15 @@
 
 GraphicsLayer* RenderLayerCompositor::updateLayerForTopOverhangArea(bool wantsLayer)
 {
-    if (m_renderView.document().ownerElement())
-        return 0;
+    if (!isMainFrameCompositor())
+        return nullptr;
 
     if (!wantsLayer) {
         if (m_layerForTopOverhangArea) {
             m_layerForTopOverhangArea->removeFromParent();
             m_layerForTopOverhangArea = nullptr;
         }
-        return 0;
+        return nullptr;
     }
 
     if (!m_layerForTopOverhangArea) {
@@ -3088,15 +3040,15 @@
 
 GraphicsLayer* RenderLayerCompositor::updateLayerForBottomOverhangArea(bool wantsLayer)
 {
-    if (m_renderView.document().ownerElement())
-        return 0;
+    if (!isMainFrameCompositor())
+        return nullptr;
 
     if (!wantsLayer) {
         if (m_layerForBottomOverhangArea) {
             m_layerForBottomOverhangArea->removeFromParent();
             m_layerForBottomOverhangArea = nullptr;
         }
-        return 0;
+        return nullptr;
     }
 
     if (!m_layerForBottomOverhangArea) {
@@ -3114,8 +3066,8 @@
 
 GraphicsLayer* RenderLayerCompositor::updateLayerForHeader(bool wantsLayer)
 {
-    if (m_renderView.document().ownerElement())
-        return 0;
+    if (!isMainFrameCompositor())
+        return nullptr;
 
     if (!wantsLayer) {
         if (m_layerForHeader) {
@@ -3127,7 +3079,7 @@
             if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
                 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView());
         }
-        return 0;
+        return nullptr;
     }
 
     if (!m_layerForHeader) {
@@ -3155,8 +3107,8 @@
 
 GraphicsLayer* RenderLayerCompositor::updateLayerForFooter(bool wantsLayer)
 {
-    if (m_renderView.document().ownerElement())
-        return 0;
+    if (!isMainFrameCompositor())
+        return nullptr;
 
     if (!wantsLayer) {
         if (m_layerForFooter) {
@@ -3168,7 +3120,7 @@
             if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
                 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView());
         }
-        return 0;
+        return nullptr;
     }
 
     if (!m_layerForFooter) {
@@ -3371,7 +3323,7 @@
 
 void RenderLayerCompositor::ensureRootLayer()
 {
-    RootLayerAttachment expectedAttachment = shouldPropagateCompositingToEnclosingFrame() ? RootLayerAttachedViaEnclosingFrame : RootLayerAttachedViaChromeClient;
+    RootLayerAttachment expectedAttachment = isMainFrameCompositor() ? RootLayerAttachedViaChromeClient : RootLayerAttachedViaEnclosingFrame;
     if (expectedAttachment == m_rootLayerAttachment)
          return;
 
@@ -3605,18 +3557,9 @@
     m_rootContentLayer->addChild(&pageOverlayController.documentOverlayRootLayer());
 }
 
-// IFrames are special, because we hook compositing layers together across iframe boundaries
-// when both parent and iframe content are composited. So when this frame becomes composited, we have
-// to use a synthetic style change to get the iframes into RenderLayers in order to allow them to composite.
 void RenderLayerCompositor::notifyIFramesOfCompositingChange()
 {
-    Frame& frame = m_renderView.frameView().frame();
-    for (Frame* child = frame.tree().firstChild(); child; child = child->tree().traverseNext(&frame)) {
-        if (child->document() && child->document()->ownerElement())
-            child->document()->ownerElement()->scheduleSetNeedsStyleRecalc(SyntheticStyleChange);
-    }
-    
-    // Compositing also affects the answer to RenderIFrame::requiresAcceleratedCompositing(), so 
+    // Compositing affects the answer to RenderIFrame::requiresAcceleratedCompositing(), so
     // we need to schedule a style recalc in our parent document.
     if (HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerElement())
         ownerElement->scheduleSetNeedsStyleRecalc(SyntheticStyleChange);
@@ -3991,7 +3934,7 @@
 void RenderLayerCompositor::registerAllViewportConstrainedLayers()
 {
     // Only the main frame should register fixed/sticky layers.
-    if (m_renderView.document().ownerElement())
+    if (!isMainFrameCompositor())
         return;
 
     if (scrollingCoordinator())
@@ -4026,7 +3969,7 @@
 void RenderLayerCompositor::unregisterAllViewportConstrainedLayers()
 {
     // Only the main frame should register fixed/sticky layers.
-    if (m_renderView.document().ownerElement())
+    if (!isMainFrameCompositor())
         return;
 
     if (scrollingCoordinator())
@@ -4115,7 +4058,7 @@
     if (Page* page = this->page())
         return page->scrollingCoordinator();
 
-    return 0;
+    return nullptr;
 }
 
 GraphicsLayerFactory* RenderLayerCompositor::graphicsLayerFactory() const
@@ -4123,7 +4066,7 @@
     if (Page* page = this->page())
         return page->chrome().client().graphicsLayerFactory();
 
-    return 0;
+    return nullptr;
 }
 
 Page* RenderLayerCompositor::page() const

Modified: branches/safari-601.1.32-branch/Source/WebCore/rendering/RenderLayerCompositor.h (184241 => 184242)


--- branches/safari-601.1.32-branch/Source/WebCore/rendering/RenderLayerCompositor.h	2015-05-13 03:51:19 UTC (rev 184241)
+++ branches/safari-601.1.32-branch/Source/WebCore/rendering/RenderLayerCompositor.h	2015-05-13 03:58:11 UTC (rev 184242)
@@ -227,11 +227,6 @@
     // to know if there is non-affine content, e.g. for drawing into an image.
     bool has3DContent() const;
     
-    // Most platforms connect compositing layer trees between iframes and their parent document.
-    // Some (currently just Mac) allow iframes to do their own compositing.
-    static bool allowsIndependentlyCompositedFrames(const FrameView*);
-    bool shouldPropagateCompositingToEnclosingFrame() const;
-
     static RenderLayerCompositor* frameContentsCompositor(RenderWidget*);
     // Return true if the layers changed.
     static bool parentFrameContentLayers(RenderWidget*);
@@ -476,7 +471,8 @@
     void logLayerInfo(const RenderLayer&, int depth);
 #endif
 
-    bool mainFrameBackingIsTiled() const;
+    bool documentUsesTiledBacking() const;
+    bool isMainFrameCompositor() const;
 
 private:
     RenderView& m_renderView;

Modified: branches/safari-601.1.32-branch/Source/WebCore/rendering/RenderWidget.cpp (184241 => 184242)


--- branches/safari-601.1.32-branch/Source/WebCore/rendering/RenderWidget.cpp	2015-05-13 03:51:19 UTC (rev 184241)
+++ branches/safari-601.1.32-branch/Source/WebCore/rendering/RenderWidget.cpp	2015-05-13 03:58:11 UTC (rev 184242)
@@ -239,7 +239,7 @@
 
     if (is<FrameView>(*m_widget)) {
         FrameView& frameView = downcast<FrameView>(*m_widget);
-        bool runOverlapTests = !frameView.useSlowRepaintsIfNotOverlapped() || frameView.hasCompositedContentIncludingDescendants();
+        bool runOverlapTests = !frameView.useSlowRepaintsIfNotOverlapped();
         if (paintInfo.overlapTestRequests && runOverlapTests) {
             ASSERT(!paintInfo.overlapTestRequests->contains(this));
             paintInfo.overlapTestRequests->set(this, m_widget->frameRect());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to