Bug 189152

Summary: -webkit-background-clip: text doesn't work across element boundaries
Product: WebKit Reporter: Aaron <me>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: mic.gallego, mmaxfield, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac   
OS: All   
Attachments:
Description Flags
Here's the small HTML testcase attach none

Description Aaron 2018-08-30 06:48:44 PDT
If you code like this <h1>Discover <span>Something</span></h1> with span tag inside it then text gradient won't appear in Safari but does appear fine in Chrome and Firefox.

If you do like this <h1>Discover Something</h1> without span tag then it does work properly. I don't think Safari liked tags inside the tag. Nasty bug. It works on other browsers like Chrome and Safari.

h1 {
background: -webkit-linear-gradient(45deg, $gold 20%, #00ff95);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
Comment 1 Simon Fraser (smfr) 2018-08-31 11:35:52 PDT
Can you attach a small HTML testcase please?
Comment 2 Aaron 2018-08-31 12:35:31 PDT
Created attachment 348662 [details]
Here's the small HTML testcase attach
Comment 3 Radar WebKit Bug Importer 2018-08-31 12:45:18 PDT
<rdar://problem/43951596>
Comment 4 Aaron 2018-09-04 07:35:53 PDT
Were you able to see the preview of each browser differently? I hope my code helps. Thank you!
Comment 5 Aaron 2018-09-24 18:14:23 PDT
Do you have any questions?
Comment 6 Myles C. Maxfield 2018-09-28 16:39:36 PDT
Yes, I can reproduce the problem. Thanks for the testcase!
Comment 7 mic.gallego 2022-08-11 22:25:52 PDT
Hi,

Is there any follow-up on this ticket? I have just created a reproduction test case here: https://codepen.io/bakura10/pen/QWmVmEP

In our use case, I need the inner span to be a display inline-block to set a min-width to perform a transition (while the parent needs to stay inline to apply the background and not cut it properly).

Unfortunately, in this situation, Safari does not display the inline-block part (Chrome and Firefox have no issue).