Title: [245207] trunk
- Revision
- 245207
- Author
- [email protected]
- Date
- 2019-05-11 15:05:37 -0700 (Sat, 11 May 2019)
Log Message
Translucent gradient rendering bug due to will-change transform
https://bugs.webkit.org/show_bug.cgi?id=197654
<rdar://problem/50547664>
Reviewed by Dean Jackson.
Source/WebCore:
We failed to re-evaluate 'contentsOpaque' when a background changed, because this
happened in updateGeometry() and that doesn't run for background changes.
However, 'contentsOpaque' also requires knowing about geometry because we have to
turn it off when there's subpixel positioning, and updateConfiguration()
runs before updateGeometry().
So compute m_hasSubpixelRounding in updateGeometry() and set contentsOpaque in
updateAfterDescendants().
Test: compositing/contents-opaque/background-change-to-transparent.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateAfterDescendants):
* rendering/RenderLayerBacking.h:
LayoutTests:
* compositing/contents-opaque/background-change-to-transparent-expected.txt: Added.
* compositing/contents-opaque/background-change-to-transparent.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (245206 => 245207)
--- trunk/LayoutTests/ChangeLog 2019-05-11 20:58:52 UTC (rev 245206)
+++ trunk/LayoutTests/ChangeLog 2019-05-11 22:05:37 UTC (rev 245207)
@@ -1,5 +1,16 @@
2019-05-11 Simon Fraser <[email protected]>
+ Translucent gradient rendering bug due to will-change transform
+ https://bugs.webkit.org/show_bug.cgi?id=197654
+ <rdar://problem/50547664>
+
+ Reviewed by Dean Jackson.
+
+ * compositing/contents-opaque/background-change-to-transparent-expected.txt: Added.
+ * compositing/contents-opaque/background-change-to-transparent.html: Added.
+
+2019-05-11 Simon Fraser <[email protected]>
+
When the scroller hosting a shared layer becomes non-scrollable, content disappears
https://bugs.webkit.org/show_bug.cgi?id=197766
<rdar://problem/50695808>
Added: trunk/LayoutTests/compositing/contents-opaque/background-change-to-transparent-expected.txt (0 => 245207)
--- trunk/LayoutTests/compositing/contents-opaque/background-change-to-transparent-expected.txt (rev 0)
+++ trunk/LayoutTests/compositing/contents-opaque/background-change-to-transparent-expected.txt 2019-05-11 22:05:37 UTC (rev 245207)
@@ -0,0 +1,19 @@
+Text here
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (children 1
+ (GraphicsLayer
+ (position 18.00 10.00)
+ (bounds 300.00 300.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+)
+
Added: trunk/LayoutTests/compositing/contents-opaque/background-change-to-transparent.html (0 => 245207)
--- trunk/LayoutTests/compositing/contents-opaque/background-change-to-transparent.html (rev 0)
+++ trunk/LayoutTests/compositing/contents-opaque/background-change-to-transparent.html 2019-05-11 22:05:37 UTC (rev 245207)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Tests that contentsOpaque is re-evaluated after a background style change</title>
+ <style>
+ .composited {
+ margin: 20px;
+ height: 300px;
+ width: 300px;
+ margin: 10px;
+ background-color: silver;
+ transform: translateZ(0);
+ }
+
+ .composited.changed {
+ background: none;
+ }
+ </style>
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ window.addEventListener('load', () => {
+ setTimeout(() => {
+ document.querySelector('.composited').classList.add('changed');
+ if (window.internals)
+ document.getElementById('layers').textContent = window.internals.layerTreeAsText(document);
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
+ }, false);
+ </script>
+</head>
+<body>
+ <div class="composited">Text here</div>
+<pre id="layers"></pre>
+</body>
+</html>
+
Modified: trunk/Source/WebCore/ChangeLog (245206 => 245207)
--- trunk/Source/WebCore/ChangeLog 2019-05-11 20:58:52 UTC (rev 245206)
+++ trunk/Source/WebCore/ChangeLog 2019-05-11 22:05:37 UTC (rev 245207)
@@ -1,5 +1,31 @@
2019-05-11 Simon Fraser <[email protected]>
+ Translucent gradient rendering bug due to will-change transform
+ https://bugs.webkit.org/show_bug.cgi?id=197654
+ <rdar://problem/50547664>
+
+ Reviewed by Dean Jackson.
+
+ We failed to re-evaluate 'contentsOpaque' when a background changed, because this
+ happened in updateGeometry() and that doesn't run for background changes.
+
+ However, 'contentsOpaque' also requires knowing about geometry because we have to
+ turn it off when there's subpixel positioning, and updateConfiguration()
+ runs before updateGeometry().
+
+ So compute m_hasSubpixelRounding in updateGeometry() and set contentsOpaque in
+ updateAfterDescendants().
+
+ Test: compositing/contents-opaque/background-change-to-transparent.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateConfiguration):
+ (WebCore::RenderLayerBacking::updateGeometry):
+ (WebCore::RenderLayerBacking::updateAfterDescendants):
+ * rendering/RenderLayerBacking.h:
+
+2019-05-11 Simon Fraser <[email protected]>
+
When the scroller hosting a shared layer becomes non-scrollable, content disappears
https://bugs.webkit.org/show_bug.cgi?id=197766
<rdar://problem/50695808>
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (245206 => 245207)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2019-05-11 20:58:52 UTC (rev 245206)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2019-05-11 22:05:37 UTC (rev 245207)
@@ -819,7 +819,7 @@
updateRootLayerConfiguration();
updateEventRegion();
-
+
// Requires layout.
if (contentsInfo.isDirectlyCompositedImage())
updateImageContents(contentsInfo);
@@ -1112,6 +1112,7 @@
LayoutSize oldSubpixelOffsetFromRenderer = m_subpixelOffsetFromRenderer;
primaryGraphicsLayerOffsetFromRenderer = computeOffsetFromRenderer(-rendererOffset.fromPrimaryGraphicsLayer(), deviceScaleFactor());
m_subpixelOffsetFromRenderer = primaryGraphicsLayerOffsetFromRenderer.m_subpixelOffset;
+ m_hasSubpixelRounding = !m_subpixelOffsetFromRenderer.isZero() || compositedBounds().size() != primaryGraphicsLayerRect.size();
if (primaryGraphicsLayerOffsetFromRenderer.m_devicePixelOffset != m_graphicsLayer->offsetFromRenderer()) {
m_graphicsLayer->setOffsetFromRenderer(primaryGraphicsLayerOffsetFromRenderer.m_devicePixelOffset);
@@ -1118,14 +1119,6 @@
positionOverflowControlsLayers();
}
- 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.
- bool hadSubpixelRounding = !m_subpixelOffsetFromRenderer.isZero() || compositedBounds().size() != primaryGraphicsLayerRect.size();
- m_graphicsLayer->setContentsOpaque(!hadSubpixelRounding && m_owningLayer.backgroundIsKnownToBeOpaqueInRect(compositedBounds()));
- }
-
// If we have a layer that clips children, position it.
LayoutRect clippingBox;
if (auto* clipLayer = clippingLayer()) {
@@ -1326,6 +1319,12 @@
updateDrawsContent(contentsInfo);
+ if (!m_isMainFrameRenderViewLayer && !m_isFrameLayerWithTiledBacking && !m_requiresBackgroundLayer) {
+ // For non-root layers, background is always painted by the primary graphics layer.
+ ASSERT(!m_backgroundLayer);
+ m_graphicsLayer->setContentsOpaque(!m_hasSubpixelRounding && m_owningLayer.backgroundIsKnownToBeOpaqueInRect(compositedBounds()));
+ }
+
m_graphicsLayer->setContentsVisible(m_owningLayer.hasVisibleContent() || hasVisibleNonCompositedDescendants());
if (m_scrollContainerLayer) {
m_scrollContainerLayer->setContentsVisible(renderer().style().visibility() == Visibility::Visible);
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (245206 => 245207)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.h 2019-05-11 20:58:52 UTC (rev 245206)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h 2019-05-11 22:05:37 UTC (rev 245207)
@@ -434,6 +434,7 @@
#endif
bool m_backgroundLayerPaintsFixedRootBackground { false };
bool m_requiresBackgroundLayer { false };
+ bool m_hasSubpixelRounding { false };
bool m_paintsSubpixelAntialiasedText { false }; // This is for logging only.
};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes