<?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>244386</bug_id>
          
          <creation_ts>2022-08-26 02:12:02 -0700</creation_ts>
          <short_desc>aspect-ratio should work on errored images that have display:block</short_desc>
          <delta_ts>2022-10-31 10:54:32 -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>WebKit Nightly Build</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=245136</see_also>
          <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="Jake Archibald">jaffathecake</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>cathiechen</cc>
    
    <cc>changseok</cc>
    
    <cc>david</cc>
    
    <cc>esprehn+autocc</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>glenn</cc>
    
    <cc>karlcow</cc>
    
    <cc>kondapallykalyan</cc>
    
    <cc>pdr</cc>
    
    <cc>sabouhallawa</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>1893941</commentid>
    <comment_count>0</comment_count>
    <who name="Jake Archibald">jaffathecake</who>
    <bug_when>2022-08-26 02:12:02 -0700</bug_when>
    <thetext>https://github.com/web-platform-tests/wpt/pull/35612 - Safari fails this test, as it seems to force failed images to have a 1:1 aspect ratio.

However, there&apos;s a test that suggests failed images should ignore aspect-ratio http://wpt.live/css/css-sizing/aspect-ratio/replaced-element-028.html, but I haven&apos;t found the spec-text for this. All browsers pass this test, but Chrome &amp; Firefox respect aspect-ratio if the image is display:block or display:inline-block.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894368</commentid>
    <comment_count>1</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-08-28 19:21:17 -0700</bug_when>
    <thetext>I wonder if it relates to https://drafts.csswg.org/css-sizing-4/#aspect-ratio-automatic</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894369</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-08-28 19:21:29 -0700</bug_when>
    <thetext>&lt;rdar://problem/99258406&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894811</commentid>
    <comment_count>3</comment_count>
    <who name="cathiechen">cathiechen</who>
    <bug_when>2022-08-30 08:12:59 -0700</bug_when>
    <thetext>I checked the test in https://github.com/web-platform-tests/wpt/pull/35612 locally, it seems the cases are passed in Release 152 (Safari 16.0, WebKit 17615.1.2.3).

It seems the wpt pipeline fails to install Safari Technology Preview.
https://dev.azure.com/web-platform-tests/wpt/_build/results?buildId=86190&amp;view=logs&amp;jobId=bf8f5026-3d1f-5955-26be-17f9e1ef0bb3

Maybe it&apos;s an environmental issue, not specific to the test case?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894933</commentid>
    <comment_count>4</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-08-30 14:52:30 -0700</bug_when>
    <thetext>Loading locally the test http://wpt.live/css/css-sizing/aspect-ratio/replaced-element-028.html

shows that Safari displays the image with a 1:1 aspect ratio by default and I think this is what Jake is pointing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1895190</commentid>
    <comment_count>5</comment_count>
    <who name="cathiechen">cathiechen</who>
    <bug_when>2022-08-31 09:58:01 -0700</bug_when>
    <thetext>(In reply to Karl Dubost from comment #4)
&gt; Loading locally the test
&gt; http://wpt.live/css/css-sizing/aspect-ratio/replaced-element-028.html
&gt; 
&gt; shows that Safari displays the image with a 1:1 aspect ratio by default and
&gt; I think this is what Jake is pointing.

I see... Yes, 1:1 aspect ratio seems not very reasonable.
I think I can take a look:)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1895436</commentid>
    <comment_count>6</comment_count>
    <who name="Jake Archibald">jaffathecake</who>
    <bug_when>2022-09-01 01:25:38 -0700</bug_when>
    <thetext>Safari is passing http://wpt.live/css/css-sizing/aspect-ratio/replaced-element-028.html (as is Chrome and Firefox, although they pass it in a different way). I&apos;m not actually sure what the correct behaviour should be for that test, other than it should ignore the aspect-ratio given by the developer.

However, I think the test in https://github.com/web-platform-tests/wpt/pull/35612 is a more obvious fail. Are you sure it&apos;s passing for you? It&apos;s failing when I try it in Release 152.

Another version: https://jsbin.com/zipolaj/2/edit?html,css,output.

