Bug 260443

Summary: Kinetic scrolling stops after elements are slotted
Product: WebKit Reporter: Steve Orvell <steveorvell>
Component: ScrollingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: iPhone / iPad   
OS: iOS 16   
Attachments:
Description Flags
Scrolling freezes after scrolling horizontally inside the top bordered container on iOS/iPadOS none

Description Steve Orvell 2023-08-20 06:31:53 PDT
Created attachment 467346 [details]
Scrolling freezes after scrolling horizontally inside the top bordered container on iOS/iPadOS

Setup: 
1. An element has a shadowRoot with a <slot> in it.
2. The element is scrollable.
3. A child element is appended and slotted to the <slot> *while* the element is scrolling. 

Expected: 
* The element continues to scroll after the child is appended.
Actual: 
* The element immediately stops scrolling after the child is appended.

Reproduction:

* Scroll horizontally inside each bordered container.
* Note, this issue occurs only on iOS/iPadOS.

The attached reproduction shows the *incorrect* behavior when a child is appended and slotted, and it also shows the *expected* behavior when a child is appended to the shadowRoot itself rather than slotted. The reproduction is also available at https://lit.dev/playground/#gist=05deaacf5ba04c069cc41b9d523b636b&view-mode=preview.
Comment 1 Simon Fraser (smfr) 2023-08-21 09:50:42 PDT
Does this happen with equivalent DOM mutations that don't involve slots?
Comment 2 Steve Orvell 2023-08-21 09:53:00 PDT
No, when the mutation does not involve slotting, scrolling works as expected. See the explanation of the repro at the end of the initial report.
Comment 3 Radar WebKit Bug Importer 2023-08-27 06:32:12 PDT
<rdar://problem/114523840>