Click just to the right of a half-visible SVG eye icon. The browser can still target the eye’s path, even though there’s nothing visible at that point. Swap the alpha mask for a clipPath, click the same spot again, and the button behind the SVG gets the click.
That difference is easy to miss when reviewing an icon from a screenshot. Here’s a small test that makes it visible.
Same path, same points
Both panels use the same filled SVG path in a 160 × 120 viewBox. Each effect reveals only the left half. A button sits beneath each SVG so there’s a second target when the path misses. The dashed outline and point markers are on a separate overlay with pointer-events: none.
- A (22, 60) sits on the visible half of the eye.
- B (138, 60) sits on the hidden half of the original path.
- C (138, 96) sits outside the original path, inside the button underneath.
In the Chromium-based Qt WebEngine test (Chromium 83), the event log showed these targets:
| Point | Alpha mask | Clip path |
|---|---|---|
| A · Visible path | SVG path | SVG path |
| B · Hidden path | SVG path | Button underneath |
| C · Outside the path | Button underneath | Button underneath |
B tells the story. An SVG alpha mask changes the opacity of the rendered pixels. Under pointer-events: visiblePainted, the filled path can still receive the pointer event where the mask makes it fully transparent. A clip path also constrains hit testing, so the part of the path outside the clip can’t receive the event.
C is the control. The mask leaves the original path eligible for hit testing. It doesn’t turn the whole SVG viewport into a target.
Reproduce the difference
Put these definitions inside your inline SVG. Both rectangles cover the same left half of the viewBox:
<defs> <mask id="left-mask" maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse" x="0" y="0" width="160" height="120" style="mask-type: alpha"> <rect width="80" height="120" fill="white" /> </mask> <clipPath id="left-clip" clipPathUnits="userSpaceOnUse"> <rect width="80" height="120" /> </clipPath> </defs> Apply mask="url(#left-mask)" to your filled path for the first run, then swap it for clip-path="url(#left-clip)". Use unique IDs if both examples are on the same page.
In the test, the outer SVG has pointer-events: none and the tested path explicitly opts back in with pointer-events: visiblePainted. That lets the browser test the path without the SVG viewport intercepting clicks. Log event.target from a listener on the common wrapper to see which element actually received the click.
What if the icon lives in a button?
For a toolbar action, the button can own the interaction. Put the icon inside a native button, give the button an accessible name, and make the decorative SVG ignore pointer input. Attach the action to the button.
<button type="button" aria-label="Show preview"> <svg aria-hidden="true" focusable="false" viewBox="0 0 160 120" class="button-icon"> <!-- Your masked or clipped path. --> </svg> </button> .button-icon, .button-icon * { pointer-events: none; } With that setup, A, B and C all targeted the native button in both versions. The native control also gives you standard keyboard activation. When checking your own toolbar, tab to the button and try Enter and Space.
If you’re building an SVG where each shape has its own action, test a point inside the original path that the effect hides. If you’re building an icon button, test the button’s full clickable area and activate it with the keyboard. A screenshot can confirm the artwork. Those checks confirm the interaction.


