-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mix-blend-mode incorrectly blends with view base color.
https://bugs.webkit.org/show_bug.cgi?id=261708 <rdar://problem/115688282> Reviewed by Simon Fraser. Mix-blend-mode on an element that blends into the 'Root Element Group' should have only the root element's background color, or transparent if none. We're including the opaque white base color of the RenderView too, which is incorrect. This change changes BackgroundPainter so that we only draw the base color if it's ok to draw it as part of the root element background (if the root background isn't an isolated group). It also changes RenderView to make sure we do paint the base color (for iframes, particularly) if the root element won't be painting it. Removes some tests (including one WPT) that were explicitly trying to test the wrong thing (and failed on everything except WebKit). * LayoutTests/css3/blending/blend-mode-body-child-expected.html: Removed. * LayoutTests/css3/blending/blend-mode-body-child.html: Removed. * LayoutTests/css3/blending/blend-mode-body-composited-child-expected.html: Removed. * LayoutTests/css3/blending/blend-mode-body-composited-child.html: Removed. * LayoutTests/imported/w3c/web-platform-tests/css/compositing/compositing_simple_div-expected.html: Removed. * LayoutTests/imported/w3c/web-platform-tests/css/compositing/compositing_simple_div-ref.html: Removed. * LayoutTests/imported/w3c/web-platform-tests/css/compositing/compositing_simple_div.html: Removed. * LayoutTests/imported/w3c/web-platform-tests/css/compositing/mix-blend-mode/mix-blend-mode-root-element-group-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/compositing/mix-blend-mode/mix-blend-mode-root-element-group-ref.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/compositing/mix-blend-mode/mix-blend-mode-root-element-group.html: Added. * LayoutTests/svg/css/mix-blend-mode-with-inline-svg.html: * Source/WebCore/rendering/BackgroundPainter.cpp: (WebCore::BackgroundPainter::paintFillLayer): * Source/WebCore/rendering/RenderLayerInlines.h: (WebCore::RenderLayer::hasNonOpacityTransparency const): * Source/WebCore/rendering/RenderView.cpp: (WebCore::RenderView::paintBoxDecorations): (WebCore::RenderView::rootElementShouldPaintBaseBackground const): * Source/WebCore/rendering/RenderView.h: Canonical link: https://commits.webkit.org/268173@main
- Loading branch information
1 parent
fb59fe5
commit 4f26343
Showing
17 changed files
with
126 additions
and
102 deletions.
There are no files selected for viewing
5 changes: 0 additions & 5 deletions
5
LayoutTests/css3/blending/blend-mode-body-child-expected.html
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
LayoutTests/css3/blending/blend-mode-body-composited-child-expected.html
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
LayoutTests/css3/blending/blend-mode-body-composited-child.html
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...ests/imported/w3c/web-platform-tests/css/compositing/compositing_simple_div-expected.html
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
LayoutTests/imported/w3c/web-platform-tests/css/compositing/compositing_simple_div-ref.html
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
LayoutTests/imported/w3c/web-platform-tests/css/compositing/compositing_simple_div.html
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
...form-tests/css/compositing/mix-blend-mode/mix-blend-mode-root-element-group-expected.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,33 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Reftest Reference</title> | ||
<link rel="author" title="Matt Woodrow" href="mailto:mattwoodrow@apple.com"> | ||
<link rel="help" href="https://drafts.fxtf.org/compositing-1/#mix-blend-mode"> | ||
<style type="text/css"> | ||
div { | ||
width: 200px; | ||
height: 200px; | ||
} | ||
.green { | ||
background: rgba(0,160,0,0.5); | ||
mix-blend-mode: soft-light; | ||
} | ||
.blue { | ||
position: absolute; | ||
top: 75px; | ||
left: 75px; | ||
background: rgba(0,0,160,0.5) | ||
} | ||
.wrapper { | ||
isolation: isolate; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="wrapper"> | ||
<div class="blue"></div> | ||
<div class="green"></div> | ||
</div> | ||
</body> | ||
</html> |
33 changes: 33 additions & 0 deletions
33
...-platform-tests/css/compositing/mix-blend-mode/mix-blend-mode-root-element-group-ref.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,33 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Reftest Reference</title> | ||
<link rel="author" title="Matt Woodrow" href="mailto:mattwoodrow@apple.com"> | ||
<link rel="help" href="https://drafts.fxtf.org/compositing-1/#mix-blend-mode"> | ||
<style type="text/css"> | ||
div { | ||
width: 200px; | ||
height: 200px; | ||
} | ||
.green { | ||
background: rgba(0,160,0,0.5); | ||
mix-blend-mode: soft-light; | ||
} | ||
.blue { | ||
position: absolute; | ||
top: 75px; | ||
left: 75px; | ||
background: rgba(0,0,160,0.5) | ||
} | ||
.wrapper { | ||
isolation: isolate; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="wrapper"> | ||
<div class="blue"></div> | ||
<div class="green"></div> | ||
</div> | ||
</body> | ||
</html> |
30 changes: 30 additions & 0 deletions
30
.../web-platform-tests/css/compositing/mix-blend-mode/mix-blend-mode-root-element-group.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,30 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Test: mix-blend-mode in the Root Element Group should have a transparent backdrop</title> | ||
<link rel="author" title="Matt Woodrow" href="mailto:mattwoodrow@apple.com"> | ||
<link rel="help" href="https://drafts.fxtf.org/compositing-1/#mix-blend-mode"> | ||
<meta name="assert" content="Test checks that the Root Element Group has a transparent backdrop"> | ||
<link rel="match" href="mix-blend-mode-root-element-group-ref.html"> | ||
<style type="text/css"> | ||
div { | ||
width: 200px; | ||
height: 200px; | ||
} | ||
.green { | ||
background: rgba(0,160,0,0.5); | ||
mix-blend-mode: soft-light; | ||
} | ||
.blue { | ||
position: absolute; | ||
top: 75px; | ||
left: 75px; | ||
background: rgba(0,0,160,0.5) | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="blue"></div> | ||
<div class="green"></div> | ||
</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
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