Bug 208070

Summary: REGRESSION (r251385): box-shadow interferes with backdrop-filter
Product: WebKit Reporter: Julian <julian>
Component: CompositingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: akash0rajendra, darin, dino, jbedard, martiminchev, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 13   
Hardware: Mac   
OS: macOS 10.13   
Attachments:
Description Flags
backdrop-filter bug
none
Patch dino: review+

Description Julian 2020-02-21 12:08:33 PST
Created attachment 391420 [details]
backdrop-filter bug

When I use these CSS lines in Safari 13.0.5 on macOS 10.13.6 and Safari on iPadOS 13:

-webkit-backdrop-filter: saturate(180%) blur(20px);
background-color: rgba(229,229,229,.6);
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0,0,0,.2), inset 0 0 0 1px rgba(0,0,0,.05);

the backdrop-filter moves a little to the right (about 10px) and a little down (4px).
When I remove the box-shadow or the border-radius, the backdrop-filter looks normal.

I didn't have this problem in Safari 12.
Comment 1 Radar WebKit Bug Importer 2020-02-22 17:46:37 PST
<rdar://problem/59702253>
Comment 2 Simon Fraser (smfr) 2020-02-24 10:56:28 PST
<rdar://problem/59683152>
Comment 3 Simon Fraser (smfr) 2020-03-24 15:29:20 PDT
Created attachment 394424 [details]
Patch
Comment 4 Darin Adler 2020-03-24 15:36:00 PDT
Comment on attachment 394424 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=394424&action=review

> Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:2280
> +    auto backdropRectRelativeToBackdropLayer = m_backdropFiltersRect;
> +    backdropRectRelativeToBackdropLayer.setLocation({ });

How about this instead?

    auto backdropRectRelativeToBackdropLayer = FloatRect { { }, m_backdropFiltersRect.size() };
Comment 5 Simon Fraser (smfr) 2020-03-24 15:38:21 PDT
Sure.
Comment 6 Simon Fraser (smfr) 2020-03-25 09:07:41 PDT
(In reply to Simon Fraser (smfr) from comment #5)
> Sure.

Actually no, because this is a FloatRoundedRect.
Comment 7 Simon Fraser (smfr) 2020-03-25 09:52:54 PDT
https://trac.webkit.org/changeset/258985/webkit
Comment 8 Simon Fraser (smfr) 2020-04-24 09:28:55 PDT
*** Bug 163206 has been marked as a duplicate of this bug. ***
Comment 9 Simon Fraser (smfr) 2020-04-24 11:41:48 PDT
*** Bug 201234 has been marked as a duplicate of this bug. ***
Comment 10 Simon Fraser (smfr) 2020-05-04 09:36:45 PDT
*** Bug 211349 has been marked as a duplicate of this bug. ***