Bug 257300

Summary: Inconsistent rendering with position: relative and position: sticky
Product: WebKit Reporter: mic.gallego
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
image
none
screen recoding none

Description mic.gallego 2023-05-24 19:19:56 PDT
Created attachment 466491 [details]
image

Hi,

We are experiencing an odd behavior that happens only in Safari. I was unable to isolate a minimal use case, so it might be a combination of different things, sorry about that.

To reproduce the issue, 

1. Open this page: https://ana-lucia-dev-store.myshopify.com/products/automatic-gravity-fed-spice-grinder-with-adjustable-coarseness-and-led-flashlight
If Shopify asks you a password, enter diayau and navigate again to the product page.

2. In the header, click on the search icon to display the search bar. On Safari exclusively, the search bar appears below the images (left element in the capture).

3. If you change the position of the header from position: relative to position: sticky, then Safari renders it properly. However, from my understanding, both position: sticky and position: relative should create a stacking context in the same way, so this difference in behavior seems like a bug in Safari.

Let me know if anything is unclear.

Thanks.
Comment 1 Ahmad Saleem 2023-05-25 15:12:37 PDT
I am able to reproduce this bug in WebKit ToT (build - 264539@main), in 'MiniBrowser).

> Search icon does not render properly and color highlight below image.
Comment 2 zalan 2023-05-25 18:07:35 PDT
This looks to be a painting order type of bug. When the out-of-flow header is forced to be painted on top of all the things (z-index: 100000) it does show up (see attached screen recording).
Comment 3 zalan 2023-05-25 18:07:57 PDT
Created attachment 466503 [details]
screen recoding
Comment 4 Radar WebKit Bug Importer 2023-05-25 18:08:50 PDT
<rdar://problem/109862462>