<?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>311544</bug_id>
          
          <creation_ts>2026-04-05 19:04:54 -0700</creation_ts>
          <short_desc>[WPE][GTK] preventDefault() on pointerdown does not suppress gesture-based compatibility mouse events from touch</short_desc>
          <delta_ts>2026-04-08 23:31:07 -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>WPE WebKit</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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>klee</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2197136</commentid>
    <comment_count>0</comment_count>
    <who name="">klee</who>
    <bug_when>2026-04-05 19:04:54 -0700</bug_when>
    <thetext>On WPE (and likely GTK), calling preventDefault() on a pointerdown event does not suppress compatibility mouse events generated from touch input.
After every touch tap, mouse emulation events (pointerId=1, pointerType=mouse) are fired at the same coordinates regardless of whether pointerdown was cancelled.

Per the W3C Pointer Events spec (https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-events):
&quot;Authors can prevent the production of certain compatibility mouse events by canceling the pointerdown event.&quot;
&quot;Mouse events can only be prevented when the pointer is down. Hovering pointers (e.g. a mouse with no buttons pressed) cannot have their mouse events prevented.&quot;

- Test case:
document.documentElement.addEventListener(&quot;pointerdown&quot;, (e) =&gt; {
        e.preventDefault();
}, true);

- How to reproduce:
  1. Create a page with a pointerdown handler that calls e.preventDefault()
  2. Load it in WPE browser with touch input
  3. Tap the screen

- Expected Result:
  - pointerdown (touch) fires, app calls preventDefault()
  - No compatibility mouse events should follow

- Actual Result:
  - pointerdown (touch) fires, app calls preventDefault()
  - pointermove/pointerover with pointerId=1, pointerType=***mouse*** fires ~1ms later</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2197138</commentid>
    <comment_count>1</comment_count>
    <who name="">klee</who>
    <bug_when>2026-04-05 19:12:04 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/62097</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2198270</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-04-08 23:31:04 -0700</bug_when>
    <thetext>Committed 310827@main (45f6219e113d): &lt;https://commits.webkit.org/310827@main&gt;

Reviewed commits have been landed. Closing PR #62097 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>