<?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>252425</bug_id>
          
          <creation_ts>2023-02-16 13:51:07 -0800</creation_ts>
          <short_desc>Parent’s padding affects the width of a positioned image with max-height: 100%</short_desc>
          <delta_ts>2023-02-16 20:47:19 -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>Safari 16</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>251419</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Vadim Makeev">hi</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1934300</commentid>
    <comment_count>0</comment_count>
      <attachid>465032</attachid>
    <who name="Vadim Makeev">hi</who>
    <bug_when>2023-02-16 13:51:07 -0800</bug_when>
    <thetext>Created attachment 465032
max-height demo

Or maybe something else is happening, but look at the demo: the square should be fully green.

https://codepen.io/pepelsbey/pen/JjadGQv

div {
    position: relative;
    width: 256px;
    height: 256px;
    background-color: red;
    padding-top: 255px;
    box-sizing: border-box;
}

img {
    position: absolute;
    top: 0;
    left: 0;
    max-height: 100%;
    background-color: green;
}

The same demo is attached to the issue as an HTML file.

It’s not purely theoretical: my presentation engine got affected. I use the class &quot;cover&quot; to position images. Now they’re distorted only in Safari.

https://shwr.me/ — see slides with images. They should not have white padding on the sides.

It’s definitely a regression. It used to work fine for many years.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1934421</commentid>
    <comment_count>1</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2023-02-16 20:43:28 -0800</bug_when>
    <thetext>Thank you filing this bug report. It looks like https://codepen.io/pepelsbey/pen/JjadGQv has progressed at 259663@main.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1934422</commentid>
    <comment_count>2</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2023-02-16 20:43:58 -0800</bug_when>
    <thetext>let me check https://shwr.me/ too</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1934423</commentid>
    <comment_count>3</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2023-02-16 20:46:31 -0800</bug_when>
    <thetext>yup, https://shwr.me is no longer broken. Thanks again!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1934425</commentid>
    <comment_count>4</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2023-02-16 20:47:19 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 251419 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>465032</attachid>
            <date>2023-02-16 13:51:07 -0800</date>
            <delta_ts>2023-02-16 13:51:07 -0800</delta_ts>
            <desc>max-height demo</desc>
            <filename>max-height.html</filename>
            <type>text/html</type>
            <size>842</size>
            <attacher name="Vadim Makeev">hi</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KPGhlYWQ+CiAgICA8bWV0YSBjaGFyc2V0
PSJ1dGYtOCI+CiAgICA8bWV0YSBuYW1lPSJ2aWV3cG9ydCIgY29udGVudD0id2lkdGg9ZGV2aWNl
LXdpZHRoLCBpbml0aWFsLXNjYWxlPTEuMCI+CiAgICA8dGl0bGU+TWF4IEhlaWdodCBpbiBTYWZh
cmk8L3RpdGxlPgogICAgPHN0eWxlPgogICAgICAgIGRpdiB7CiAgICAgICAgICAgIHBvc2l0aW9u
OiByZWxhdGl2ZTsKICAgICAgICAgICAgd2lkdGg6IDI1NnB4OwogICAgICAgICAgICBoZWlnaHQ6
IDI1NnB4OwogICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiByZWQ7CiAgICAgICAgICAgIHBh
ZGRpbmctdG9wOiAyNTVweDsKICAgICAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDsKICAg
ICAgICB9CgogICAgICAgIGltZyB7CiAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICAg
ICAgICAgICAgdG9wOiAwOwogICAgICAgICAgICBsZWZ0OiAwOwogICAgICAgICAgICBtYXgtaGVp
Z2h0OiAxMDAlOwogICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiBncmVlbjsKICAgICAgICB9
CiAgICA8L3N0eWxlPgo8L2hlYWQ+Cjxib2R5PgogICAgPGRpdj4KICAgICAgICA8aW1nIHNyYz0i
ZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5TVWhFVWdBQUFRQUFBQUVBQVFN
QUFBQm12RG9sQUFBQUExQk1WRVZIY0V5Qyt0TFNBQUFBQVhSU1RsTUFRT2JZWmdBQUFCOUpSRUZV
ZU5ydHdRRU5BQUFBd2lEN3B6YkhOMkFBQUFBQUFBQUFBSEVISVFBQUFiaXFLT2NBQUFBQVNVVk9S
SzVDWUlJPSIgYWx0PSIiPgogICAgPC9kaXY+CjwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>