W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2018

[csswg-drafts] [cssom][css-position] getComputedStyle() does not produce 'auto' for inset properties in static positioning if another value was specified

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Tue, 11 Sep 2018 21:14:37 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-359226588-1536700476-sysbot+gh@w3.org>
Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom][css-position] getComputedStyle() does not produce 'auto' for inset properties in static positioning if another value was specified ==
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:

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

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

Either CSSOM or CSS Position is wrong.




Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3099 using your GitHub account
Received on Tuesday, 11 September 2018 21:14:38 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 11 September 2018 21:14:39 UTC