Bug 158202 - Clipped element does not have a reflection if backdrop-filter is applied
Summary: Clipped element does not have a reflection if backdrop-filter is applied
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2016-05-30 07:02 PDT by Antoine Quint
Modified: 2016-12-08 18:16 PST (History)
3 users (show)

See Also:

Testcase (884 bytes, text/html)
2016-05-30 07:02 PDT, Antoine Quint
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2016-05-30 07:02:57 PDT
Created attachment 280097 [details]

If an element that has a backdrop-filter as well as a clip-path applied to it has a reflection, the reflection does not appear.
Comment 1 Radar WebKit Bug Importer 2016-05-30 07:04:17 PDT
Comment 2 Radar WebKit Bug Importer 2016-05-30 07:06:17 PDT
Comment 3 Antoine Quint 2016-06-03 09:22:22 PDT
I have it working but for some reason the background color is missing in the reflection until I resize a window, which I assume is because that causes a layout.
Comment 4 Antoine Quint 2016-06-06 16:32:33 PDT
This is a lot trickier than I thought at first. To get this to work, we need to do this:

- in PlatformCALayerCocoa::clone(), also call setShapePath() when we're dealing with a LayerTypeShapeLayer
- in GraphicsLayerCA::fetchCloneLayers(), clone the mask layer in case we have both a backdrop and a mask and set the cloned mask to the cloned backdrop

But this doesn't fully fix the issue, because the way we clone the mask in GraphicsLayerCA::updateLayerMask() isn't quite correct. Ideally, we would clone the mask's PlatformCALayer independently in GraphicsLayerCA::updateLayerMask() and GraphicsLayerCA::fetchCloneLayers(), but this is made difficult due to the mask layer being touched from RenderLayerBacking and due to not having a way to get to the backdrop clone from GraphicsLayerCA since this is all internal to PlatformCALayer.