-
Notifications
You must be signed in to change notification settings - Fork 715
[css-positioning] position: fixed within a stacking context #400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This behavior is speced in CSS Transforms spec that:
|
Thanks for the pointer @upsuper. There are several css properties that create a new stacking context, between them
I'm not sure if these are bugs or by design, and couldn't easily find the spec that defines the desired behavior. Any pointer would be greatly appreciated :) Would it be possible to at least mention that |
This is a bug of Safari. Those properties only create a stacking context, and do not act as a containing block for fixed positioned descendants.
Looks like the spec isn't clear that Safari's behavior here looks buggy either way, though.
Specifying You can find the spec of behavior of |
I've been playing with |
That is a bug of Chrome then, as |
When you checked |
My tests were done with Aside: I'm working on an overlay custom element; it should be capable of rendering on top of the other content when opened (like |
No, there is no such magic thing in CSS. Some DOM APIs use a concept of top layer for putting things on the very top, which is not available in CSS, though. |
It would be pure gold to have access to the top layer stack (e.g. add/remove nodes via DOM APIs would be more than enough) 😄 Is there any WIP around it, or an issue where to follow updates? |
No, and I don't think we want that actually. Top layer is a rather hacky thing initially created for fullscreen. |
A position that is relative to viewport is necessary. Another proposal: |
As far as I can tell, nothing here is an error in the Position spec, it's just a pile of browser bugs wrt what properties create fixed positioning containing blocks, and how to respond to that. So just marking as Needs Testcase to make sure these cases are exercised in WPT. |
Cropping of position:fixed inside stacking-context with overflow:hidden or scroll is a WebKit bug. |
The spec of
position: fixed
specifies that:https://www.w3.org/TR/css-position-3/#fixed-pos
https://www.w3.org/TR/css-position-3/#containing-block
But it is not obvious what happens if a
position:fixed
element is contained in a parent that creates a stacking context. What happens is that the fixed element participates to the scroll and gets clipped http://jsbin.com/kehexi/3/edit?html,outputResulting in

Is this an expected behavior for
position: fixed
? From the spec, I'd expect it to render in the top stacking context and not participate to the scrolling (e.g. comment thetransform: translateZ(0)
of.container
)The text was updated successfully, but these errors were encountered: