New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 624667 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

position:fixed content is not offset by relative positioned ancestors

Project Member Reported by pdr@chromium.org, Jun 30 2016

Issue description

Version: 53.0.2783.2/dev
OS: OSX 10.11.7b

What steps will reproduce the problem?
(1) Open the attached testcase, or visit: http://jsbin.com/qehakit
(2) Notice the dark green box is not inside the light green box.

The spec seems pretty clear so I think this is a bug. Both Firefox and Safari position this correctly. Interestingly, we only get the y offset wrong and the x offset is correct.

What is the expected output?
A dark green box inside a light green box.

What do you see instead?
A dark green box outside a light green box.
 
fixed.html
316 bytes View Download
Adding a "contain:paint" would fix this problem.

Comment 2 by xing...@intel.com, Oct 18 2016

Hi, I am interested with this issue, but I got confused by the fixed position spec.

From the spec, https://www.w3.org/TR/CSS21/visuren.html#fixed-positioning, 
"The only difference is that for a fixed positioned box, the containing block is established by the viewport. ". Now that the fixed is positioned in the viewport, and its left/top is default, the fixed element should positioned at the left top of the viewport, overlay with "The dark". 

But when run this in firefox, the fixed element seems positioned to the relative element.

Am I missing something in spec?

Comment 3 by chrishtr@google.com, Nov 20 2016

Components: -Blink>Paint Blink>Layout
Status: Untriaged (was: Available)
Elements which have position:absolute but do not specify top, bottom, left
or right are positioned as if they have position:static:

https://www.w3.org/TR/CSS2/visudet.html#abs-non-replaced-width
http://www.w3.org/TR/CSS2/visudet.html#abs-non-replaced-height

position:fixed elements appear to be spec'ed as if they are just like position:absolute, except for the adjustment for viewport:

https://www.w3.org/TR/CSS2/visuren.html#fixed-positioning

This appears to be a Layout bug.

Comment 4 by e...@chromium.org, Nov 21 2016

Cc: cbiesin...@chromium.org atotic@chromium.org ka...@opera.com
Status: Available (was: Untriaged)
Guys, if you don't mind I would like to have a look. It is an interesting issue to investigate.

Comment 6 by ka...@opera.com, Dec 5 2016

Fine with me, I'm busy elsewhere at the moment.
Status: Assigned (was: Available)
Owner: a.obzhirov@samsung.com
https://codereview.chromium.org/2577893004
Project Member

Comment 9 by bugdroid1@chromium.org, Dec 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f91316113420b5f208dadb3a47f626a24a455fd7

commit f91316113420b5f208dadb3a47f626a24a455fd7
Author: a.obzhirov <a.obzhirov@samsung.com>
Date: Wed Dec 21 16:37:04 2016

position:fixed content is not offset by relative positioned ancestors

For positioned objects take into account the relative positioned ancestors' offset
when computing logical top (similar to logical left computing).

BUG= 624667 

Review-Url: https://codereview.chromium.org/2577893004
Cr-Commit-Position: refs/heads/master@{#440125}

[add] https://crrev.com/f91316113420b5f208dadb3a47f626a24a455fd7/third_party/WebKit/LayoutTests/fast/block/positioning/fixed-position-with-relative-parent-expected.html
[add] https://crrev.com/f91316113420b5f208dadb3a47f626a24a455fd7/third_party/WebKit/LayoutTests/fast/block/positioning/fixed-position-with-relative-parent.html
[modify] https://crrev.com/f91316113420b5f208dadb3a47f626a24a455fd7/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/fixpos-dialog-layout-expected.txt
[modify] https://crrev.com/f91316113420b5f208dadb3a47f626a24a455fd7/third_party/WebKit/LayoutTests/paint/invalidation/fixed-margin-change-repaint-expected.txt
[modify] https://crrev.com/f91316113420b5f208dadb3a47f626a24a455fd7/third_party/WebKit/LayoutTests/platform/android/paint/invalidation/fixed-margin-change-repaint-expected.txt
[modify] https://crrev.com/f91316113420b5f208dadb3a47f626a24a455fd7/third_party/WebKit/Source/core/layout/LayoutBox.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment