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

Issue 616834 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 617512
Owner:
Last visit > 30 days ago
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug-Regression



Sign in to add a comment

getComputedStyle returning unexpected result for sticky elements

Reported by pgrevi...@gmail.com, Jun 2 2016

Issue description

Chrome Version       : 52.0.2743.0
URLs (if applicable) : https://jsfiddle.net/dz009tq3/1/
Other browsers tested: No other browsers support position:sticky sadly

What steps will reproduce the problem?
(0) Ensure experimental web platform features is enabled in chrome://flags
(1) Add position:sticky to an element, no other properties
(2) Call getComputedStyle on the element

What is the expected result?
Results from getComputedStyle should have top, left, bottom, and right set to "auto".

What happens instead?
All values are 0px.

Additional information:
A jsfiddle is available here: https://jsfiddle.net/dz009tq3/1/ that shows this issue.  Older versions of Chrome not supporting position:sticky report "auto" as expected, which makes sense.  Due to getComputedStyle not reporting "auto", position:sticky is nearly impossible to polyfill correctly.

 
Components: Platform>DevTools
Labels: Needs-Feedback
Tested the issue on Windows 7, Mac 10.11.5, Ubuntu 14.04 using 52.0.2743.0, latest canary 53.0.2757.0, stable 51.0.2704.79 with below steps:

1.Enabled 'experimental web platform features' in chrome://flags.
2.Opened URL: https://jsfiddle.net/dz009tq3/1/
3.Navigated to dev tools->console
4.Observed the result as in attached screenshot.

Please find attached screenshot and confirm if displaying '#d2: 0px, 0px' is the issue?

pgreviews@Could you please provide expected behavior screenshot for better understanding the issue to triage it further.
616834.png
133 KB View Download
Sure!  I'd expect the behaviour to display "auto", as it is the initial value of the `top` property:

https://developer.mozilla.org/en/docs/Web/CSS/top

However, this behaviour is also present in position:relative, absolute, and fixed, so I think I'm just crazy or missing something.  I was expecting all of these to return "auto" since no extra positioning properties were set in the stylesheet, but it seems the renderer resolves the positions before exposing them through getComputedStyle.

Here's a new jsfiddle to demonstrate this: https://jsfiddle.net/kzz0dzyq/1/ .  I would naively expect these to all return "auto", but I get the resolved values of each.  This example also has getBoundingClientRect, which returns 8px (the real resolved position) for all positions.

I suppose I'll have to parse the stylesheets directly, which will work but probably isn't the best solution.  Sorry for the confusion!
auto.png
12.5 KB View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Jun 4 2016

Labels: -Needs-Feedback Needs-Review
Owner: ssamanoori@chromium.org
Thank you for providing more feedback. Adding requester "ssamanoori@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Type-Bug -Needs-Review M-53 OS-Linux OS-Mac OS-Windows Type-Bug-Regression
Owner: kh...@codeaurora.org
Status: Assigned (was: Unconfirmed)
Able to reproduce the issue on Windows 7, Mac 10.11.5, Ubuntu 14.04 using 52.0.2743.0, latest stable 51.0.2704.84, canary 53.0.2763.0 as per steps in comment #2.

This is regression issue broken in M-51.

Please find below bisect info:
Last good build:51.0.2701.0
First bad build:51.0.2702.0

CHANGELOG URL:
https://chromium.googlesource.com/chromium/src/+log/41c2ecafe3e33f583e853757a2564fc1dcd5459e..5a0d86fd06f902af87107e8c5bc1564e1a1bc853

From above CL, suspecting below:
https://chromium.googlesource.com/chromium/src/+/6a2ed97b65b691947eeffbf44ff48a8af2ddff3a

khart@Could you please look into this issue if it is related to your change, else feel free to assign to an appropriate dev person.

Thanks,

Comment 5 by timloh@chromium.org, Jun 15 2016

Mergedinto: 617512
Status: Duplicate (was: Assigned)
See the duped bug, and the spec https://drafts.csswg.org/cssom/#resolved-values

Comment 6 by timloh@chromium.org, Jun 15 2016

Cc: timloh@chromium.org

Sign in to add a comment