Bug 243107 - Safari re-snapping repeatedly on Twitter timeline after adding scroll snap user styles
Summary: Safari re-snapping repeatedly on Twitter timeline after adding scroll snap us...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Scrolling (show other bugs)
Version: Safari 15
Hardware: Mac (Intel) macOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2022-07-22 12:12 PDT by Šime Vidas
Modified: 2022-07-25 18:17 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Šime Vidas 2022-07-22 12:12:42 PDT
Steps to reproduce: 

1. Open https://twitter.com/home
2. Run the following code in the JS console to inject scroll snap user styles to page:

    document.body.insertAdjacentHTML(
    "beforeend",
    `
    <style>
    html {
        scroll-snap-type: y proximity !important;
    }

    article {
        scroll-snap-align: start !important;
    }

    [aria-label="Home timeline"] > :first-child {
        position: static !important;
        scroll-snap-align: start !important;
    }

    [aria-label="New Tweets are available."] {
        display: none !important;
    }
    </style>
    `
    );

3. Start scrolling the page down repeatedly.

What happened?

At certain points, Safari will start re-snapping different tweets to the top while the user is doing nothing.

I have recorded a video of the issue: https://www.youtube.com/watch?v=i99ADUX9uak
Comment 1 Šime Vidas 2022-07-22 12:22:24 PDT
I forgot to mention how other browsers behave after adding scroll snap to the Twitter timeline:

- In Chrome, it works well, although there is an issue with fast scrolling.

- In Firefox, it works the best, but re-snapping has not shipped in Firefox yet.
Comment 2 Karl Dubost 2022-07-25 18:16:06 PDT
Thanks Šime for the report.

Step 0.
Need to be logged in on Twitter ;) 


So yes I can confirm, It is required to scroll fast and have scroll a certain amount of content. It seems partially related to reloading of the content. When the content disappears and reappears on the timeline (when out of the view) because of the scroll.
Comment 3 Karl Dubost 2022-07-25 18:17:45 PDT
Oh and each time this is happening it seems there is a Full Garbage Collection showing in the timeline tool.
Comment 4 Radar WebKit Bug Importer 2022-07-25 18:17:56 PDT
<rdar://problem/97580072>