<?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>321268</bug_id>
          
          <creation_ts>2026-08-07 03:15:21 -0700</creation_ts>
          <short_desc>height: fit-content is broken when position: fixed is used</short_desc>
          <delta_ts>2026-08-07 18:06:12 -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>Layout and Rendering</component>
          <version>Safari 26</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>289876</dup_id>
          
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alex">alexander</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <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>2238257</commentid>
    <comment_count>0</comment_count>
    <who name="Alex">alexander</who>
    <bug_when>2026-08-07 03:15:21 -0700</bug_when>
    <thetext>Create this layout:

&lt;section&gt;
  I am some real content
  &lt;div&gt;&lt;/div&gt;
&lt;/section&gt;

Apply these styles:

section {
  height: fit-content;
}

div {
  height: 100%;
}

Everything works as expected.

Now add &quot;position: fixed&quot; to section and its height becomes double the size because DIV adds another 100% of the height.

Works properly in all other browsers, but Safari, see this Codepen:
https://codepen.io/waterplea/pen/KwaEgJE</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2238516</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-08-07 17:23:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/184375810&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2238518</commentid>
    <comment_count>2</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2026-08-07 17:30:57 -0700</bug_when>
    <thetext>Thank you for filing this bug report. I think it has already progressed on trunk. Let me find the progression point.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2238524</commentid>
    <comment_count>3</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2026-08-07 18:06:12 -0700</bug_when>
    <thetext>Progressed at https://commits.webkit.org/311084@main.

*** This bug has been marked as a duplicate of bug 289876 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>