WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
96296
Elements with position fixed act like position absolute when parent has a perspective
https://bugs.webkit.org/show_bug.cgi?id=96296
Summary
Elements with position fixed act like position absolute when parent has a per...
Gabriel Bull
Reported
2012-09-10 11:27:09 PDT
I have an element with "position: fixed;" inside another element with "-webkit-perspective: 800;". The element is not acting accordingly to the position fixed. For instance, the css "top" attribute to 0 will place the element to 0 in relation to the parent with the perspective. And the width attribute to 100% will be 100% of the width of the parent element instead of the viewframe.
Attachments
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2012-09-10 16:36:08 PDT
<
rdar://problem/12239192
>
Martin Robinson
Comment 2
2021-10-15 07:56:50 PDT
I *believe* this is expected behavior. For instance see
https://developer.mozilla.org/en-US/docs/Web/CSS/position
which describes `position: fixed`: "The element is removed from the normal document flow, and no space is created for the element in the page layout. It is positioned relative to the initial containing block established by the viewport, except when one of its ancestors has a transform, perspective, or filter property set to something other than none (see the CSS Transforms Spec), in which case that ancestor behaves as the containing block. (Note that there are browser inconsistencies with perspective and filter contributing to containing block formation.) Its final position is determined by the values of top, right, bottom, and left." This was finally specified in 2017:
https://github.com/w3c/csswg-drafts/issues/913
You didn't provide a test case, so it's unclear if you also have a transform property on any of the parents. In any case, I think whether or not perspective without a transform also establishes a "containing block for all descendants" is under-specifieid. In any case, I think this issue can be closed.
Simon Fraser (smfr)
Comment 3
2021-10-15 12:28:28 PDT
https://www.w3.org/TR/css-transforms-2/#perspective-property
"The use of this property with any value other than none establishes a stacking context. It also establishes a containing block for all descendants, just like the transform property does."
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