-
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.
[Filters] GraphicsContext filters have to apply clipping to the targe…
…t context before drawing https://bugs.webkit.org/show_bug.cgi?id=266383 rdar://118522654 Reviewed by Simon Fraser. Before applying the filter style and calling `beginTransparencyLayer()`, the clipping rectangle of the target element has to be applied to the destination GraphicsContext. Otherwise the hidden overflow drawing will appear once the `endTransparencyLayer()` is called. RenderLayer::paintLayerContents() needs to calculate the clipping rectangle before calling setupFilters() so it can be passed to FilterStyleTargetSwitcher. beginClipAndDrawSourceImage() and endClipAndDrawSourceImage() will be called when applying CSSFilter. beginDrawSourceImage() and endDrawSourceImage() will be called when applying the top-level SVGFilter since we clip to the bounding rectangle of the root element. * LayoutTests/css3/filters/drop-shadow-filter-overflow-expected.html: Added. * LayoutTests/css3/filters/drop-shadow-filter-overflow.html: Added. * Source/WebCore/platform/graphics/filters/FilterImageTargetSwitcher.cpp: (WebCore::FilterImageTargetSwitcher::beginClipAndDrawSourceImage): * Source/WebCore/platform/graphics/filters/FilterImageTargetSwitcher.h: * Source/WebCore/platform/graphics/filters/FilterStyleTargetSwitcher.cpp: (WebCore::FilterStyleTargetSwitcher::beginClipAndDrawSourceImage): * Source/WebCore/platform/graphics/filters/FilterStyleTargetSwitcher.h: * Source/WebCore/platform/graphics/filters/FilterTargetSwitcher.h: (WebCore::FilterTargetSwitcher::beginClipAndDrawSourceImage): Deleted. (WebCore::FilterTargetSwitcher::endClipAndDrawSourceImage): Deleted. (WebCore::FilterTargetSwitcher::beginDrawSourceImage): Deleted. (WebCore::FilterTargetSwitcher::endDrawSourceImage): Deleted. * Source/WebCore/rendering/RenderLayer.cpp: (WebCore::RenderLayer::setupFilters): (WebCore::RenderLayer::applyFilters): (WebCore::RenderLayer::paintLayerContents): * Source/WebCore/rendering/RenderLayer.h: * Source/WebCore/rendering/RenderLayerFilters.cpp: (WebCore::RenderLayerFilters::beginFilterEffect): * Source/WebCore/rendering/RenderLayerFilters.h: Canonical link: https://commits.webkit.org/272078@main
- Loading branch information
Showing
11 changed files
with
97 additions
and
30 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
LayoutTests/css3/filters/drop-shadow-filter-overflow-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,24 @@ | ||
<style> | ||
.container { | ||
position: absolute; | ||
left: 10px; | ||
top: 10px; | ||
height: 200px; | ||
width: 200px; | ||
overflow: hidden; | ||
border: 1px green solid; | ||
} | ||
.box { | ||
position: absolute; | ||
left: 100px; | ||
top: 150px; | ||
width: 100px; | ||
height: 100px; | ||
background: green; | ||
} | ||
</style> | ||
<body> | ||
<div class="container"> | ||
<div class="box"></div> | ||
</div> | ||
</body> |
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 @@ | ||
<style> | ||
.container { | ||
position: absolute; | ||
left: 10px; | ||
top: 10px; | ||
height: 200px; | ||
width: 200px; | ||
overflow: hidden; | ||
border: 1px green solid; | ||
} | ||
.box { | ||
position: absolute; | ||
left: 100px; | ||
top: 150px; | ||
width: 100px; | ||
height: 100px; | ||
background: green; | ||
filter: drop-shadow(black 10px 10px 0px); | ||
} | ||
</style> | ||
<body> | ||
<div class="container"> | ||
<div class="box"></div> | ||
</div> | ||
</body> |
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
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