<?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>213953</bug_id>
          
          <creation_ts>2020-07-03 23:15:54 -0700</creation_ts>
          <short_desc>AX: contextmenu event fired on Mac (w/VoiceOver) but not iOS (w/VoiceOver)</short_desc>
          <delta_ts>2026-03-28 16:59:27 -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>Accessibility</component>
          <version>Safari 13</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>cookiengineer+webkit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>alexander</cc>
    
    <cc>apolostudioapps</cc>
    
    <cc>graouts</cc>
    
    <cc>jcraig</cc>
    
    <cc>megan_gardner</cc>
    
    <cc>mike</cc>
    
    <cc>torokati44</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1668751</commentid>
    <comment_count>0</comment_count>
      <attachid>403513</attachid>
    <who name="">cookiengineer+webkit</who>
    <bug_when>2020-07-03 23:15:54 -0700</bug_when>
    <thetext>Created attachment 403513
Reduced test case for contextmenu event

Safari mobile (on iOS) doesn&apos;t fire the &quot;contextmenu&quot; event on elements, and therefore doesn&apos;t allow easy integration of html custom context menus.

When using addEventListener(&apos;contextmenu&apos;) on an element, by default the magnifier is always fired (even if the element doesn&apos;t have any text content). When using &quot;-webkit-user-select: none&quot; and &quot;user-select: none&quot;, the magnifier is disabled - though the contextmenu event isn&apos;t fired anyhow.

The attachment is a reduced test case, where other browsers on other operating systems will behave like expected, and a long-press on mobile (or right click on desktop) of an element leads to the rectangle turning green. Only WebKit/Safari on iOS seems to not allow contextmenu events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1668835</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-07-04 14:08:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/65098890&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1741223</commentid>
    <comment_count>2</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2021-03-18 09:36:23 -0700</bug_when>
    <thetext>AX: contextmenu event fired on Mac (w/VoiceOver) but not iOS (w/VoiceOver)

On Mac with VO, pressing VO+Shift+M (show contextual menu) triggers the `contextmenu` JavaScript event, equivalent to a mouse-triggered right-click or Ctrl+click. I assume this is because of a Mac implementation detail, and that it&apos;s been this way since `contextmenu` was implemented in WebKit... This is expected behavior on Mac.

On iOS, there are accessibility-triggered ways to show context menus in native UI: Home Screen icons for example. VoiceOver&apos;s default gesture for this is single-finger triple-tap. It used to be long-press, as mentioned by &quot;cookiengineer&quot; (no relation). The iOS VO key press is the same as Mac: VO+Shift+M. Yet neither of these trigger in Safari or other WebKit views.

I don&apos;t think this is purely an accessibility issue. As far as I am aware, there is no mainstream UI way to trigger a `contextmenu` event in iOS WebKit. As such, we should not add an accessibility-only way to trigger this event, as it could reveal the use of assistive technology.

Perhaps this bug should be blocked on a new WebKit issue to support `contextmenu` with a mainstream gesture or keypress if appropriate. (Disclaimer: I have not fully considered the implications, so there may be unexpected downsides.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1741341</commentid>
    <comment_count>3</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2021-03-18 12:45:18 -0700</bug_when>
    <thetext>Update, contextmenu is triggered with right-click/ctrl-click when a BT mouse is connected to iPad.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1980109</commentid>
    <comment_count>4</comment_count>
    <who name="Alex">alexander</who>
    <bug_when>2023-09-26 02:09:42 -0700</bug_when>
    <thetext>&quot;contextmenu&quot; is not just about menus, but it is a convenient way to detect longpress on Android devices. Without it we have to use a combination of timeout hacks on pointerstart, pointerend, pointercancel, pointermove and whatnot. Would be great if iOS supported it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2194786</commentid>
    <comment_count>5</comment_count>
    <who name="Apolo">apolostudioapps</who>
    <bug_when>2026-03-28 16:59:27 -0700</bug_when>
    <thetext>would be nice to have it since it is the last platform to implement it</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>403513</attachid>
            <date>2020-07-03 23:15:54 -0700</date>
            <delta_ts>2020-07-03 23:15:54 -0700</delta_ts>
            <desc>Reduced test case for contextmenu event</desc>
            <filename>index.html</filename>
            <type>text/html</type>
            <size>597</size>
            <attacher>cookiengineer+webkit</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KCTxzdHlsZT4KCSN0ZXN0IHsKCQlkaXNwbGF5
OiBibG9jazsKCQl3aWR0aDogMjAwcHg7CgkJaGVpZ2h0OiAyMDBweDsKCQliYWNrZ3JvdW5kOiBy
ZWQ7CgkJCgkJLyogVGhpcyBkb2Vzbid0IGZpeCBpdCBlaXRoZXIgKi8KCQkvKgoJCS13ZWJraXQt
dXNlci1zZWxlY3Q6IG5vbmU7CgkJdXNlci1zZWxlY3Q6IG5vbmU7CgkJKi8KCQkKCX0KCSN0ZXN0
LmNvbnRleHRtZW51IHsKCQliYWNrZ3JvdW5kOiBncmVlbjsKCX0KCTwvc3R5bGU+CjwvaGVhZD4K
PGJvZHk+Cgk8ZGl2IGlkPSJ0ZXN0Ij48L2Rpdj4KCTxzY3JpcHQ+CgkJbGV0IGVsZW1lbnQgPSBk
b2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjdGVzdCcpOwoJCWlmIChlbGVtZW50ICE9PSBudWxsKSB7
CgkJCWVsZW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignY29udGV4dG1lbnUnLCAoKSA9PiB7CgoJCQkJ
ZWxlbWVudC5jbGFzc05hbWUgPSAnY29udGV4dG1lbnUnOwoKCQkJCXNldFRpbWVvdXQoKCkgPT4g
ewoJCQkJCWVsZW1lbnQuY2xhc3NOYW1lID0gJyc7CgkJCQl9LCAyMDAwKTsKCgkJCX0pOwoJCX0K
CTwvc2NyaXB0Pgo8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>