<?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>267688</bug_id>
          
          <creation_ts>2024-01-18 04:05:00 -0800</creation_ts>
          <short_desc>[popover] Light dismiss doesn&apos;t work on iOS/iPadOS</short_desc>
          <delta_ts>2025-04-18 01:35:31 -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>DOM</component>
          <version>Safari 17</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 17</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=273141</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="Russ">russ</reporter>
          <assigned_to name="Tim Nguyen (:ntim)">ntim</assigned_to>
          <cc>anon185441</cc>
    
    <cc>a_protyasha</cc>
    
    <cc>bramus</cc>
    
    <cc>bugzilla</cc>
    
    <cc>callionica</cc>
    
    <cc>cory</cc>
    
    <cc>firefoxic.dev</cc>
    
    <cc>ik</cc>
    
    <cc>imbashenk</cc>
    
    <cc>joellenkimball</cc>
    
    <cc>karlcow</cc>
    
    <cc>lwarlow</cc>
    
    <cc>maggotfish</cc>
    
    <cc>ntim</cc>
    
    <cc>rik</cc>
    
    <cc>sacolo9459</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkitbugs</cc>
    
    <cc>yivarak978</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2005820</commentid>
    <comment_count>0</comment_count>
    <who name="Russ">russ</who>
    <bug_when>2024-01-18 04:05:00 -0800</bug_when>
    <thetext>The click/touch on the backdrop of a open [popover], does not close the [popover] on Safari iOS/iPadOS. It does close the [popover] on the Safari macOS, Chrome desktop, Firefox desktop (with a polyfill), Chrome Android, Firefox Android (with a polyfill). 

The [popover] should close when clicked/touched on the backdrop [popover]::backdrop or pressing the escape key on a keyboard.

MDM Example
https://mdn.github.io/dom-examples/popover-api/blur-background/
In the above example, click/touch the ‘Show popover’ button. Now click/touch outside the [popover] on the screen background (purple stars) and this should close the [popover] (light-dismissal).

It does **not** close the [popover] in Safari 17.2 iPadOS and Safari17.2.1 iOS. It **does** close the [popover] as expected in Safari macOS 17.2.1.

