Lack of interop for position:fixed when calling getComputedStyle |
||||
Issue descriptionIn the bug ( crbug.com/703816 ) we found that getComputedStyle().top returns wrong value for sticky positioned elements. According to flackr@: ----------- It's worth noting the computed style behavior is pretty inconsistent across browsers today: Computed style of top: auto (test page http://output.jsbin.com/wunoxod/quiet) : position: static relative sticky absolute fixed Chrome 58 auto 0px 0px 224px 296px Firefox 53 auto 0px auto 224px 296px Edge 14 auto auto n/a auto auto Safari 10 auto auto auto auto auto For position relative, returning a length or auto has very little difference. For every other position type though, if you were to set the returned length value it would have implications to the layout position. For fixed if you used the bottom value it would now track the viewport size, for absolute it would no longer move with layout, and with sticky it starts moving with scroll. (https://bugs.chromium.org/p/chromium/issues/detail?id=703816#c13) ----------- The sticky case is about to work correctly but fixed positioned elements still have interop issues.
,
Sep 14 2017
,
Oct 12 2017
Seems easy enough to fix. I'll take this on.
,
Oct 12 2017
nainar@, have we agreed on what value it should return? Firefox and Safari behaves differently.
,
Oct 12 2017
I think normalizing to what Safari/Edge is best. Also commented on the bug asking for Tab's opinion. Hopefully he will agree. If so I will submit the change. :) Thanks for checking in on this.
,
Oct 12 2017
Lol looks like it is a wonfix as per Tab's comment in https://github.com/w3c/csswg-drafts/issues/1346/
,
Oct 13 2017
#6 - it would be great if you made sure issues are filed for non-compliant browsers. |
||||
►
Sign in to add a comment |
||||
Comment 1 by ericwilligers@chromium.org
, May 12 2017