Bug 257300 - Inconsistent rendering with position: relative and position: sticky
Summary: Inconsistent rendering with position: relative and position: sticky
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 16
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-05-24 19:19 PDT by mic.gallego
Modified: 2023-05-25 18:08 PDT (History)
5 users (show)

See Also:


Attachments
image (533.28 KB, image/jpeg)
2023-05-24 19:19 PDT, mic.gallego
no flags Details
screen recoding (5.13 MB, video/quicktime)
2023-05-25 18:07 PDT, zalan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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>