In addition, using an Apple Magic Keyboard with an iPad Pro M2 11&quot;, clicking with the trackpad on the background does close the [popover]. But Command + period key (Esc) should dismiss the [popover] but does not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2007524</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-01-25 04:05:14 -0800</bug_when>
    <thetext>&lt;rdar://problem/121591037&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2020361</commentid>
    <comment_count>2</comment_count>
    <who name="Tixie">webkitbugs</who>
    <bug_when>2024-03-11 21:23:53 -0700</bug_when>
    <thetext>Hi, I have the same issue even with any backdrop. Just a popover (short for popover=&quot;auto&quot; should allow to be closed when clicked/taped outside of it. Or I can’t achieve that on my phone on iOS 17.4.

Here a very simple demo you can test on if you wanna reproduce the issue https://codepen.io/Tixie/pen/eYozYvj</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2021489</commentid>
    <comment_count>3</comment_count>
    <who name="Luke Warlow">lwarlow</who>
    <bug_when>2024-03-15 16:41:52 -0700</bug_when>
    <thetext>I&apos;m able to reproduce this issue, specific on my iPad running iPad OS 17.4, a touch outside of a popover won&apos;t close it, but clicking with a mouse (for example one moved onto the iPad via universal control from a mac) does close it.

Adding a pointerdown event listener to document.body, &quot;fixes&quot; the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2021639</commentid>
    <comment_count>4</comment_count>
    <who name="Tixie">webkitbugs</who>
    <bug_when>2024-03-17 06:18:10 -0700</bug_when>
    <thetext>Wow cursed 😆</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2056766</commentid>
    <comment_count>7</comment_count>
    <who name="Callionica">callionica</who>
    <bug_when>2024-08-31 00:51:17 -0700</bug_when>
    <thetext>This is an important bug to fix before we can use popover in our sites. If you have any influence over MDN compat data, maybe you could also encourage an update to show this issue to avoid confusion. I’m seeing this bug still on iOS 17.6.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2058477</commentid>
    <comment_count>8</comment_count>
    <who name="Rogier de Ruijter">imbashenk</who>
    <bug_when>2024-09-08 11:42:44 -0700</bug_when>
    <thetext>Would love to see a fix for this. It is such an important feature of the popover API.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2064519</commentid>
    <comment_count>9</comment_count>
    <who name="">ik</who>
    <bug_when>2024-10-01 08:23:03 -0700</bug_when>
    <thetext>Friendly ping, this bug is still reproducible in iOS 18. 

...and an Interop 2024 focus area:
https://webkit.org/blog/14955/the-web-just-gets-better-with-interop/#:~:text=on%20Windows%2010.-,The%202024%20Focus%20Areas,-Accessibility</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2067562</commentid>
    <comment_count>10</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2024-10-13 01:57:02 -0700</bug_when>
    <thetext>From Luke&apos;s comment, if anyone wants to give a stab at fixing this, I think this is the right code to touch:

https://searchfox.org/wubkat/rev/cde6cf2e21001cb4055a5f891ce3d7abe5eee3e9/Source/WebCore/dom/Element.cpp#495-496,518

Line 518 is the one that triggers the light dismiss codepath, and line 495/496 is the line that blocks this codepath from being reached when there&apos;s no relevant event listener.

EWS should show a progression if this is fixed, and the iOS baseline of the popover-light-dismiss.html test can be updated accordingly if that is the case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2067973</commentid>
    <comment_count>11</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2024-10-14 23:50:41 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/35200</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2067992</commentid>
    <comment_count>12</comment_count>
      <attachid>472935</attachid>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2024-10-15 01:37:13 -0700</bug_when>
    <thetext>Created attachment 472935
with-pointerdown-listener.html

....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071096</commentid>
    <comment_count>13</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2024-10-28 16:43:28 -0700</bug_when>
    <thetext>I debugged this a bit further, the touch events seem blocked at the UI process level, `WebPageProxy::handlePreventableTouchEvent` has `touchEventsTrackingType` set to `NotTracking` in the bad case, to `Asynchronous` in the good case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2072023</commentid>
    <comment_count>14</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-10-31 18:00:52 -0700</bug_when>
    <thetext>Committed 285990@main (818287041d80): &lt;https://commits.webkit.org/285990@main&gt;

Reviewed commits have been landed. Closing PR #35200 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2088172</commentid>
    <comment_count>15</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2025-01-17 16:31:02 -0800</bug_when>
    <thetext>For those wondering, this bug fix shipped in Safari 18.3 beta: https://developer.apple.com/documentation/safari-release-notes/safari-18_3-release-notes</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2111767</commentid>
    <comment_count>16</comment_count>
    <who name="Virginia Baltimore">joellenkimball</who>
    <bug_when>2025-04-18 01:35:31 -0700</bug_when>
    <thetext>(In reply to Tim Nguyen (:ntim) from comment #15)
&gt; For those wondering, this bug fix shipped in Safari 18.3 beta:
&gt; https://developer.apple.com/documentation/safari-release-notes/safari-18_3-release-notes https://cluster-rush.com

Thanks for sharing!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>472935</attachid>
            <date>2024-10-15 01:37:13 -0700</date>
            <delta_ts>2024-10-15 01:37:25 -0700</delta_ts>
            <desc>with-pointerdown-listener.html</desc>
            <filename>file_267688.txt</filename>
            <type>text/html</type>
            <size>149</size>
            <attacher name="Tim Nguyen (:ntim)">ntim</attacher>
            
              <data encoding="base64">PGRpdiBwb3BvdmVyIGlkPXBvcG92ZXI+DQpIaQ0KPC9kaXY+DQo8c2NyaXB0Pg0KcG9wb3Zlci5z
aG93UG9wb3ZlcigpOw0KDQphZGRFdmVudExpc3RlbmVyKCJwb2ludGVyZG93biIsICgpID0+IHsN
CiAgY29uc29sZS5sb2coImhpIikNCn0pDQo8L3NjcmlwdD4=
</data>

          </attachment>
      

    </bug>

</bugzilla>