forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backdrop-filter forces compositing on the root element and uses extra…
… memory. https://bugs.webkit.org/show_bug.cgi?id=271340 <rdar://123831236> Reviewed by Simon Fraser. The backdrop-filter spec requires that the root element be a backdrop root, and creates a separate compositing layer, separate from the base background color of the view. However, most tests are expecting the base white color to be included in the captured backdrop. I've filed w3c/fxtf-drafts#557 to try resolve the spec/implementation mismatch. This change makes the root element only a backdrop root if it also has one of the other grouping graphics properties. Notably not included is the 'view-transition-name' property, since this is present on the root as a default UA style. It also changes RenderView::rootElementShouldPaintBaseBackground so that we don't paint the base background color as part of the root element's background, if we did end up making the root element a backdrop root. It also ensures the default value of CSSUnprefixedBackdropFilterEnabled is always false for WebKitLegacy, rather than correctly support root background rendering with backdrop filter. * LayoutTests/compositing/filters/backdrop-filter-root-element-no-backdrop-root-expected.txt: Added. * LayoutTests/compositing/filters/backdrop-filter-root-element-no-backdrop-root.html: Added. * LayoutTests/css3/filters/backdrop/backdrop-filter-does-not-size-properly-absolute-expected.txt: * LayoutTests/css3/filters/backdrop/backdrop-filter-does-not-size-properly-border-and-padding-expected.txt: * LayoutTests/css3/filters/backdrop/backdrop-filter-with-cliprect-expected.txt: * LayoutTests/css3/filters/backdrop/backdrop-filter-with-mask-expected.txt: * LayoutTests/css3/filters/backdrop/backdrop-with-visibility-hidden-changing-expected.txt: * LayoutTests/css3/filters/backdrop/backdrop-with-visibility-hidden-expected.txt: * LayoutTests/css3/filters/backdrop/resource-use-add-more-layers-expected.txt: * LayoutTests/css3/filters/backdrop/resource-use-excessive-expected.txt: * LayoutTests/css3/filters/backdrop/resource-use-ok-expected.txt: * LayoutTests/css3/filters/backdrop/resource-use-remove-some-layers-expected.txt: * LayoutTests/platform/glib/compositing/filters/backdrop-filter-root-element-no-backdrop-root-expected.txt: Added. * LayoutTests/platform/glib/css3/filters/backdrop/backdrop-filter-does-not-size-properly-absolute-expected.txt: * LayoutTests/platform/glib/css3/filters/backdrop/backdrop-filter-does-not-size-properly-border-and-padding-expected.txt: * LayoutTests/platform/glib/css3/filters/backdrop/backdrop-filter-with-cliprect-expected.txt: * LayoutTests/platform/glib/css3/filters/backdrop/backdrop-filter-with-mask-expected.txt: * LayoutTests/platform/glib/css3/filters/backdrop/backdrop-with-visibility-hidden-changing-expected.txt: * LayoutTests/platform/glib/css3/filters/backdrop/backdrop-with-visibility-hidden-expected.txt: * LayoutTests/platform/glib/css3/filters/backdrop/resource-use-add-more-layers-expected.txt: * LayoutTests/platform/glib/css3/filters/backdrop/resource-use-excessive-expected.txt: * LayoutTests/platform/glib/css3/filters/backdrop/resource-use-ok-expected.txt: * LayoutTests/platform/glib/css3/filters/backdrop/resource-use-remove-some-layers-expected.txt: * LayoutTests/platform/ios/css3/filters/backdrop/backdrop-filter-does-not-size-properly-absolute-expected.txt: * LayoutTests/platform/ios/css3/filters/backdrop/backdrop-filter-with-cliprect-expected.txt: * LayoutTests/platform/ios/css3/filters/backdrop/backdrop-filter-with-mask-expected.txt: * LayoutTests/platform/mac-wk1/TestExpectations: * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/rendering/RenderLayer.cpp: (WebCore::RenderLayer::computeCanBeBackdropRoot const): * Source/WebCore/rendering/RenderView.cpp: (WebCore::RenderView::rootElementShouldPaintBaseBackground const): Canonical link: https://commits.webkit.org/276749@main
- Loading branch information
1 parent
5aafbde
commit 7ffc7f9
Showing
36 changed files
with
801 additions
and
826 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
LayoutTests/compositing/filters/backdrop-filter-root-element-no-backdrop-root-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(GraphicsLayer | ||
(anchor 0.00 0.00) | ||
(bounds 800.00 600.00) | ||
(children 1 | ||
(GraphicsLayer | ||
(bounds 800.00 600.00) | ||
(contentsOpaque 1) | ||
(backgroundColor #008000) | ||
(children 1 | ||
(GraphicsLayer | ||
(position 8.00 13.00) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
|
25 changes: 25 additions & 0 deletions
25
LayoutTests/compositing/filters/backdrop-filter-root-element-no-backdrop-root.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!doctype HTML> | ||
<html style="background-color:green"> | ||
<head> | ||
<script type="text/javascript" charset="utf-8"> | ||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
} | ||
|
||
function doTest() | ||
{ | ||
if (window.testRunner) { | ||
document.getElementById('layers').innerText = window.internals.layerTreeAsText(document); | ||
testRunner.notifyDone(); | ||
} | ||
} | ||
|
||
window.addEventListener('load', doTest, false); | ||
</script> | ||
</head> | ||
<body> | ||
<div style="backdrop-filter: blur(20px)"></div> | ||
<pre id="layers">Layer tree appears here in DRT.</pre> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.