Commit Graph

22 Commits (b837bd6f59c350abbd072f459be06ab2d0e1690d)

Author SHA1 Message Date
Samuel Mannehed a3e2b1e46e Standardize on camelCase in Logging 4 years ago
Niko Lehto 286694869b Add util for unsigned and signed int. conversion
Will be used in later commit in extended clipboard handling.
4 years ago
Juanjo Diaz 1c38b6f120 Remove generated HTML by Cursor when it detaches 4 years ago
Samuel Mannehed 2f43cead79 Add comment for browser and platform detection 4 years ago
Samuel Mannehed e7a5aa271e Add short description at the top of browser.js 4 years ago
Samuel Mannehed ad206180d2 Properly detect scrollbar gutter
As a rule, instead of hard-coding a behavior on specific platforms we
should do dynamic detection.

This commit moves away from always hiding scrollbars on Android and iOS
and instead detects the rendered width of scrollbars in the browser.
4 years ago
Samuel Mannehed ce94d92e18 Build in the behavior to ignore decodeUTF8 errors
Makes the code clearer and more explicit in intent.
4 years ago
Samuel Mannehed b2dc76ee18 Add encodeUTF8 function to core/util/strings.js 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 19dfb7901c Rename variables in setCapture proxy
The names of many variables were too similar. To make the code easier
to follow we renamed:

* _captureElem to _capturedElem
* _captureElemChanged() to _capturedElemChanged()
* captureElem to proxyElem
* elem to target

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
Niko Lehto 19f0803636 Fix url cursor detection on Edge
_supportCursorURIs was set to true even when Edge didn't support
URIs because the fallback value "default" was used.
4 years ago
Juanjo Diaz c6c278f9d5 Replace unnecessary function supportsCursorURIs by a constant variable 4 years ago
Juanjo Diaz 37c17ddbf9 Move support check from display to browser 4 years ago
Juanjo Diaz 5964156a6f Remove unnecessary context from eventtarget 4 years ago
Juanjo Diaz 1ff792cf4b Remove unnecessary constructor parameter from Cursor 4 years ago
Pierre Ossman d20f751441 Throw correct Error object
We've already defined the name Error as a logging function, so we
need to be more explicit when we want to refer to the exception
class.
4 years ago
matt 408c005d3e Initial commit 5 years ago