<?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>287510</bug_id>
          
          <creation_ts>2025-02-11 13:46:27 -0800</creation_ts>
          <short_desc>Hit-testing an element does not take the mask-image&apos;s bounds into account</short_desc>
          <delta_ts>2025-02-18 13:52:36 -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>UI Events</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>284227</dup_id>
          
          <bug_file_loc>https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=13493</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="Estevan Castilho">tevo+webkit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>a_protyasha</cc>
    
    <cc>karlcow</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2093933</commentid>
    <comment_count>0</comment_count>
    <who name="Estevan Castilho">tevo+webkit</who>
    <bug_when>2025-02-11 13:46:27 -0800</bug_when>
    <thetext>Consider the following:

   &lt;div style=&quot;width: 64px; height: 64px; mask-image: linear-gradient(white, white)&quot;&gt;
     &lt;div style=&quot;width: 128px; height: 128px; background: rebeccapurple&quot; onclick=&quot;alert (&apos;hi!&apos;)&quot;&gt;&lt;/div&gt;
   &lt;/div&gt;

Visually, the inner element gets clipped by the outer element&apos;s mask bounds, and renders as a 64x64 purple block, as it might be expected. Clicking anywhere within the inner element&apos;s 128x128 bounds, however, would still dispatch the click event to the child element, even within the masked-out region. Now, even though CSS-MASKING-1 doesn&apos;t seem to explicitly specify whether or not pointer events should be dispatched outside of the mask&apos;s bounding box (as it does for clips), both Blink and Gecko seem not to, which makes more sense from a user&apos;s perspective, I think.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2093947</commentid>
    <comment_count>1</comment_count>
    <who name="Estevan Castilho">tevo+webkit</who>
    <bug_when>2025-02-11 14:08:49 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/40434</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2093968</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2025-02-11 15:09:42 -0800</bug_when>
    <thetext>This behavior is not specified by CSS. There&apos;s an open issue: https://github.com/w3c/csswg-drafts/issues/11339</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2095578</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-02-18 13:47:20 -0800</bug_when>
    <thetext>&lt;rdar://problem/145087691&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2095581</commentid>
    <comment_count>4</comment_count>
    <who name="Abrar Rahman Protyasha">a_protyasha</who>
    <bug_when>2025-02-18 13:52:36 -0800</bug_when>
    <thetext>This is a dupe of bug 284227. We should await the CSS spec resolution.

*** This bug has been marked as a duplicate of bug 284227 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>