<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>189518</bug_id>
          
          <creation_ts>2018-09-11 12:59:08 -0700</creation_ts>
          <short_desc>Wrong getComputedStyle for &apos;auto&apos; value of inset properties in fixed positioned elements</short_desc>
          <delta_ts>2023-11-29 18:13:06 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Oriol Brufau">obrufau</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1458599</commentid>
    <comment_count>0</comment_count>
    <who name="Oriol Brufau">obrufau</who>
    <bug_when>2018-09-11 12:59:08 -0700</bug_when>
    <thetext>Run this code: http://jsfiddle.net/msz9Lpfe/

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

If the containing block of a fixed positioned element is derived from an ancestor element, then it should be the ancestor&apos;s padding area (*).
This means that &quot;top: auto&quot; should resolve to &quot;top: 0px&quot;, but getComputedStyle says &quot;25px&quot; instead.
Note that if you set &quot;top: 0&quot;, the element stays at the same position as with &quot;top: auto&quot;, and with &quot;top: 25px&quot; it&apos;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&apos;t define that for fixed positioning, but it&apos;s how browsers behave and is consistent with absolutely positioning, which is properly defined in the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458937</commentid>
    <comment_count>1</comment_count>
    <who name="Oriol Brufau">obrufau</who>
    <bug_when>2018-09-12 08:09:03 -0700</bug_when>
    <thetext>In fact, all values are currently affected. However, in https://bugs.webkit.org/show_bug.cgi?id=188711 I plan to fix all cases except for &apos;auto&apos; values.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1896080</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-03 14:21:59 -0700</bug_when>
    <thetext>I am able to reproduce this bug using attached JSFiddle from Comment 0 and it shows &quot;25px&quot; for Safari 15.6.1 and STP 152 while it shows &quot;0px&quot; for Chrome Canary 107 and Firefox Nightly 106. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1896106</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-09-03 17:04:35 -0700</bug_when>
    <thetext>&lt;rdar://problem/99533470&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>