<?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>290024</bug_id>
          
          <creation_ts>2025-03-18 20:42:44 -0700</creation_ts>
          <short_desc>Adding max-width and max-height:100% breaks aspect-ratio</short_desc>
          <delta_ts>2025-10-23 01:54:18 -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 18</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=246303</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>ash</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>2104258</commentid>
    <comment_count>0</comment_count>
      <attachid>474623</attachid>
    <who name="">ash</who>
    <bug_when>2025-03-18 20:42:44 -0700</bug_when>
    <thetext>Created attachment 474623
minimal reproduction

While attempting to constrain an aspect-ratio div inside another relative div, I set max-width:100% and max-height:100%.

Expected: In other browsers this doesn&apos;t allow the ratio box to get larger than the container.
Actual: In Safari the aspect ratio is not preserved

Example: https://codepen.io/AshKyd/pen/jEOzbbj</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2106068</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-03-25 20:43:12 -0700</bug_when>
    <thetext>&lt;rdar://problem/147897043&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>474623</attachid>
            <date>2025-03-18 20:42:44 -0700</date>
            <delta_ts>2025-03-18 20:42:44 -0700</delta_ts>
            <desc>minimal reproduction</desc>
            <filename>index.html</filename>
            <type>text/html</type>
            <size>710</size>
            <attacher>ash</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIiA+CjxoZWFkPgogIDxtZXRhIGNoYXJzZXQ9
IlVURi04Ij4KICA8dGl0bGU+bWF4LXdpZHRoIFNhZmFyaSBidWc8L3RpdGxlPgogIDxsaW5rIHJl
bD0ic3R5bGVzaGVldCIgaHJlZj0iLi9zdHlsZS5jc3MiPgogIDxzdHlsZSB0eXBlPSJ0ZXh0L2Nz
cyI+CiAgKnsKICAgIGJveC1zaXppbmc6Ym9yZGVyLWJveDsKICB9CiAgLmNvbnRhaW5lcnsKICAg
IHdpZHRoOjUwdnc7CiAgICBoZWlnaHQ6ODB2aDsKICAgIGJvcmRlcjoxMHB4IGRhc2hlZCBibGFj
azsKICAgIHBvc2l0aW9uOnJlbGF0aXZlOwogICAgbWFyZ2luLWJvdHRvbTo0cmVtOwogIH0KCiAg
LnJhdGlvewogICAgYXNwZWN0LXJhdGlvOjEuNTsKICAgIGJvcmRlcjoxMHB4IHNvbGlkIGZ1Y2hz
aWE7CiAgICBtYXgtd2lkdGg6MTAwJTsKICAgIG1heC1oZWlnaHQ6MTAwJTsKICB9CiAgPC9zdHls
ZT4KPC9oZWFkPgo8Ym9keT4KPGgxPm1heC13aWR0aDoxMDAlO21heC1oZWlnaHQ6MTAwJSBsb3Nl
cyB0aGUgcmF0aW8gYW5kIGdldHMgdG9vIHdpZGUgd2hlbiBoZWlnaHQgPiBjb250YWluZXI8L2gx
Pgo8cD5DaGFuZ2UgdGhlIHdpZHRoIG9mIHRoZSB3aW5kb3cgdG8gc2VlIHRoaXMgYmVoYXZpb3Vy
PC9wPgo8ZGl2IGNsYXNzPSJjb250YWluZXIiPgogIDxkaXYgY2xhc3M9InJhdGlvIj48L2Rpdj4K
PC9kaXY+CiAgCjwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>