Bug 240324

Summary: REGRESSION(r286795): -webkit-mask-composite behaves differently with multiple masks
Product: WebKit Reporter: Caleb <aquaductape>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: bfulgham, gsnedders, jensimmons, mattwoodrow, ntim, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: iPhone / iPad   
OS: iOS 15   
Attachments:
Description Flags
div red box that uses mask image with multiple gradients none

Caleb
Reported 2022-05-11 17:30:00 PDT
Created attachment 459191 [details] div red box that uses mask image with multiple gradients Recent Safari/iOS 15.4 broke css mask image where you can have multiple gradients. In the recent Safari notes https://developer.apple.com/documentation/safari-release-notes/safari-15_4-release-notes, mask property is added as well as long forms and webkit-mask is aliased. I'm not sure which mask property is causing the regression, the mask-image or the mask-composite. The following code works in Chrome and Firefox, and used to work before Safari/iOS 15.4, the last version where it worked was Safari/iOS 15.2 ```css div { -webkit-mask-image: linear-gradient(to right, transparent 0px, rgb(0, 0, 0) 50px), linear-gradient(to left, transparent, rgb(0, 0, 0) 50px); mask-image: linear-gradient(to right, transparent 0px, rgb(0, 0, 0) 50px), linear-gradient(to left, transparent, rgb(0, 0, 0) 50px); -webkit-mask-composite: source-in; mask-composite: intersect; } ``` Here's demo example that uses mask image with multiple gradients. Code Demo: https://codepen.io/Kahlub/pen/QWQKLqe A library uses this mask image with multiple gradients feature https://github.com/aquaductape/solid-scroll-shadows, but now it's broken due to Safari/iOS 15.4
Attachments
div red box that uses mask image with multiple gradients (2.09 MB, image/png)
2022-05-11 17:30 PDT, Caleb
no flags
Caleb
Comment 1 2022-05-11 17:33:11 PDT
I forgot to mention, by broken, I mean the element where the mask image is applied to is no longer visible
Radar WebKit Bug Importer
Comment 2 2022-05-11 22:40:04 PDT
Simon Fraser (smfr)
Comment 3 2022-05-18 13:55:48 PDT
Presumably regressed at r286795.
Tim Nguyen (:ntim)
Comment 4 2022-05-22 23:59:45 PDT
There are 2 issues here (thank you Matt for giving more details): 1. -webkit-mask-composite: source-in now computes to -webkit-mask-composite: source-in, source-in instead of -webkit-mask-composite: source-in, source-over for multiple gradients since r286795 2. -webkit-mask-composite: source-in/mask-composite: intersect has different behavior on a single gradient compared to other browsers, but this pre-dates r286795 (tested on an older computer) 1. can be fixed by restoring the old behavior for -webkit-mask-composite, but the testcase wouldn’t be fixed until 2. is fixed too, since it uses both prefixed and unprefixed versions.
Tim Nguyen (:ntim)
Comment 5 2022-05-23 00:08:50 PDT
mask-composite behaves per-spec, the only possible action item here is change the prefixed version.
Brent Fulgham
Comment 6 2022-06-23 12:07:24 PDT
*** Bug 241004 has been marked as a duplicate of this bug. ***
Brent Fulgham
Comment 7 2022-06-23 12:09:37 PDT
*** This bug has been marked as a duplicate of bug 241541 ***
Note You need to log in before you can comment on or make changes to this bug.