Bug 224374 - Z-index not respected when using transform: translate
Summary: Z-index not respected when using transform: translate
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Compositing (show other bugs)
Version: Safari 14
Hardware: Mac (Intel) macOS 11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-09 09:06 PDT by Mark Fisher
Modified: 2021-04-16 09:07 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Fisher 2021-04-09 09:06:20 PDT
See this codepen: https://codepen.io/markfisher/pen/WNRdNZp

I have a table with sticky column headers and sticky row headers. The row headers use native "position: sticky". Since the table is in a container element with scroll overflow, I need to translate the thead element in a scroll handler as an alternative to native sticky.
 
In Chrome and Firefox (and I believe every browser other than Safari) the row headers correctly appear underneath the row headers, since the thead element has a higher z index than the row headers. However, in Safari, the row headers go above the column headers. I found this issue mentioned on Stackoverflow (though funnily enough I can't find any bug report quite matching this issue) and a workaround was suggested of using translateZ instead of z-index to achieve the desired effect. However, this workaround does not work when the table is in a container with scroll overflow, as in my codepen.

I presume this is a bug. Is there any workaround?
Comment 1 Radar WebKit Bug Importer 2021-04-16 09:07:18 PDT
<rdar://problem/76763050>