WebKit Bugzilla
Attachment 342016 Details for
Bug 186330
: Regions outside of the fullscreen window are exposed during zoom operations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186330-20180605181956.patch (text/plain), 11.42 KB, created by
Jer Noble
on 2018-06-05 18:19:58 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jer Noble
Created:
2018-06-05 18:19:58 PDT
Size:
11.42 KB
patch
obsolete
>Subversion Revision: 232261 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f36cd219bef6acbdcb41614e2bb5c30db5ddecfd..b988bacef0192d31d91cefea66fece11537d9e6b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,30 @@ >+2018-06-05 Jer Noble <jer.noble@apple.com> >+ >+ Regions outside of the fullscreen window are exposed during zoom operations >+ https://bugs.webkit.org/show_bug.cgi?id=186330 >+ <rdar://problem/34698009> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: fullscreen/full-screen-layer-dump.html >+ >+ Introduce the concept of "requiresBackgroundLayer" to RenderLayerBacking, for use by >+ RenderFullScreen. Previously, the backgroundLayer in RenderLayerBacking was only used >+ by the root renderer with fixed backgrounds. Give the RenderFullScreen a background layer >+ that's approximately 3x as tall and wide as the renderer itself, so nothing is exposed >+ during pinch operations. >+ >+ * rendering/RenderLayerBacking.cpp: >+ (WebCore::RenderLayerBacking::RenderLayerBacking): >+ (WebCore::RenderLayerBacking::updateConfiguration): >+ (WebCore::RenderLayerBacking::updateGeometry): >+ (WebCore::RenderLayerBacking::updateDrawsContent): >+ (WebCore::RenderLayerBacking::setRequiresBackgroundLayer): >+ (WebCore::RenderLayerBacking::updateBackgroundLayer): >+ (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor): >+ (WebCore::RenderLayerBacking::paintIntoLayer): >+ * rendering/RenderLayerBacking.h: >+ > 2018-05-29 Jer Noble <jer.noble@apple.com> > > Media elements outside fullscreen should not be considered main content. >diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp >index ac3d7c417f676a5647ffc936d34c2b70fd0fe36a..ad547949c8b22018b3746caebd018171c9e1e3de 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.cpp >+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp >@@ -217,6 +217,9 @@ RenderLayerBacking::RenderLayerBacking(RenderLayer& layer) > } > > createPrimaryGraphicsLayer(); >+#if ENABLE(FULLSCREEN_API) >+ setRequiresBackgroundLayer(layer.renderer().isRenderFullScreen()); >+#endif > > if (auto* tiledBacking = this->tiledBacking()) { > tiledBacking->setIsInWindow(renderer().page().isInWindow()); >@@ -670,7 +673,7 @@ bool RenderLayerBacking::updateConfiguration() > setBackgroundLayerPaintsFixedRootBackground(compositor().needsFixedRootBackgroundLayer(m_owningLayer)); > > // The background layer is currently only used for fixed root backgrounds. >- if (updateBackgroundLayer(m_backgroundLayerPaintsFixedRootBackground)) >+ if (updateBackgroundLayer(m_backgroundLayerPaintsFixedRootBackground || m_requiresBackgroundLayer)) > layerConfigChanged = true; > > if (updateForegroundLayer(compositor().needsContentsCompositingLayer(m_owningLayer))) >@@ -1031,7 +1034,7 @@ void RenderLayerBacking::updateGeometry() > positionOverflowControlsLayers(); > } > >- if (!m_isMainFrameRenderViewLayer && !m_isFrameLayerWithTiledBacking) { >+ if (!m_isMainFrameRenderViewLayer && !m_isFrameLayerWithTiledBacking && !m_requiresBackgroundLayer) { > // For non-root layers, background is always painted by the primary graphics layer. > ASSERT(!m_backgroundLayer); > // Subpixel offset from graphics layer or size changed. >@@ -1120,6 +1123,10 @@ void RenderLayerBacking::updateGeometry() > const FrameView& frameView = renderer().view().frameView(); > backgroundPosition = frameView.scrollPositionForFixedPosition(); > backgroundSize = frameView.layoutSize(); >+ } else { >+ auto boundingBox = renderer().objectBoundingBox(); >+ backgroundPosition = boundingBox.location(); >+ backgroundSize = boundingBox.size(); > } > m_backgroundLayer->setPosition(backgroundPosition); > m_backgroundLayer->setSize(backgroundSize); >@@ -1386,7 +1393,7 @@ void RenderLayerBacking::updateDrawsContent(PaintedContentsInfo& contentsInfo) > m_graphicsLayer->setSupportsSubpixelAntialiasedText(m_paintsSubpixelAntialiasedText); > > if (m_backgroundLayer) >- m_backgroundLayer->setDrawsContent(hasPaintedContent); >+ m_backgroundLayer->setDrawsContent(contentsInfo.paintsBoxDecorations()); > } > > // Return true if the layer changed. >@@ -1444,6 +1451,11 @@ void RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground(bool backgr > } > } > >+void RenderLayerBacking::setRequiresBackgroundLayer(bool requiresBackgroundLayer) >+{ >+ m_requiresBackgroundLayer = requiresBackgroundLayer; >+} >+ > bool RenderLayerBacking::requiresHorizontalScrollbarLayer() const > { > if (!m_owningLayer.hasOverlayScrollbars() && !m_owningLayer.needsCompositedScrolling()) >@@ -1640,8 +1652,9 @@ bool RenderLayerBacking::updateBackgroundLayer(bool needsBackgroundLayer) > > if (layerChanged) { > m_graphicsLayer->setNeedsDisplay(); >- // This assumes that the background layer is only used for fixed backgrounds, which is currently a correct assumption. >- compositor().fixedRootBackgroundLayerChanged(); >+ >+ if (m_backgroundLayerPaintsFixedRootBackground) >+ compositor().fixedRootBackgroundLayerChanged(); > } > > return layerChanged; >@@ -1890,6 +1903,19 @@ Color RenderLayerBacking::rendererBackgroundColor() const > > void RenderLayerBacking::updateDirectlyCompositedBackgroundColor(PaintedContentsInfo& contentsInfo, bool& didUpdateContentsRect) > { >+ if (m_backgroundLayer && !contentsInfo.paintsBoxDecorations()) { >+ m_graphicsLayer->setContentsToSolidColor(Color()); >+ m_backgroundLayer->setContentsToSolidColor(rendererBackgroundColor()); >+ >+ FloatRect contentsRect = backgroundBoxForSimpleContainerPainting(); >+ // NOTE: This is currently only used by RenderFullScreen, which we want to be >+ // big enough to hide overflow areas of the root. >+ contentsRect.inflate(contentsRect.size()); >+ m_backgroundLayer->setContentsRect(contentsRect); >+ m_backgroundLayer->setContentsClippingRect(FloatRoundedRect(contentsRect)); >+ return; >+ } >+ > if (!contentsInfo.isSimpleContainer() || (is<RenderBox>(renderer()) && !downcast<RenderBox>(renderer()).paintsOwnBackground())) { > m_graphicsLayer->setContentsToSolidColor(Color()); > return; >@@ -2519,7 +2545,7 @@ void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap > if (paintingPhase & GraphicsLayerPaintCompositedScroll) > paintFlags |= RenderLayer::PaintLayerPaintingCompositingScrollingPhase; > >- if (graphicsLayer == m_backgroundLayer.get()) >+ if (graphicsLayer == m_backgroundLayer.get() && m_backgroundLayerPaintsFixedRootBackground) > paintFlags |= (RenderLayer::PaintLayerPaintingRootBackgroundOnly | RenderLayer::PaintLayerPaintingCompositingForegroundPhase); // Need PaintLayerPaintingCompositingForegroundPhase to walk child layers. > else if (compositor().fixedRootBackgroundLayer()) > paintFlags |= RenderLayer::PaintLayerPaintingSkipRootBackground; >diff --git a/Source/WebCore/rendering/RenderLayerBacking.h b/Source/WebCore/rendering/RenderLayerBacking.h >index d9c26a4f77be4cf41f9ddccace51bc104c00e495..f7071af47060b0736e730ec160f2a585681e66b9 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.h >+++ b/Source/WebCore/rendering/RenderLayerBacking.h >@@ -98,6 +98,9 @@ public: > GraphicsLayer* foregroundLayer() const { return m_foregroundLayer.get(); } > GraphicsLayer* backgroundLayer() const { return m_backgroundLayer.get(); } > bool backgroundLayerPaintsFixedRootBackground() const { return m_backgroundLayerPaintsFixedRootBackground; } >+ >+ bool requiresBackgroundLayer() const { return m_requiresBackgroundLayer; } >+ void setRequiresBackgroundLayer(bool); > > bool hasScrollingLayer() const { return m_scrollingLayer != nullptr; } > GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); } >@@ -384,6 +387,7 @@ private: > bool m_canCompositeBackdropFilters { false }; > #endif > bool m_backgroundLayerPaintsFixedRootBackground { false }; >+ bool m_requiresBackgroundLayer { false }; > bool m_paintsSubpixelAntialiasedText { false }; // This is for logging only. > }; > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 442f9b96bd214aa0a96edb5ff370bdae4c1a5abe..ba77b15338f32684f2e0b166cd16c81cbe23a5f2 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-06-05 Jer Noble <jer.noble@apple.com> >+ >+ Regions outside of the fullscreen window are exposed during zoom operations >+ https://bugs.webkit.org/show_bug.cgi?id=186330 >+ <rdar://problem/34698009> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fullscreen/full-screen-layer-dump-expected.txt: Added. >+ * fullscreen/full-screen-layer-dump.html: Added. >+ > 2018-05-29 Jer Noble <jer.noble@apple.com> > > Media elements outside fullscreen should not be considered main content. >diff --git a/LayoutTests/fullscreen/full-screen-layer-dump-expected.txt b/LayoutTests/fullscreen/full-screen-layer-dump-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..edcd3be277033cdb3dab675f5e8deb613751646e >--- /dev/null >+++ b/LayoutTests/fullscreen/full-screen-layer-dump-expected.txt >@@ -0,0 +1,27 @@ >+(GraphicsLayer >+ (anchor 0.00 0.00) >+ (bounds 800.00 600.00) >+ (children 1 >+ (GraphicsLayer >+ (bounds 800.00 600.00) >+ (contentsOpaque 1) >+ (children 1 >+ (GraphicsLayer >+ (bounds 800.00 600.00) >+ (children 2 >+ (GraphicsLayer >+ (anchor 0.00 0.00) >+ (bounds 800.00 600.00) >+ (contents layer -800.00, -600.00 2400.00 x 1800.00) >+ ) >+ (GraphicsLayer >+ (bounds 800.00 600.00) >+ (drawsContent 1) >+ ) >+ ) >+ ) >+ ) >+ ) >+ ) >+) >+ >diff --git a/LayoutTests/fullscreen/full-screen-layer-dump.html b/LayoutTests/fullscreen/full-screen-layer-dump.html >new file mode 100644 >index 0000000000000000000000000000000000000000..5ee23607853070f2c89381b662b59e1928e7370d >--- /dev/null >+++ b/LayoutTests/fullscreen/full-screen-layer-dump.html >@@ -0,0 +1,46 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<style> >+body { >+ font-family: ahem; >+ -webkit-font-smoothing: none; >+} >+</style> >+<script> >+ window.addEventListener('load', event => { >+ let out = document.querySelector('#out'); >+ let target = document.querySelector('#target'); >+ >+ if (!window.internals || !window.testRunner || !window.eventSender) { >+ out.innerText = 'This test requires internals'; >+ return; >+ } >+ >+ testRunner.dumpAsText(false); >+ testRunner.waitUntilDone(); >+ >+ document.addEventListener('webkitfullscreenchange', event => { >+ if (document.webkitIsFullScreen) { >+ setTimeout(() => { >+ out.innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_CONTENT_LAYERS); >+ document.webkitCancelFullScreen(); >+ }, 0) >+ } else >+ testRunner.notifyDone(); >+ }); >+ >+ >+ document.addEventListener('keydown', event => { >+ target.webkitRequestFullScreen(); >+ }); >+ if (window.eventSender) >+ eventSender.keyDown('a'); >+ }); >+</script> >+</head> >+<body> >+ <div id=target></div> >+ <pre id=out></pre> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186330
:
342012
|
342016
|
342021
|
342027