WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
203941
Element with negative z-index and fixed position drawn with wrong stacking order
https://bugs.webkit.org/show_bug.cgi?id=203941
Summary
Element with negative z-index and fixed position drawn with wrong stacking order
Jared Jacobs
Reported
2019-11-06 19:58:49 PST
Created
attachment 383016
[details]
Example showing the problem An element with a fixed position and negative z-index gets drawn behind a positioned sibling that has a higher negative z-index.
https://codepen.io/2is10/pen/BaaxLpM
Here's the relevant HTML and CSS: <section> <button class="absolute-front">1</button> <button class="fixed-behind">2</button> </section> section { /* establishes a stacking context */ position: relative; z-index: 0; } .absolute-front { position: absolute; z-index: -1; } .fixed-behind { position: fixed; z-index: -2; top: 0; } The .fixed-behind button should be drawn behind the .absolute-front button, but is instead drawn in front of it. Firefox and Chrome are correct. Known workarounds: 1. Give .absolute-front a nonnegative z-index. 2. Switch .fixed-behind from fixed to absolute positioning. 3. Click the .fixed-behind button (!). Versions of Safari known to be affected: - Technology Preview Release 95 (Safari 13.1, WebKit 14609.1.7) - Version 13.0.3 (14608.3.10.10.1) Versions of Safari known to be correct: - None
Attachments
Example showing the problem
(809 bytes, text/html)
2019-11-06 19:58 PST
,
Jared Jacobs
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2019-11-06 22:55:16 PST
<
rdar://problem/56972891
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug