8000 [css3-positioning] [cssom] getComputedStyle should return "auto" for position:sticky if applicable · Issue #1346 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css3-positioning] [cssom] getComputedStyle should return "auto" for position:sticky if applicable #1346

@yi-gu

Description

@yi-gu

Spec section:
https://www.w3.org/TR/css-position-3/#sticky-pos
https://drafts.csswg.org/cssom/#resolved-values

According to the spec, top/bottom/left/right on getComputedStyle are used values for backwards compatibility with sites relying on the old definition of computed style. However, position offsets have special meaning for position sticky. getComputedStyle should return "auto" for the following element:
<div style='position:sticky; top: auto;'></div>
instead of returning "0px" which is hugely misleading.

Currently, both Firefox 53, Safari 10 return "auto" in this case. Chrome 58 returns "0px" based on the spec but is about to change to "auto" soon.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0