Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Suppress over/out/enter/leave during capture #177

Closed
scottgonzalez opened this issue Apr 3, 2015 · 5 comments
Closed

Suppress over/out/enter/leave during capture #177

scottgonzalez opened this issue Apr 3, 2015 · 5 comments
Milestone

Comments

@scottgonzalez
Copy link
Contributor

Boundary events should only fire when they occur on the boundary of the capturing element. Boundary events from other elements should be suppressed, but they're currently kept and retargeted to the captured element.

@scottgonzalez
Copy link
Contributor Author

Also look into what events are triggered in each browser when the pointer is released over a different element.

@bethge
Copy link
Contributor

bethge commented Apr 26, 2015

I made a little visual test: http://jsbin.com/rihoyaqiso and did a 6 step interaction:

1.Enter capturing element
2. Press left mouse button [start capture]
3. Leave capturing element, enter other non-capturing element
4. release left mouse button [release capture]
5. move mouse
6. leave other element

The interesting parts are steps 3, 4 and 5. (All events are pointer events)

* : Events triggered on other element

Browser Leave capturing, enter other release lmb move mouse
Win10 VM with IE11 w/o PEP out >> leave >> move+ up move* >> over* >> enter* >> move*+
Win8 VM with IE10 w/ PEP out >> leave >> move+ up move* >> over* >> enter* >> move*+
Chrome 42 w/ PEP out >> leave >> over >> enter >> move+ up >> out* >> leave* over* >> enter* >> move*+
FF 37 w/ PEP out >> leave >> over >> enter >> move+ up move*+
FF 41 Nightly w/o PEP out >> move+ up >> over* >> enter* move*+
Safari 8.0.5 w/ PEP out >> leave >> over >> enter >> move+ up move*+

On releasing the lmb on Chrome, a mouseout is fired which causes the pointerleave and pointerout.

After having released the lmb, the next events fire on the other element. For e.g. a pointermove the spec demands a pointerenter and pointerover beforehand on the same element, which do not happen on FF and Safari.
IE11 with native PE holds back on the pointerenter and pointerover for the other element until the capture is released and the first move/up/down event triggers.

Iiuc, pointerover and -enter on the other element need to be delayed, until after the release of the capture and a move/up/down on the other element occurs. Alternatively, pointerover and -enter on the other element are suppresed and pointermove, -up and -down need to validate that a pointerenter and -over has occurred.

_Edit (May 13)_: Added IE10, FF Nightly; Formatting

@scottgonzalez
Copy link
Contributor Author

I've started a thread on public-pointer-events to see if we can get the expected events documented. I have a feeling that without this discussion, Firefox would end up with different behavior than IE (see details in the thread).

@stuartpb
Copy link
Contributor

Perhaps a clone of fireEvent in the dispatcher like fireOwnEvent that only fires an event if there is no pointer capture / the capture target is the same as the original event target?

@stuartpb
Copy link
Contributor

Also, pointer capture and event firing should kind of be rewritten to process pointer capture at the point of the next event, per http://www.w3.org/TR/pointerevents/#firing-events-using-the-pointerevent-interface

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants