[Webkit-unassigned] [Bug 189518] New: Wrong getComputedStyle for 'auto' value of inset properties in fixed positioned elements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 11 12:59:08 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=189518

            Bug ID: 189518
           Summary: Wrong getComputedStyle for 'auto' value of inset
                    properties in fixed positioned elements
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: obrufau at igalia.com

Run this code: http://jsfiddle.net/msz9Lpfe/

```css
#container {
  transform: scale(1);
  border: 25px solid;
  height: 100px;
}
#fixed {
  position: fixed;
}
```
```html
<div id="container">
  <div id="fixed"></div>
</div>
```
```js
fixed.append("top: ", getComputedStyle(fixed).top);
```

If the containing block of a fixed positioned element is derived from an ancestor element, then it should be the ancestor's padding area (*).
This means that "top: auto" should resolve to "top: 0px", but getComputedStyle says "25px" instead.
Note that if you set "top: 0", the element stays at the same position as with "top: auto", and with "top: 25px" it's shifted downwards.
So the element is painted at the right position, this is just a getComputedStyle problem.
Neither Firefox nor Chromium have this problem.

(*) The spec doesn't define that for fixed positioning, but it's how browsers behave and is consistent with absolutely positioning, which is properly defined in the spec.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180911/f0cca726/attachment.html>


More information about the webkit-unassigned mailing list