<?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>238088</bug_id>
          
          <creation_ts>2022-03-18 12:04:30 -0700</creation_ts>
          <short_desc>REGRESSION (Safari 15.4): &lt;button&gt; loses background color with certain styles applied</short_desc>
          <delta_ts>2022-05-20 01:31:21 -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>Forms</component>
          <version>Safari 15</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 12</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <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="Jordan Pittman">jordan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>akeerthi</cc>
    
    <cc>cdumez</cc>
    
    <cc>graouts</cc>
    
    <cc>gregsimon</cc>
    
    <cc>jamauro</cc>
    
    <cc>koivisto</cc>
    
    <cc>lets.email.rob</cc>
    
    <cc>rik</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>tomlongmate</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1852794</commentid>
    <comment_count>0</comment_count>
      <attachid>455123</attachid>
    <who name="Jordan Pittman">jordan</who>
    <bug_when>2022-03-18 12:04:30 -0700</bug_when>
    <thetext>Created attachment 455123
An HTML file that reproduces the bug

In Safari 15.4 on macOS and iOS 15.4 and all the way up to the latest webkit build archive (from an hour-ish ago) a `&lt;button&gt;` element will lose it&apos;s background under the following condition:

1. It has an opacity less than 1.0
2. It has a transparent border color (or something that resolves to transparent like rgb(0 0 0 / 0).
3. It has a flex, inline-flex, grid, or inline-grid display value.
4. It has a non-zero border radius.

This does *not* happen for `&lt;div&gt;` elements — just `&lt;button&gt;` as far as I can tell.

I tested this in Safari 15.3 on macOS and the styling works as expected. I&apos;ve attached an HTML file that reproduces this bug.

My guess is it&apos;s caused by a commit somewhere between the tags Safari-612.4.9.1.8 and Safari-613.1.17.1.8 (I&apos;m going off the tags on GitHub for that one)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1852893</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-03-18 17:07:58 -0700</bug_when>
    <thetext>&lt;rdar://problem/90511187&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1853172</commentid>
    <comment_count>2</comment_count>
    <who name="Jordan Pittman">jordan</who>
    <bug_when>2022-03-21 06:34:45 -0700</bug_when>
    <thetext>Some more data points:

1. All four of the points outlined in the original report *must* be met to reproduce this bug. If you remove the rules for any one of them the background color shows up.
2. This appears to be a rendering issue because

- Selecting the text in the button draws the background behind the bounding box of the selected text
- If you select the text, click the button, and then deselect the text the background behind the whole button is left drawn but the background is empty around the bounding box of the previously selected portion of the text

3. Adding a width with a small fixed value that causes the text to wrap will then cause the background to show up again.

4. Adding width: some_percentage (e.g. width: 100%) causes the background to draw in the additional, non-intrinsic-sized portion of the bounding box + some amount. It appears to be taking into account the margin of the viewport body element and adding this to the bounding box where the background is invisible. There&apos;s also rather weird interaction when adding a large amount of padding. There still extra spacing on top of all this and I&apos;m not entirely sure where it comes from.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1854054</commentid>
    <comment_count>3</comment_count>
    <who name="">jamauro</who>
    <bug_when>2022-03-22 22:25:02 -0700</bug_when>
    <thetext>Just ran into this. Thanks for posting. I thought I was losing my mind. :)

Hope a patch can be released soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1861539</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2022-04-14 09:40:52 -0700</bug_when>
    <thetext>This is a bug in an underlying graphics framework, and will be tracked internally.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1866358</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2022-05-03 20:05:35 -0700</bug_when>
    <thetext>*** Bug 240045 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1870654</commentid>
    <comment_count>6</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-05-20 01:31:21 -0700</bug_when>
    <thetext>I believe this should be fixed in macOS 12.5 Seed 1 that was released this week.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>455123</attachid>
            <date>2022-03-18 12:04:30 -0700</date>
            <delta_ts>2022-03-18 12:04:30 -0700</delta_ts>
            <desc>An HTML file that reproduces the bug</desc>
            <filename>button-background-bug.html</filename>
            <type>text/html</type>
            <size>267</size>
            <attacher name="Jordan Pittman">jordan</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxodG1sPgo8Ym9keT4KICA8YnV0dG9uCiAgICBzdHlsZT0iCiAgICAg
IGJhY2tncm91bmQtY29sb3I6IHJlZDsKICAgICAgYm9yZGVyLXJhZGl1czogMC4zNzVyZW07CiAg
ICAgIG9wYWNpdHk6IDAuOTsKICAgICAgZGlzcGxheTogZmxleDsKICAgICAgYm9yZGVyLWNvbG9y
OiB0cmFuc3BhcmVudDsKICAgICIKICA+CiAgICBUaGlzIGhhcyBubyBiYWNrZ3JvdW5kIGNvbG9y
IGJ1dCBzaG91bGQKICA8L2J1dHRvbj4KPC9ib2R5Pgo8L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>