Open Bug 1994552 Opened 8 months ago Updated 8 months ago

Unnecessary `pointerover` and `pointerenter` events are fired after `dragstart`

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

Firefox 146
defect

Tracking

()

People

(Reporter: sb3nder, Unassigned)

Details

Attachments

(1 file)

Attached file drag-min.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0

Steps to reproduce:

  1. Open drag-min.html.
  2. Move mouse pointer over the <div> (green).
  3. With the mouse primary button, drag the <div> outside <section> (gray).

Actual results:

  1. Observe log(:h = :hover, :a = :active):
pointerdown <DIV> SECTION:h DIV:h
dragstart <DIV> SECTION:a:h DIV:a:h
pointercancel <DIV> SECTION:a:h DIV:a:h
pointerout <DIV> SECTION:a:h DIV:a:h
pointerleave <DIV> SECTION:a:h DIV:a:h
pointerleave <SECTION> SECTION:a:h DIV:a:h
pointerover <DIV> SECTION:a:h DIV:a:h
pointerenter <SECTION> SECTION:a:h DIV:a:h
pointerenter <DIV> SECTION:a:h DIV:a:h
dragenter <DIV> SECTION:a:h DIV:a:h
...
dragend <DIV> SECTION:a:h DIV:a:h
pointermove <DIV> SECTION:a:h DIV:a:h
pointerout <DIV> SECTION:a:h DIV:a:h
pointerleave <DIV> SECTION:a:h DIV:a:h
pointerleave <SECTION> SECTION:a:h DIV:a:h

Expected results:

  1. Observe log:
pointerdown <DIV> SECTION:h DIV:h
dragstart <DIV> SECTION:a:h DIV:a:h
pointercancel <DIV> SECTION:h DIV:h (:active removed)
pointerout <DIV> (:hover removed)
pointerleave <DIV>
pointerleave <SECTION>
dragenter <DIV>
...
dragend <DIV>

It has been discussed a bit here: https://github.com/w3c/pointerevents/issues/555

I haven't included double-tap touch drag in this issue, as I believe it will be deprecated due to its lack of support for dragging <a> links.

Masayuki, does the expected result look right to you?

Flags: needinfo?(masayuki)

Yeah, I think so. According to a quick look of PointerBoundaryEvents:4,sync, the unnecessary pointerover and pointerenters are caused by a real pointermove. However, the pointermove is not fired on the content. I'm not sure how we block the pointermove during the drag. I mean, NotifyMouseOver needs to check the same things.

Flags: needinfo?(masayuki)

It seems that the pointermove is caused by a mousemove. Probably, that has already enqueued before APZC knows the pointer is canceled by a drag start.

I think BrowserChild should stop dispatching mouse events if and only if there is a drag session and the drag session is caused by the pointer. However, we do not store the pointer info of the session. So, I think we should make nsBaseDragSession store the pointerId at InitWith*().

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Unspecified → All
Hardware: Unspecified → All
Summary: Drag-and-drop pointerevents order is wrong → Unnecessary `pointerover` and `pointerenter` events are fired after `dragstart`
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: