Updated MouseTracker's hasGestureHandlers and hasScrollHandler to be getters

This commit is contained in:
Jessica R. 2025-01-02 23:07:13 -07:00 committed by GitHub
parent 9527f15f52
commit 641e085259
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -386,10 +386,9 @@
/** /**
* Do we currently have any assigned gesture handlers. * Do we currently have any assigned gesture handlers.
* @function
* @returns {Boolean} Do we currently have any assigned gesture handlers. * @returns {Boolean} Do we currently have any assigned gesture handlers.
*/ */
hasGestureHandlers: function () { get hasGestureHandlers() {
return !!(this.pressHandler || return !!(this.pressHandler ||
this.nonPrimaryPressHandler || this.nonPrimaryPressHandler ||
this.releaseHandler || this.releaseHandler ||
@ -403,10 +402,9 @@
/** /**
* Do we currently have a scroll handler. * Do we currently have a scroll handler.
* @function
* @returns {Boolean} Do we currently have a scroll handler. * @returns {Boolean} Do we currently have a scroll handler.
*/ */
hasScrollHandler: function () { get hasScrollHandler() {
return !!this.scrollHandler; return !!this.scrollHandler;
}, },
@ -2855,7 +2853,7 @@
eventInfo.isStoppable = true; eventInfo.isStoppable = true;
eventInfo.isCancelable = true; eventInfo.isCancelable = true;
eventInfo.preventDefault = false; eventInfo.preventDefault = false;
eventInfo.preventGesture = !tracker.hasGestureHandlers(); eventInfo.preventGesture = !tracker.hasGestureHandlers;
eventInfo.stopPropagation = false; eventInfo.stopPropagation = false;
break; break;
case 'pointerover': case 'pointerover':
@ -2873,22 +2871,22 @@
case 'pointerdown': case 'pointerdown':
eventInfo.isStoppable = true; eventInfo.isStoppable = true;
eventInfo.isCancelable = true; eventInfo.isCancelable = true;
eventInfo.preventDefault = false; // updatePointerDown() may set true (tracker.hasGestureHandlers()) eventInfo.preventDefault = false; // updatePointerDown() may set true (tracker.hasGestureHandlers)
eventInfo.preventGesture = !tracker.hasGestureHandlers(); eventInfo.preventGesture = !tracker.hasGestureHandlers;
eventInfo.stopPropagation = false; eventInfo.stopPropagation = false;
break; break;
case 'pointerup': case 'pointerup':
eventInfo.isStoppable = true; eventInfo.isStoppable = true;
eventInfo.isCancelable = true; eventInfo.isCancelable = true;
eventInfo.preventDefault = false; eventInfo.preventDefault = false;
eventInfo.preventGesture = !tracker.hasGestureHandlers(); eventInfo.preventGesture = !tracker.hasGestureHandlers;
eventInfo.stopPropagation = false; eventInfo.stopPropagation = false;
break; break;
case 'wheel': case 'wheel':
eventInfo.isStoppable = true; eventInfo.isStoppable = true;
eventInfo.isCancelable = true; eventInfo.isCancelable = true;
eventInfo.preventDefault = false; // handleWheelEvent() may set true eventInfo.preventDefault = false; // handleWheelEvent() may set true
eventInfo.preventGesture = !tracker.hasScrollHandler(); eventInfo.preventGesture = !tracker.hasScrollHandler;
eventInfo.stopPropagation = false; eventInfo.stopPropagation = false;
break; break;
case 'gotpointercapture': case 'gotpointercapture':