WebKit Bugzilla
Attachment 369658 Details for
Bug 197654
: Translucent gradient rendering bug due to will-change transform
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197654-20190511130048.patch (text/plain), 7.94 KB, created by
Simon Fraser (smfr)
on 2019-05-11 13:00:49 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-05-11 13:00:49 PDT
Size:
7.94 KB
patch
obsolete
>Subversion Revision: 245204 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 904589a1a1a06bb7c40f975e2a61f193795839ac..22945cb200dcae9bb0c36172d91380869590d19d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,29 @@ >+2019-05-11 Simon Fraser <simon.fraser@apple.com> >+ >+ Translucent gradient rendering bug due to will-change transform >+ https://bugs.webkit.org/show_bug.cgi?id=197654 >+ <rdar://problem/50547664> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 <simon.fraser@apple.com> > > When the scroller hosting a shared layer becomes non-scrollable, content disappears >diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp >index 152163f6dfc2fd6f91587759176bafcc9425c5bc..43d1a575ccd6c45f012b4e4ae05692b9a53c7035 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.cpp >+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp >@@ -822,7 +822,7 @@ bool RenderLayerBacking::updateConfiguration() > updateRootLayerConfiguration(); > > updateEventRegion(); >- >+ > // Requires layout. > if (contentsInfo.isDirectlyCompositedImage()) > updateImageContents(contentsInfo); >@@ -1115,20 +1115,13 @@ void RenderLayerBacking::updateGeometry() > 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); > 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()) { >@@ -1329,6 +1322,12 @@ void RenderLayerBacking::updateAfterDescendants() > > 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); >diff --git a/Source/WebCore/rendering/RenderLayerBacking.h b/Source/WebCore/rendering/RenderLayerBacking.h >index 28d5a786001c34dfc85ba88edfb041e4bc4e0def..132e5a3e606cff5be2154129b3c5e3938a0b7832 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.h >+++ b/Source/WebCore/rendering/RenderLayerBacking.h >@@ -434,6 +434,7 @@ private: > #endif > bool m_backgroundLayerPaintsFixedRootBackground { false }; > bool m_requiresBackgroundLayer { false }; >+ bool m_hasSubpixelRounding { false }; > bool m_paintsSubpixelAntialiasedText { false }; // This is for logging only. > }; > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 2c183f3dda6cb48cfedf94e54506ac27e03d6c44..94aa2d73d8e2f204b5ba163d363ae368bd84b0f7 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2019-05-11 Simon Fraser <simon.fraser@apple.com> >+ >+ Translucent gradient rendering bug due to will-change transform >+ https://bugs.webkit.org/show_bug.cgi?id=197654 >+ <rdar://problem/50547664> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * compositing/contents-opaque/background-change-to-transparent-expected.txt: Added. >+ * compositing/contents-opaque/background-change-to-transparent.html: Added. >+ > 2019-05-11 Simon Fraser <simon.fraser@apple.com> > > When the scroller hosting a shared layer becomes non-scrollable, content disappears >diff --git a/LayoutTests/compositing/contents-opaque/background-change-to-transparent-expected.txt b/LayoutTests/compositing/contents-opaque/background-change-to-transparent-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9dc4c09509630e79e9c6d4ffae193a9009af97d0 >--- /dev/null >+++ b/LayoutTests/compositing/contents-opaque/background-change-to-transparent-expected.txt >@@ -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) >+ ) >+ ) >+ ) >+ ) >+) >+ >diff --git a/LayoutTests/compositing/contents-opaque/background-change-to-transparent.html b/LayoutTests/compositing/contents-opaque/background-change-to-transparent.html >new file mode 100644 >index 0000000000000000000000000000000000000000..9b2ed207a54dace3e829d59dbbd3116d811b7932 >--- /dev/null >+++ b/LayoutTests/compositing/contents-opaque/background-change-to-transparent.html >@@ -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> >+
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 197654
: 369658