Skip to content

touch: Stop flinging if no scroll happened#41028

Merged
yezhizhen merged 2 commits intoservo:mainfrom
kongbai1996:flingend
Dec 4, 2025
Merged

touch: Stop flinging if no scroll happened#41028
yezhizhen merged 2 commits intoservo:mainfrom
kongbai1996:flingend

Conversation

@kongbai1996
Copy link
Copy Markdown
Contributor

@kongbai1996 kongbai1996 commented Dec 3, 2025

If no scroll happened, we would stop flinging if there is any.
Extract the functionality to fn stop_fling_if_needed.
Testing: There are currently no related test cases for the modifications made to fling.
Fixes: #41026

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 3, 2025
@jschwe
Copy link
Copy Markdown
Member

jschwe commented Dec 3, 2025

I think you might need to add a bit more explanation about the background. I'd like to understand better what is happening.

@yezhizhen yezhizhen changed the title No scroll happened, so if we were flinging, stop the fling. touch: Stop flinging if no scroll happened Dec 4, 2025
Copy link
Copy Markdown
Member

@yezhizhen yezhizhen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might need to add a bit more explanation about the background. I'd like to understand better what is happening.

The background is listed in issue. I adjusted title/text a bit.

Testing: There are currently no related test cases for the modifications made to fling.

I will add webdriver support for touch in a few days.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Dec 4, 2025
@yezhizhen yezhizhen enabled auto-merge December 4, 2025 00:58
@yezhizhen yezhizhen added this pull request to the merge queue Dec 4, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 4, 2025
@kongbai1996
Copy link
Copy Markdown
Contributor Author

kongbai1996 commented Dec 4, 2025

I think you might need to add a bit more explanation about the background. I'd like to understand better what is happening.

When the fling reaches the bottom and there is no more distance to scroll, if the fling is not ended and observing_frames_for_fling is set to false, then it will never be possible to add a FlingRefreshDriverObserver here,

pub(crate) fn add_touch_move_refresh_observer_if_necessary(
&self,
refresh_driver: Rc<BaseRefreshDriver>,
repaint_reason: &Cell<RepaintReason>,
) {
if self.observing_frames_for_fling.get() {
return;
}
which will prevent subsequent flings.

Merged via the queue into servo:main with commit c8f82f9 Dec 4, 2025
30 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to fling in some scenarios.

4 participants