<?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>212372</bug_id>
          
          <creation_ts>2020-05-26 06:18:29 -0700</creation_ts>
          <short_desc>Element.offsetParent of fixed position element under transformed element should not be null</short_desc>
          <delta_ts>2025-09-19 17:22:01 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>Safari 13</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=161788</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>289743</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Federico Zivolo">federico.zivolo</reporter>
          <assigned_to name="fantasai">fantasai.bugs</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>annevk</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>browserbugs2</cc>
    
    <cc>davide.cavarretta</cc>
    
    <cc>fantasai.bugs</cc>
    
    <cc>mrobinson</cc>
    
    <cc>rniwa</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>1656012</commentid>
    <comment_count>0</comment_count>
    <who name="Federico Zivolo">federico.zivolo</who>
    <bug_when>2020-05-26 06:18:29 -0700</bug_when>
    <thetext>Reported by federico.zivolo@gmail.com in https://bugs.chromium.org/p/chromium/issues/detail?id=20574#c67.

For the following test case:

&lt;!DOCTYPE html&gt;
&lt;div id=&quot;transformed&quot; style=&quot;transform: translateX(2px); height: 50px;&quot;&gt;
  &lt;div id=&quot;fixed&quot; style=&quot;position: fixed&quot;&gt;FIXED&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;output&quot; style=&quot;height: 3000px&quot;&gt;&lt;/div&gt;
&lt;script&gt;
output.textContent = fixed.offsetParent ? fixed.offsetParent.id : &quot;null&quot;;
&lt;/script&gt;

Chrome: null
Firefox: transformed

Firefox&apos;s behavior is more reasonable because &quot;transformed&quot; is the container of &quot;fixed&quot;.

This issue is somewhat related to https://bugs.webkit.org/show_bug.cgi?id=37839</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657104</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-05-28 17:33:12 -0700</bug_when>
    <thetext>&lt;rdar://problem/63739636&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1846631</commentid>
    <comment_count>2</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2022-02-28 07:21:49 -0800</bug_when>
    <thetext>&quot;
The offsetParent attribute must return the result of running these steps:

    If any of the following holds true return null and terminate this algorithm:

        (...)
       
        The element’s computed value of the position property is fixed.
&quot;

https://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetparent</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1846828</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2022-02-28 15:55:11 -0800</bug_when>
    <thetext>(In reply to Gérard Talbot from comment #2)
&gt; &quot;
&gt; The offsetParent attribute must return the result of running these steps:
&gt; 
&gt;     If any of the following holds true return null and terminate this
&gt; algorithm:
&gt; 
&gt;         (...)
&gt;        
&gt;         The element’s computed value of the position property is fixed.
&gt; &quot;
&gt; 
&gt; https://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetparent

But that probably hasn&apos;t been updated since we made certain CSS properties trigger containing block for fixed position (like transforms and filters).

The real question here is whether the &apos;offsetParent&apos; algorithm should follow containing blocks.

Related: bug 161788</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887029</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-27 03:51:24 -0700</bug_when>
    <thetext>I am still able to reproduce this in Safari 15.6 on macOS 12.5 using test case from Comment 0 changed into below JSFiddle:

Link - https://jsfiddle.net/ewhjmx3a/show

In case of Safari 15.6 and Chrome Canary 106, the output is &quot;FIXED&quot; &amp; &quot;null&quot; on test case while for Firefox Nightly 104, it is &quot;FIXED&quot; &amp; &quot;transformed&quot; aligned with Comment 0.

I am not clear on web-spec but I think it should be something which needs to be clarified and all browsers should be on consensus. Just wanted to share updated results. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2143479</commentid>
    <comment_count>5</comment_count>
    <who name="fantasai">fantasai.bugs</who>
    <bug_when>2025-09-16 17:19:49 -0700</bug_when>
    <thetext>This has been clarified in the spec at https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetparent</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2143482</commentid>
    <comment_count>6</comment_count>
    <who name="fantasai">fantasai.bugs</who>
    <bug_when>2025-09-16 17:35:37 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/50834</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2143689</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-09-17 12:03:45 -0700</bug_when>
    <thetext>Committed 300097@main (6cd7aec93667): &lt;https://commits.webkit.org/300097@main&gt;

Reviewed commits have been landed. Closing PR #50834 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2144561</commentid>
    <comment_count>8</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-09-19 17:22:01 -0700</bug_when>
    <thetext>Committed 297297.443@safari-7622-branch (ec961398d781): &lt;https://commits.webkit.org/297297.443@safari-7622-branch&gt;

Reviewed commits have been landed. Closing PR #3673 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>