Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-position] computed value of inset properties should not be auto in static positioning if another value was specified #3099

Closed
Loirooriol opened this issue Sep 11, 2018 · 5 comments

Comments

@Loirooriol
Copy link
Contributor

According to https://drafts.csswg.org/cssom/#resolved-value-special-case-property-like-top

If the property applies to a positioned element [...]. Otherwise the resolved value is the computed value.

An element with position: static is not positioned, so the resolved value is the computed value.

According to https://drafts.csswg.org/css-position-3/#box-offsets-trbl,

Computed value: For position: static, auto.

So I would expect this:

element.style.top = "10px";
getComputedStyle(element).top; // "auto"

However, all Firefox, Chromium and WebKit return "10px" instead.

Either CSSOM or CSS Position is wrong.

@emilio emilio added the cssom-1 Current Work label Sep 12, 2018
@emilio
Copy link
Collaborator

emilio commented Sep 12, 2018

The computed value of top in that case is 10px, I think this is not a bug. The value is not used, but I think this is invalid and both specs are right.

@emilio
Copy link
Collaborator

emilio commented Sep 12, 2018

(Please reopen if I got that wrong)

@emilio emilio closed this as completed Sep 12, 2018
@Loirooriol
Copy link
Contributor Author

Loirooriol commented Sep 12, 2018

The computed value of top in that case is 10px

This seems good to me but CSS Position says it computes to auto.

I can't reopen.

@emilio
Copy link
Collaborator

emilio commented Sep 12, 2018

Oh, right. I think this is a bug in css-position then.

@emilio emilio reopened this Sep 12, 2018
@emilio emilio added css-position-3 Current Work css-position-4 and removed cssom-1 Current Work labels Sep 12, 2018
@emilio emilio changed the title [cssom][css-position] getComputedStyle() does not produce 'auto' for inset properties in static positioning if another value was specified [css-position] computed value of inset properties should not be auto in static positioning if another value was specified Sep 12, 2018
@fantasai
Copy link
Collaborator

fantasai commented Sep 16, 2018

CSS2 says 10px, and it wins against css-position in any arguments, so just need to update the spec: https://www.w3.org/TR/CSS2/visuren.html#position-props

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants