Commit Graph

11 Commits (7412dde8ee25c5866293b0083cf6b412b44d720a)

Author SHA1 Message Date
Pierre Ossman 7412dde8ee Handle quick Cursor detach after mouse up
This timer might fire after the Cursor object has detached from a DOM
element, causing crashes. This will likely not happen in real scenarios,
but the tests are quick enough to trigger this.
4 years ago
Juanjo Diaz 1c38b6f120 Remove generated HTML by Cursor when it detaches 4 years ago
Pierre Ossman 12cdad066e Make Cursor.detach() safe to call when not attached
Avoids having checks in higher layers.
4 years ago
Samuel Mannehed 6067290169 Rename document.capturedElem to captureElement
To better fit most naming.
4 years ago
Samuel Mannehed 996895268e Hide the emulated cursor when target is null
Makes it easier to understand what happens when a real element isn't
passed as a target to updateVisibility(). Also makes the code more
robust to future changes.

Co-authored-by: Alex Tanskanen <aleta@cendio.se>
Co-authored-by: Niko Lehto <nikle@cendio.se>
4 years ago
Samuel Mannehed fb14c2dec9 Fix disappearing cursor after click
In the cursor emulation when deciding if the cursor should be hidden -
Instead of checking what's under the cursor, we check the element that
has capture.

This introduced another bug in the cursor emulation. The cursor did not
always disappear properly when using our cursor emulation together with
our setCapture polyfill. More specifically, we saw a problem when a
capture ended on an element without cursor emulation.

We solved this by introducing another visibility check on a timer in
the cursor emulation. However this led to yet another problem where
this timer conflicted with the timer in the setCapture polyfill.

We removed the timeout in the setCapture polyfill and created a
variable to make sure that all the events remaining in the queue can be
completed.

Co-authored-by: Alex Tanskanen <aleta@cendio.se>
Co-authored-by: Niko Lehto <nikle@cendio.se>
4 years ago
Samuel Mannehed 83d5e5bffd Check next elem at mouseleave in cursor emulation
It's not obvious that we want to hide the cursor when we get a leave,
it depends on the element that we're leaving to. This makes the code
more robust.

Co-authored-by: Alex Tanskanen <aleta@cendio.se>
Co-authored-by: Niko Lehto <nikle@cendio.se>
4 years ago
Samuel Mannehed 0dcb896920 Update copyright to 2019 for modified files 4 years ago
Juanjo Diaz c6c278f9d5 Replace unnecessary function supportsCursorURIs by a constant variable 4 years ago
Juanjo Diaz 1ff792cf4b Remove unnecessary constructor parameter from Cursor 4 years ago
matt 408c005d3e Initial commit 5 years ago