Issue metadata
Sign in to add a comment
|
getComputedStyle returning unexpected result for sticky elements
Reported by
pgrevi...@gmail.com,
Jun 2 2016
|
||||||||||||||||||||||||
Issue descriptionChrome 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.
,
Jun 3 2016
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!
,
Jun 4 2016
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
,
Jun 9 2016
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,
,
Jun 15 2016
See the duped bug, and the spec https://drafts.csswg.org/cssom/#resolved-values
,
Jun 15 2016
|
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by ssamanoori@chromium.org
, Jun 3 2016Labels: Needs-Feedback
133 KB
133 KB View Download