Reproduces on iPad 15.4. Didn't check macOS. https://jsfiddle.net/rh2oe9js/8/ <div style="height: 300px; overflow: auto"> <div style="height: 600px; contain: paint"> <div style="position: sticky; top: 0; height: 50px; background-color: yellow"> </div> </div> </div> Expected: While scrolling, the yellow sticky div should stick to the top of the scroll container. This is the behavior in all other major browsers. Actual: Element is not sticky. Removing the "contain: paint" from the parent element makes it sticky again.
<rdar://problem/90572543>
Created attachment 456115 [details] Patch
Created attachment 456135 [details] Patch
Comment on attachment 456135 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456135&action=review > LayoutTests/ChangeLog:9 > + * fast/css/sticky/sticky-overflow-clip-container-expected.html: Added. > + * fast/css/sticky/sticky-overflow-clip-container.html: Added. Can this be a WPT?
Created attachment 456143 [details] Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment on attachment 456135 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456135&action=review >> LayoutTests/ChangeLog:9 >> + * fast/css/sticky/sticky-overflow-clip-container.html: Added. > > Can this be a WPT? Sure, patch updated and I did a manual export here: https://github.com/web-platform-tests/wpt/pull/33426.
Committed r292155 (249062@main): <https://commits.webkit.org/249062@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 456143 [details].
*** Bug 239357 has been marked as a duplicate of this bug. ***
This fix shipped with Safari 15.5 (all platforms).