https://bugs.webkit.org/show_bug.cgi?id=131665
Reviewed by Tim Horton.
The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
was triggering a compositing layer flush when called with a null rootLayer, which happens
for pages going into the page cache. This would trigger a layer flush that would clobber
the root layer for the visible page, resulting in missing content.
Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
was being added to (and then removed from) every single compositing layers.
Fix both these by changing to a pull model, where RenderLayerCompositor requests
the overlay layer via ChromeClient, and gets it at the end of every flush,
adding to the children of the root layer.
Source/WebCore:
* WebCore.exp.in:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor):
(WebCore::RenderLayerCompositor::flushPendingLayerChanges): Put visibleRect
into a variable for ease of debugging.
(WebCore::RenderLayerCompositor::updateCompositingLayers): Asser
that we're not in the page cache (this would have caught the bug).
(WebCore::RenderLayerCompositor::appendOverlayLayers):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::setDocumentOverlayRootLayer): Deleted.
* rendering/RenderLayerCompositor.h:
Source/WebKit2:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::documentOverlayLayerForFrame):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167316
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-04-15 Simon Fraser <simon.fraser@apple.com>
+
+ [iOS WK2] Pages often blank on first load if page loaded by typing the URL
+ https://bugs.webkit.org/show_bug.cgi?id=131665
+
+ Reviewed by Tim Horton.
+
+ The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
+ was triggering a compositing layer flush when called with a null rootLayer, which happens
+ for pages going into the page cache. This would trigger a layer flush that would clobber
+ the root layer for the visible page, resulting in missing content.
+
+ Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
+ was being added to (and then removed from) every single compositing layers.
+
+ Fix both these by changing to a pull model, where RenderLayerCompositor requests
+ the overlay layer via ChromeClient, and gets it at the end of every flush,
+ adding to the children of the root layer.
+
+ * WebCore.exp.in:
+ * page/ChromeClient.h:
+ (WebCore::ChromeClient::documentOverlayLayerForFrame):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::RenderLayerCompositor):
+ (WebCore::RenderLayerCompositor::flushPendingLayerChanges): Put visibleRect
+ into a variable for ease of debugging.
+ (WebCore::RenderLayerCompositor::updateCompositingLayers): Asser
+ that we're not in the page cache (this would have caught the bug).
+ (WebCore::RenderLayerCompositor::appendOverlayLayers):
+ (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
+ (WebCore::RenderLayerCompositor::setDocumentOverlayRootLayer): Deleted.
+ * rendering/RenderLayerCompositor.h:
+
2014-04-15 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r167199 and r167251.
__ZN7WebCore21NetworkStorageSession28createPrivateBrowsingSessionERKN3WTF6StringE
__ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS_13PlatformEvent4TypeEb
__ZN7WebCore21RemoteCommandListener6createERNS_27RemoteCommandListenerClientE
-__ZN7WebCore21RenderLayerCompositor27setDocumentOverlayRootLayerEPNS_13GraphicsLayerE
__ZN7WebCore21ResourceLoadScheduler20servePendingRequestsENS_20ResourceLoadPriorityE
__ZN7WebCore21ResourceLoadScheduler20servePendingRequestsEPNS0_15HostInformationENS_20ResourceLoadPriorityE
__ZN7WebCore21ResourceLoadScheduler21resumePendingRequestsEv
// Returns whether or not the client can render the composited layer,
// regardless of the settings.
virtual bool allowsAcceleratedCompositing() const { return true; }
+ // Supply a layer that will added as an overlay over other document layers (scrolling with the document).
+ virtual GraphicsLayer* documentOverlayLayerForFrame(Frame&) { return nullptr; }
enum CompositingTrigger {
ThreeDTransformTrigger = 1 << 0,
, m_isTrackingRepaints(false)
, m_layersWithTiledBackingCount(0)
, m_rootLayerAttachment(RootLayerUnattached)
- , m_documentOverlayRootLayer(nullptr)
, m_layerFlushTimer(this, &RenderLayerCompositor::layerFlushTimerFired)
, m_layerFlushThrottlingEnabled(page() && page()->progress().isMainLoadProgressing())
, m_layerFlushThrottlingTemporarilyDisabledForInteraction(false)
#if PLATFORM(IOS)
double horizontalMargin = defaultTileWidth / pageScaleFactor();
double verticalMargin = defaultTileHeight / pageScaleFactor();
- rootLayer->flushCompositingState(frameView.computeCoverageRect(horizontalMargin, verticalMargin));
+ FloatRect visibleRect = frameView.computeCoverageRect(horizontalMargin, verticalMargin);
+ rootLayer->flushCompositingState(visibleRect);
#else
// Having a m_clipLayer indicates that we're doing scrolling via GraphicsLayers.
IntRect visibleRect = m_clipLayer ? IntRect(IntPoint(), frameView.contentsSize()) : frameView.visibleContentRect();
void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType updateType, RenderLayer* updateRoot)
{
m_updateCompositingLayersTimer.stop();
+
+ ASSERT(!m_renderView.document().inPageCache());
// Compositing layers will be updated in Document::implicitClose() if suppressed here.
if (!m_renderView.document().visualUpdatesAllowed())
// Host the document layer in the RenderView's root layer.
if (isFullUpdate) {
+ appendOverlayLayers(childList);
// Even when childList is empty, don't drop out of compositing mode if there are
// composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden).
if (childList.isEmpty() && !hasAnyAdditionalCompositedLayers(*updateRoot))
destroyRootLayer();
- else
+ else if (m_rootContentLayer)
m_rootContentLayer->setChildren(childList);
}
} else if (needGeometryUpdate) {
InspectorInstrumentation::layerTreeDidChange(page());
}
+void RenderLayerCompositor::appendOverlayLayers(Vector<GraphicsLayer*>& childList)
+{
+ Frame& frame = m_renderView.frameView().frame();
+ Page* page = frame.page();
+ if (!page)
+ return;
+
+ if (GraphicsLayer* overlayLayer = page->chrome().client().documentOverlayLayerForFrame(frame))
+ childList.append(overlayLayer);
+}
+
void RenderLayerCompositor::layerBecameNonComposited(const RenderLayer& layer)
{
// Inform the inspector that the given RenderLayer was destroyed.
childLayersOfEnclosingLayer.append(layerBacking->childForSuperlayers());
}
-
- if (m_documentOverlayRootLayer)
- childLayersOfEnclosingLayer.append(m_documentOverlayRootLayer);
}
void RenderLayerCompositor::rebuildRegionCompositingLayerTree(RenderNamedFlowFragment* region, Vector<GraphicsLayer*>& childList, int depth)
m_renderView.frameView().firePaintRelatedMilestonesIfNeeded();
}
-void RenderLayerCompositor::setDocumentOverlayRootLayer(GraphicsLayer* documentOverlayRootLayer)
-{
- if (m_documentOverlayRootLayer)
- m_documentOverlayRootLayer->removeFromParent();
- m_documentOverlayRootLayer = documentOverlayRootLayer;
- setCompositingLayersNeedRebuild(true);
- scheduleCompositingLayerUpdate();
-}
-
} // namespace WebCore
void setRootExtendedBackgroundColor(const Color&);
Color rootExtendedBackgroundColor() const { return m_rootExtendedBackgroundColor; }
- void setDocumentOverlayRootLayer(GraphicsLayer*);
-
private:
class OverlapMap;
bool layerHas3DContent(const RenderLayer&) const;
bool isRunningAcceleratedTransformAnimation(RenderLayerModelObject&) const;
+ void appendOverlayLayers(Vector<GraphicsLayer*>&);
bool hasAnyAdditionalCompositedLayers(const RenderLayer& rootLayer) const;
void ensureRootLayer();
std::unique_ptr<GraphicsLayer> m_layerForFooter;
#endif
- GraphicsLayer* m_documentOverlayRootLayer;
-
std::unique_ptr<GraphicsLayerUpdater> m_layerUpdater; // Updates tiled layer visible area periodically while animations are running.
Timer<RenderLayerCompositor> m_layerFlushTimer;
+2014-04-15 Simon Fraser <simon.fraser@apple.com>
+
+ [iOS WK2] Pages often blank on first load if page loaded by typing the URL
+ https://bugs.webkit.org/show_bug.cgi?id=131665
+
+ Reviewed by Tim Horton.
+
+ The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
+ was triggering a compositing layer flush when called with a null rootLayer, which happens
+ for pages going into the page cache. This would trigger a layer flush that would clobber
+ the root layer for the visible page, resulting in missing content.
+
+ Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
+ was being added to (and then removed from) every single compositing layers.
+
+ Fix both these by changing to a pull model, where RenderLayerCompositor requests
+ the overlay layer via ChromeClient, and gets it at the end of every flush,
+ adding to the children of the root layer.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::documentOverlayLayerForFrame):
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+ (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
+
2014-04-15 Jinwoo Song <jinwoo7.song@samsung.com>
[EFL][WK2] Pass Mouse movement data to WebMouseEvent
m_page->exitAcceleratedCompositingMode();
}
+GraphicsLayer* WebChromeClient::documentOverlayLayerForFrame(Frame& frame)
+{
+ if (&frame == &m_page->corePage()->mainFrame())
+ return m_page->pageOverlayController().documentOverlayRootLayer();
+
+ return nullptr;
+}
+
void WebChromeClient::setNeedsOneShotDrawingSynchronization()
{
notImplemented();
virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
virtual void setNeedsOneShotDrawingSynchronization() override;
virtual void scheduleCompositingLayerFlush() override;
+ virtual WebCore::GraphicsLayer* documentOverlayLayerForFrame(WebCore::Frame&) override;
virtual CompositingTriggerFlags allowedCompositingTriggers() const
{
children.append(m_webPage->pageOverlayController().viewOverlayRootLayer());
}
m_rootLayer->setChildren(children);
-
- m_webPage->mainFrameView()->renderView()->compositor().setDocumentOverlayRootLayer(m_webPage->pageOverlayController().documentOverlayRootLayer());
}
void RemoteLayerTreeDrawingArea::updateGeometry(const IntSize& viewSize, const IntSize& layerPosition)
[m_hostingLayer setSublayers:layer ? @[ layer, m_webPage->pageOverlayController().viewOverlayRootLayer()->platformLayer() ] : @[ ]];
- m_webPage->mainFrameView()->renderView()->compositor().setDocumentOverlayRootLayer(m_webPage->pageOverlayController().documentOverlayRootLayer());
-
bool hadRootLayer = !!m_rootLayer;
m_rootLayer = layer;
[m_rootLayer setSublayerTransform:m_transform];