<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[183943] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/183943">183943</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-05-07 13:45:42 -0700 (Thu, 07 May 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove the WK1-only code path for independently composited iframes
https://bugs.webkit.org/show_bug.cgi?id=144722
Reviewed by Dean Jackson.
Source/WebCore:
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.
LayoutTests:
Results different from WK2, because WK1 does not make layers for scrollbars.
* platform/mac-wk1/compositing/visible-rect/iframe-no-layers-expected.txt: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorcpp">trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorh">trunk/Source/WebCore/rendering/RenderLayerCompositor.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderWidgetcpp">trunk/Source/WebCore/rendering/RenderWidget.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/platform/mac-wk1/compositing/visible-rect/</li>
<li><a href="#trunkLayoutTestsplatformmacwk1compositingvisiblerectiframenolayersexpectedtxt">trunk/LayoutTests/platform/mac-wk1/compositing/visible-rect/iframe-no-layers-expected.txt</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (183942 => 183943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-05-07 20:13:47 UTC (rev 183942)
+++ trunk/LayoutTests/ChangeLog        2015-05-07 20:45:42 UTC (rev 183943)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-05-07 Simon Fraser <simon.fraser@apple.com>
+
+ Remove the WK1-only code path for independently composited iframes
+ https://bugs.webkit.org/show_bug.cgi?id=144722
+
+ Reviewed by Dean Jackson.
+
+ Results different from WK2, because WK1 does not make layers for scrollbars.
+
+ * platform/mac-wk1/compositing/visible-rect/iframe-no-layers-expected.txt: Added.
+
</ins><span class="cx"> 2015-05-06 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Handle backdrop views that have to tile
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1compositingvisiblerectiframenolayersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk1/compositing/visible-rect/iframe-no-layers-expected.txt (0 => 183943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/compositing/visible-rect/iframe-no-layers-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/compositing/visible-rect/iframe-no-layers-expected.txt        2015-05-07 20:45:42 UTC (rev 183943)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+
+(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)
+ )
+ )
+ )
+ )
+)
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183942 => 183943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-05-07 20:13:47 UTC (rev 183942)
+++ trunk/Source/WebCore/ChangeLog        2015-05-07 20:45:42 UTC (rev 183943)
</span><span class="lines">@@ -1,3 +1,70 @@
</span><ins>+2015-05-07 Simon Fraser <simon.fraser@apple.com>
+
+ Remove the WK1-only code path for independently composited iframes
+ https://bugs.webkit.org/show_bug.cgi?id=144722
+
+ Reviewed by Dean Jackson.
+
+ 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.
+
</ins><span class="cx"> 2015-05-06 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Handle backdrop views that have to tile
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (183942 => 183943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2015-05-07 20:13:47 UTC (rev 183942)
+++ trunk/Source/WebCore/page/FrameView.cpp        2015-05-07 20:45:42 UTC (rev 183943)
</span><span class="lines">@@ -1017,32 +1017,6 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-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;
-}
-
</del><span class="cx"> // Sometimes (for plug-ins) we need to eagerly go into compositing mode.
</span><span class="cx"> void FrameView::enterCompositingMode()
</span><span class="cx"> {
</span><span class="lines">@@ -1910,30 +1884,6 @@
</span><span class="cx">
</span><span class="cx"> m_isOverlapped = isOverlapped;
</span><span class="cx"> updateCanBlitOnScrollRecursively();
</span><del>-
- 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();
- }
- }
- }
- }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool FrameView::isOverlappedIncludingAncestors() const
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (183942 => 183943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2015-05-07 20:13:47 UTC (rev 183942)
+++ trunk/Source/WebCore/page/FrameView.h        2015-05-07 20:45:42 UTC (rev 183943)
</span><span class="lines">@@ -170,8 +170,6 @@
</span><span class="cx"> ScrollableArea* scrollableAreaForScrollLayerID(uint64_t) const;
</span><span class="cx">
</span><span class="cx"> bool hasCompositedContent() const;
</span><del>- bool hasCompositedContentIncludingDescendants() const;
- bool hasCompositingAncestor() const;
</del><span class="cx"> WEBCORE_EXPORT void enterCompositingMode();
</span><span class="cx"> WEBCORE_EXPORT bool isEnclosedInCompositingLayer() const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (183942 => 183943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2015-05-07 20:13:47 UTC (rev 183942)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2015-05-07 20:45:42 UTC (rev 183943)
</span><span class="lines">@@ -346,7 +346,7 @@
</span><span class="cx"> showRepaintCounter = settings.showRepaintCounter();
</span><span class="cx"> forceCompositingMode = settings.forceCompositingMode() && hasAcceleratedCompositing;
</span><span class="cx">
</span><del>- if (forceCompositingMode && m_renderView.document().ownerElement())
</del><ins>+ if (forceCompositingMode && !isMainFrameCompositor())
</ins><span class="cx"> forceCompositingMode = requiresCompositingForScrollableFrame();
</span><span class="cx">
</span><span class="cx"> acceleratedDrawingEnabled = settings.acceleratedDrawingEnabled();
</span><span class="lines">@@ -442,7 +442,7 @@
</span><span class="cx"> {
</span><span class="cx"> Page* page = m_renderView.frameView().frame().page();
</span><span class="cx"> if (!page)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> return &page->chrome().client();
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -643,7 +643,7 @@
</span><span class="cx"> return compositor;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderLayerCompositor::scheduleCompositingLayerUpdate()
</span><span class="lines">@@ -759,7 +759,7 @@
</span><span class="cx"> m_secondaryBackingStoreBytes = 0;
</span><span class="cx">
</span><span class="cx"> Frame& frame = m_renderView.frameView().frame();
</span><del>- bool isMainFrame = !m_renderView.document().ownerElement();
</del><ins>+ bool isMainFrame = isMainFrameCompositor();
</ins><span class="cx"> LOG(Compositing, "\nUpdate %d of %s.\n", m_rootLayerUpdateCount, isMainFrame ? "main frame" : frame.tree().uniqueName().string().utf8().data());
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -809,10 +809,10 @@
</span><span class="cx">
</span><span class="cx"> void RenderLayerCompositor::appendDocumentOverlayLayers(Vector<GraphicsLayer*>& childList)
</span><span class="cx"> {
</span><del>- Frame& frame = m_renderView.frameView().frame();
- if (!frame.isMainFrame())
</del><ins>+ if (!isMainFrameCompositor())
</ins><span class="cx"> return;
</span><span class="cx">
</span><ins>+ Frame& frame = m_renderView.frameView().frame();
</ins><span class="cx"> Page* page = frame.page();
</span><span class="cx"> if (!page)
</span><span class="cx"> return;
</span><span class="lines">@@ -998,7 +998,7 @@
</span><span class="cx"> layer.ensureBacking();
</span><span class="cx">
</span><span class="cx"> // At this time, the ScrollingCoordinator only supports the top-level frame.
</span><del>- if (layer.isRootLayer() && !m_renderView.document().ownerElement()) {
</del><ins>+ if (layer.isRootLayer() && isMainFrameCompositor()) {
</ins><span class="cx"> updateScrollCoordinatedStatus(layer);
</span><span class="cx"> if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
</span><span class="cx"> scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView());
</span><span class="lines">@@ -1821,7 +1821,7 @@
</span><span class="cx">
</span><span class="cx"> // Dump an empty layer tree only if the only composited layer is the main frame's tiled backing,
</span><span class="cx"> // so that tests expecting us to drop out of accelerated compositing when there are no layers succeed.
</span><del>- if (!hasAnyAdditionalCompositedLayers(rootRenderLayer()) && mainFrameBackingIsTiled() && !(layerTreeBehavior & LayerTreeAsTextIncludeTileCaches))
</del><ins>+ if (!hasAnyAdditionalCompositedLayers(rootRenderLayer()) && documentUsesTiledBacking() && !(layerTreeBehavior & LayerTreeAsTextIncludeTileCaches))
</ins><span class="cx"> layerTreeText = "";
</span><span class="cx">
</span><span class="cx"> // The true root layer is not included in the dump, so if we want to report
</span><span class="lines">@@ -1838,7 +1838,7 @@
</span><span class="cx"> if (RenderView* view = contentDocument->renderView())
</span><span class="cx"> return &view->compositor();
</span><span class="cx"> }
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool RenderLayerCompositor::parentFrameContentLayers(RenderWidget* renderer)
</span><span class="lines">@@ -2064,7 +2064,7 @@
</span><span class="cx"> if (m_rootLayerAttachment != RootLayerUnattached)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- RootLayerAttachment attachment = shouldPropagateCompositingToEnclosingFrame() ? RootLayerAttachedViaEnclosingFrame : RootLayerAttachedViaChromeClient;
</del><ins>+ RootLayerAttachment attachment = isMainFrameCompositor() ? RootLayerAttachedViaChromeClient : RootLayerAttachedViaEnclosingFrame;
</ins><span class="cx"> attachRootLayer(attachment);
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> registerAllViewportConstrainedLayers();
</span><span class="lines">@@ -2129,51 +2129,6 @@
</span><span class="cx"> return layerHas3DContent(rootRenderLayer());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-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;
-}
-
</del><span class="cx"> bool RenderLayerCompositor::needsToBeComposited(const RenderLayer& layer, RenderLayer::ViewportConstrainedNotCompositedReason* viewportConstrainedNotCompositedReason) const
</span><span class="cx"> {
</span><span class="cx"> if (!canBeComposited(layer))
</span><span class="lines">@@ -2497,8 +2452,7 @@
</span><span class="cx"> {
</span><span class="cx"> // Need this done first to determine overflow.
</span><span class="cx"> ASSERT(!m_renderView.needsLayout());
</span><del>- HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerElement();
- if (!ownerElement)
</del><ins>+ if (isMainFrameCompositor())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> if (!(m_compositingTriggers & ChromeClient::ScrollableInnerFrameTrigger))
</span><span class="lines">@@ -2597,16 +2551,11 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> auto& frameRenderer = downcast<RenderWidget>(renderer);
</span><del>-
</del><span class="cx"> if (!frameRenderer.requiresAcceleratedCompositing())
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> m_reevaluateCompositingAfterLayout = true;
</span><span class="cx">
</span><del>- RenderLayerCompositor* innerCompositor = frameContentsCompositor(&frameRenderer);
- if (!innerCompositor || !innerCompositor->shouldPropagateCompositingToEnclosingFrame())
- return false;
-
</del><span class="cx"> // If we can't reliably know the size of the iframe yet, don't change compositing state.
</span><span class="cx"> if (!frameRenderer.parent() || frameRenderer.needsLayout())
</span><span class="cx"> return frameRenderer.hasLayer() && frameRenderer.layer()->isComposited();
</span><span class="lines">@@ -2695,7 +2644,7 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> // iOS WK1 has fixed/sticky support in the main frame via WebFixedPositionContent.
</span><del>- return m_renderView.frameView().frame().isMainFrame();
</del><ins>+ return isMainFrameCompositor();
</ins><span class="cx"> #else
</span><span class="cx"> return false;
</span><span class="cx"> #endif
</span><span class="lines">@@ -2839,7 +2788,7 @@
</span><span class="cx"> FrameView& frameView = m_renderView.frameView();
</span><span class="cx">
</span><span class="cx"> // This applies when the application UI handles scrolling, in which case RenderLayerCompositor doesn't need to manage it.
</span><del>- if (frameView.delegatesScrolling() && frameView.frame().isMainFrame())
</del><ins>+ if (frameView.delegatesScrolling() && isMainFrameCompositor())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // We need to handle our own scrolling if we're:
</span><span class="lines">@@ -2979,7 +2928,7 @@
</span><span class="cx"> // Nothing to do here yet.
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderLayerCompositor::mainFrameBackingIsTiled() const
</del><ins>+bool RenderLayerCompositor::documentUsesTiledBacking() const
</ins><span class="cx"> {
</span><span class="cx"> RenderLayer* layer = m_renderView.layer();
</span><span class="cx"> if (!layer)
</span><span class="lines">@@ -2992,6 +2941,11 @@
</span><span class="cx"> return backing->usingTiledBacking();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool RenderLayerCompositor::isMainFrameCompositor() const
+{
+ return m_renderView.frameView().frame().isMainFrame();
+}
+
</ins><span class="cx"> bool RenderLayerCompositor::shouldCompositeOverflowControls() const
</span><span class="cx"> {
</span><span class="cx"> FrameView& frameView = m_renderView.frameView();
</span><span class="lines">@@ -3002,7 +2956,7 @@
</span><span class="cx"> if (frameView.delegatesScrolling())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (mainFrameBackingIsTiled())
</del><ins>+ if (documentUsesTiledBacking())
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> if (!frameView.hasOverlayScrollbars())
</span><span class="lines">@@ -3029,12 +2983,11 @@
</span><span class="cx"> #if ENABLE(RUBBER_BANDING)
</span><span class="cx"> bool RenderLayerCompositor::requiresOverhangAreasLayer() const
</span><span class="cx"> {
</span><del>- // We don't want a layer if this is a subframe.
- if (m_renderView.document().ownerElement())
</del><ins>+ if (!isMainFrameCompositor())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // We do want a layer if we're using tiled drawing and can scroll.
</span><del>- if (mainFrameBackingIsTiled() && m_renderView.frameView().hasOpaqueBackground() && !m_renderView.frameView().prohibitsScrolling())
</del><ins>+ if (documentUsesTiledBacking() && m_renderView.frameView().hasOpaqueBackground() && !m_renderView.frameView().prohibitsScrolling())
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> return false;
</span><span class="lines">@@ -3042,8 +2995,7 @@
</span><span class="cx">
</span><span class="cx"> bool RenderLayerCompositor::requiresContentShadowLayer() const
</span><span class="cx"> {
</span><del>- // We don't want a layer if this is a subframe.
- if (m_renderView.document().ownerElement())
</del><ins>+ if (!isMainFrameCompositor())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -3055,7 +3007,7 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // On Mac, we want a content shadow layer if we're using tiled drawing and can scroll.
</span><del>- if (mainFrameBackingIsTiled() && !m_renderView.frameView().prohibitsScrolling())
</del><ins>+ if (documentUsesTiledBacking() && !m_renderView.frameView().prohibitsScrolling())
</ins><span class="cx"> return true;
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -3064,15 +3016,15 @@
</span><span class="cx">
</span><span class="cx"> GraphicsLayer* RenderLayerCompositor::updateLayerForTopOverhangArea(bool wantsLayer)
</span><span class="cx"> {
</span><del>- if (m_renderView.document().ownerElement())
- return 0;
</del><ins>+ if (!isMainFrameCompositor())
+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> if (!wantsLayer) {
</span><span class="cx"> if (m_layerForTopOverhangArea) {
</span><span class="cx"> m_layerForTopOverhangArea->removeFromParent();
</span><span class="cx"> m_layerForTopOverhangArea = nullptr;
</span><span class="cx"> }
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!m_layerForTopOverhangArea) {
</span><span class="lines">@@ -3088,15 +3040,15 @@
</span><span class="cx">
</span><span class="cx"> GraphicsLayer* RenderLayerCompositor::updateLayerForBottomOverhangArea(bool wantsLayer)
</span><span class="cx"> {
</span><del>- if (m_renderView.document().ownerElement())
- return 0;
</del><ins>+ if (!isMainFrameCompositor())
+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> if (!wantsLayer) {
</span><span class="cx"> if (m_layerForBottomOverhangArea) {
</span><span class="cx"> m_layerForBottomOverhangArea->removeFromParent();
</span><span class="cx"> m_layerForBottomOverhangArea = nullptr;
</span><span class="cx"> }
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!m_layerForBottomOverhangArea) {
</span><span class="lines">@@ -3114,8 +3066,8 @@
</span><span class="cx">
</span><span class="cx"> GraphicsLayer* RenderLayerCompositor::updateLayerForHeader(bool wantsLayer)
</span><span class="cx"> {
</span><del>- if (m_renderView.document().ownerElement())
- return 0;
</del><ins>+ if (!isMainFrameCompositor())
+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> if (!wantsLayer) {
</span><span class="cx"> if (m_layerForHeader) {
</span><span class="lines">@@ -3127,7 +3079,7 @@
</span><span class="cx"> if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
</span><span class="cx"> scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView());
</span><span class="cx"> }
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!m_layerForHeader) {
</span><span class="lines">@@ -3155,8 +3107,8 @@
</span><span class="cx">
</span><span class="cx"> GraphicsLayer* RenderLayerCompositor::updateLayerForFooter(bool wantsLayer)
</span><span class="cx"> {
</span><del>- if (m_renderView.document().ownerElement())
- return 0;
</del><ins>+ if (!isMainFrameCompositor())
+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> if (!wantsLayer) {
</span><span class="cx"> if (m_layerForFooter) {
</span><span class="lines">@@ -3168,7 +3120,7 @@
</span><span class="cx"> if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
</span><span class="cx"> scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView());
</span><span class="cx"> }
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!m_layerForFooter) {
</span><span class="lines">@@ -3371,7 +3323,7 @@
</span><span class="cx">
</span><span class="cx"> void RenderLayerCompositor::ensureRootLayer()
</span><span class="cx"> {
</span><del>- RootLayerAttachment expectedAttachment = shouldPropagateCompositingToEnclosingFrame() ? RootLayerAttachedViaEnclosingFrame : RootLayerAttachedViaChromeClient;
</del><ins>+ RootLayerAttachment expectedAttachment = isMainFrameCompositor() ? RootLayerAttachedViaChromeClient : RootLayerAttachedViaEnclosingFrame;
</ins><span class="cx"> if (expectedAttachment == m_rootLayerAttachment)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -3605,18 +3557,9 @@
</span><span class="cx"> m_rootContentLayer->addChild(&pageOverlayController.documentOverlayRootLayer());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// 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.
</del><span class="cx"> void RenderLayerCompositor::notifyIFramesOfCompositingChange()
</span><span class="cx"> {
</span><del>- 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
</del><ins>+ // Compositing affects the answer to RenderIFrame::requiresAcceleratedCompositing(), so
</ins><span class="cx"> // we need to schedule a style recalc in our parent document.
</span><span class="cx"> if (HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerElement())
</span><span class="cx"> ownerElement->scheduleSetNeedsStyleRecalc(SyntheticStyleChange);
</span><span class="lines">@@ -3991,7 +3934,7 @@
</span><span class="cx"> void RenderLayerCompositor::registerAllViewportConstrainedLayers()
</span><span class="cx"> {
</span><span class="cx"> // Only the main frame should register fixed/sticky layers.
</span><del>- if (m_renderView.document().ownerElement())
</del><ins>+ if (!isMainFrameCompositor())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (scrollingCoordinator())
</span><span class="lines">@@ -4026,7 +3969,7 @@
</span><span class="cx"> void RenderLayerCompositor::unregisterAllViewportConstrainedLayers()
</span><span class="cx"> {
</span><span class="cx"> // Only the main frame should register fixed/sticky layers.
</span><del>- if (m_renderView.document().ownerElement())
</del><ins>+ if (!isMainFrameCompositor())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (scrollingCoordinator())
</span><span class="lines">@@ -4115,7 +4058,7 @@
</span><span class="cx"> if (Page* page = this->page())
</span><span class="cx"> return page->scrollingCoordinator();
</span><span class="cx">
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> GraphicsLayerFactory* RenderLayerCompositor::graphicsLayerFactory() const
</span><span class="lines">@@ -4123,7 +4066,7 @@
</span><span class="cx"> if (Page* page = this->page())
</span><span class="cx"> return page->chrome().client().graphicsLayerFactory();
</span><span class="cx">
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Page* RenderLayerCompositor::page() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (183942 => 183943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h        2015-05-07 20:13:47 UTC (rev 183942)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h        2015-05-07 20:45:42 UTC (rev 183943)
</span><span class="lines">@@ -227,11 +227,6 @@
</span><span class="cx"> // to know if there is non-affine content, e.g. for drawing into an image.
</span><span class="cx"> bool has3DContent() const;
</span><span class="cx">
</span><del>- // 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;
-
</del><span class="cx"> static RenderLayerCompositor* frameContentsCompositor(RenderWidget*);
</span><span class="cx"> // Return true if the layers changed.
</span><span class="cx"> static bool parentFrameContentLayers(RenderWidget*);
</span><span class="lines">@@ -476,7 +471,8 @@
</span><span class="cx"> void logLayerInfo(const RenderLayer&, int depth);
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- bool mainFrameBackingIsTiled() const;
</del><ins>+ bool documentUsesTiledBacking() const;
+ bool isMainFrameCompositor() const;
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> RenderView& m_renderView;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderWidgetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderWidget.cpp (183942 => 183943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderWidget.cpp        2015-05-07 20:13:47 UTC (rev 183942)
+++ trunk/Source/WebCore/rendering/RenderWidget.cpp        2015-05-07 20:45:42 UTC (rev 183943)
</span><span class="lines">@@ -239,7 +239,7 @@
</span><span class="cx">
</span><span class="cx"> if (is<FrameView>(*m_widget)) {
</span><span class="cx"> FrameView& frameView = downcast<FrameView>(*m_widget);
</span><del>- bool runOverlapTests = !frameView.useSlowRepaintsIfNotOverlapped() || frameView.hasCompositedContentIncludingDescendants();
</del><ins>+ bool runOverlapTests = !frameView.useSlowRepaintsIfNotOverlapped();
</ins><span class="cx"> if (paintInfo.overlapTestRequests && runOverlapTests) {
</span><span class="cx"> ASSERT(!paintInfo.overlapTestRequests->contains(this));
</span><span class="cx"> paintInfo.overlapTestRequests->set(this, m_widget->frameRect());
</span></span></pre>
</div>
</div>
</body>
</html>