In Chrome and Firefox, the image uses the aspect ratio provided by the CSS - 2:1. In Safari it uses 1:1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1895475</commentid>
    <comment_count>7</comment_count>
    <who name="cathiechen">cathiechen</who>
    <bug_when>2022-09-01 07:34:53 -0700</bug_when>
    <thetext>(In reply to Jake Archibald from comment #6)
&gt; Safari is passing
&gt; http://wpt.live/css/css-sizing/aspect-ratio/replaced-element-028.html (as is
&gt; Chrome and Firefox, although they pass it in a different way). I&apos;m not
&gt; actually sure what the correct behaviour should be for that test, other than
&gt; it should ignore the aspect-ratio given by the developer.

Yeah, do we need to file a bug in GitHub to discuss the expected behavior?
It seems Chrome and Firefox do not apply aspect-ratio if the error images are with alt.
https://jsbin.com/yanocayapi/1/edit?html,css,output

&gt; 
&gt; However, I think the test in
&gt; https://github.com/web-platform-tests/wpt/pull/35612 is a more obvious fail.
&gt; Are you sure it&apos;s passing for you? It&apos;s failing when I try it in Release 152.
&gt; 

It passes if I download the test and load it with file:///

&gt; Another version: https://jsbin.com/zipolaj/2/edit?html,css,output.
&gt; 
&gt; In Chrome and Firefox, the image uses the aspect ratio provided by the CSS -
&gt; 2:1. In Safari it uses 1:1.

Yeah, it&apos;s 1:1. Again, if I download the test and load it with file:///, it&apos;s 2:1. Something might go wrong if trying to download the error image from network.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1895480</commentid>
    <comment_count>8</comment_count>
    <who name="Jake Archibald">jaffathecake</who>
    <bug_when>2022-09-01 08:09:24 -0700</bug_when>
    <thetext>Ohhh, that&apos;s fun! I bet it avoids going into an errored state as it leaks details about the file system.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1896859</commentid>
    <comment_count>9</comment_count>
      <attachid>462186</attachid>
    <who name="cathiechen">cathiechen</who>
    <bug_when>2022-09-07 12:15:18 -0700</bug_when>
    <thetext>Created attachment 462186
WIP-patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898207</commentid>
    <comment_count>10</comment_count>
    <who name="cathiechen">cathiechen</who>
    <bug_when>2022-09-13 06:18:04 -0700</bug_when>
    <thetext>Filed a new bug for the file:// and http:// issue:) https://bugs.webkit.org/show_bug.cgi?id=245136

I think the cases in replaced-element-028.html and replaced-element-036.html are correct. Explained a little in GitHub. https://github.com/web-platform-tests/wpt/pull/35612#issuecomment-1245268327</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>462186</attachid>
            <date>2022-09-07 12:15:18 -0700</date>
            <delta_ts>2022-09-07 13:42:05 -0700</delta_ts>
            <desc>WIP-patch</desc>
            <filename>aspect-ratio-vs-error-img-wip-patch.diff</filename>
            <type>text/plain</type>
            <size>1894</size>
            <attacher name="cathiechen">cathiechen</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL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XNwZWN0UmF0aW8oKTsKLSAgICAgICAgZWxzZQorICAgIGlmIChpc0ltYWdlKCkg
JiYgaXNTaG93aW5nTWlzc2luZ09ySW1hZ2VFcnJvcigpKSB7CisgICAgICAgIGlmICghbV9hbHRU
ZXh0LmlzRW1wdHkoKSkgeworICAgICAgICAgICAgaW50cmluc2ljUmF0aW8gPSAwOworICAgICAg
ICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmICghc3R5bGUoKS5oYXNBc3BlY3RS
YXRpbygpKQogICAgICAgICAgICAgaW50cmluc2ljUmF0aW8gPSAxOwotICAgICAgICByZXR1cm47
CiAgICAgfQogfQogCg==
</data>
<flag name="commit-queue"
          id="490888"
          type_id="3"
          status="-"
          setter="ews-feeder"
    />
          </attachment>
      

    </bug>

</bugzilla>