Closed Bug 1177528 Opened 4 years ago Closed Last year

CSS pointer-events: none; not working on pseudo-elements

Categories

(Core :: DOM: Events, defect, P5)

38 Branch
Unspecified
macOS
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: github, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file pointer events.html
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3

Steps to reproduce:

i added pointer-events: none; to a pseudo element.


Actual results:

the pseudo element is still the target of mouse events.


Expected results:

the pseudo element should ignore mouse events.
OS: Unspecified → Mac OS X
Presumably we do the pointer-events check on the actual target of the event, which is the non-anonymous element, not the pseudo-element...
Component: CSS Parsing and Computation → DOM: Events
See Also: → 1299046
Blocks: css-pseudo-4
Priority: -- → P5
This bug was mentioned in this article: https://codepen.io/MartijnCuppens/full/MBjqbM/
Flags: needinfo?(emilio)
That is actually bug 1089326, fwiw. That is, replacing the <button> for a <div> works.
I think this is working as expected actually.

Our behavior is consistent with chrome here and I think this makes sense. The behavior for pseudos is equivalent to:

 <span onclick="alert(1)"><span style="pointer-events: none">Clicking me alerts</span></span>

So I think this is invalid.
Flags: needinfo?(emilio)
Per comment 4, but lmk if I got it wrong.
Status: UNCONFIRMED → RESOLVED
Closed: Last year
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.