icecat: add release icecat-140.10.1-1gnu1 for ecne

This commit is contained in:
Ark74 2026-05-04 16:58:41 -06:00
parent a5f93cb214
commit ff85d7c623
1256 changed files with 63469 additions and 24141 deletions

View file

@ -40,15 +40,18 @@ SwipeTracker::SwipeTracker(nsIWidget& aWidget,
const PanGestureInput& aSwipeStartEvent,
uint32_t aAllowedDirections,
uint32_t aSwipeDirection)
: mWidget(aWidget),
mRefreshDriver(GetRefreshDriver(mWidget)),
: mWidget(do_GetWeakReference(&aWidget)),
mRefreshDriver(GetRefreshDriver(aWidget)),
mAxis(0.0, 0.0, 0.0, kSpringForce, 1.0),
mEventPosition(RoundedToInt(ViewAs<LayoutDevicePixel>(
aSwipeStartEvent.mPanStartPoint,
PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent))),
mLastEventTimeStamp(aSwipeStartEvent.mTimeStamp),
mAllowedDirections(aAllowedDirections),
mSwipeDirection(aSwipeDirection) {
mSwipeDirection(aSwipeDirection) {}
void SwipeTracker::StartTracking(
const PanGestureInput& aSwipeStartEvent) {
SendSwipeEvent(eSwipeGestureStart, 0, 0.0, aSwipeStartEvent.mTimeStamp);
ProcessEvent(aSwipeStartEvent, /* aProcessingFirstEvent = */ true);
}
@ -96,6 +99,8 @@ bool SwipeTracker::ComputeSwipeSuccess() const {
nsEventStatus SwipeTracker::ProcessEvent(
const PanGestureInput& aEvent, bool aProcessingFirstEvent /* = false */) {
RefPtr<SwipeTracker> selfPin(this);
// If the fingers have already been lifted or the swipe direction is where
// navigation is impossible, don't process this event for swiping.
if (!mEventsAreControllingSwipe || !SwipingInAllowedDirection()) {
@ -109,12 +114,16 @@ nsEventStatus SwipeTracker::ProcessEvent(
: nsEventStatus_eConsumeNoDefault;
}
nsCOMPtr<nsIWidget> widget = do_QueryReferent(mWidget);
if (!widget) {
return nsEventStatus_eIgnore;
}
mDeltaTypeIsPage = aEvent.mDeltaType == PanGestureInput::PANDELTA_PAGE;
double delta = [&]() -> double {
if (mDeltaTypeIsPage) {
return -aEvent.mPanDisplacement.x / StaticPrefs::widget_swipe_page_size();
}
return -aEvent.mPanDisplacement.x / mWidget.GetDefaultScaleInternal() /
return -aEvent.mPanDisplacement.x / widget->GetDefaultScaleInternal() /
StaticPrefs::widget_swipe_pixel_size();
}();
@ -185,6 +194,8 @@ void SwipeTracker::StartAnimating(double aStartValue, double aTargetValue) {
}
void SwipeTracker::WillRefresh(TimeStamp aTime) {
RefPtr<SwipeTracker> selfPin(this);
// FIXME(emilio): shouldn't we be using `aTime`?
TimeStamp now = TimeStamp::Now();
mAxis.Simulate(now - mLastAnimationFrameTime);
@ -214,7 +225,11 @@ void SwipeTracker::CancelSwipe(const TimeStamp& aTimeStamp) {
void SwipeTracker::SwipeFinished(const TimeStamp& aTimeStamp) {
SendSwipeEvent(eSwipeGestureEnd, 0, 0.0, aTimeStamp);
mWidget.SwipeFinished();
nsCOMPtr<nsIWidget> widget = do_QueryReferent(mWidget);
if (!widget) {
return;
}
widget->SwipeFinished();
}
void SwipeTracker::UnregisterFromRefreshDriver() {
@ -238,14 +253,18 @@ void SwipeTracker::UnregisterFromRefreshDriver() {
return geckoEvent;
}
bool SwipeTracker::SendSwipeEvent(EventMessage aMsg, uint32_t aDirection,
void SwipeTracker::SendSwipeEvent(EventMessage aMsg, uint32_t aDirection,
double aDelta, const TimeStamp& aTimeStamp) {
nsCOMPtr<nsIWidget> widget = do_QueryReferent(mWidget);
if (!widget) {
return;
}
WidgetSimpleGestureEvent geckoEvent =
CreateSwipeGestureEvent(aMsg, &mWidget, mEventPosition, aTimeStamp);
CreateSwipeGestureEvent(aMsg, widget, mEventPosition, aTimeStamp);
geckoEvent.mDirection = aDirection;
geckoEvent.mDelta = aDelta;
geckoEvent.mAllowedDirections = mAllowedDirections;
return mWidget.DispatchWindowEvent(geckoEvent);
widget->DispatchWindowEvent(geckoEvent);
}
// static