Bug 224953

Summary: REGRESSION (Safari 14): Elements with negative margin in scrollable regions no longer hidden by parent element padding
Product: WebKit Reporter: John Whelchel <bugs.webkit>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Mac (Intel)   
OS: Unspecified   
Attachments:
Description Flags
Safari 14 (Bad)
none
Safari 13 (Good)
none
WebKit ToT Broken vs Chrome Canary 113 and Firefox Nightly 113 none

John Whelchel
Reported 2021-04-22 15:34:37 PDT
Created attachment 426856 [details] Safari 14 (Bad) A recent bug was introduced by Safari 14 where elements positioned via negative margin to be hidden "behind" the padding of a parent are no longer hidden if they are contained within a Scrollable area. I'm not a layout expert, so this is my best interpretation of what is happening. However, this JSFiddle reproduces the issue in a roughly minimal way: https://jsfiddle.net/whelchel/veL7dkyj/18/. I've also attached one screenshot - one from Safari 14 (bad). I will try and see if I can attach a second with the good behavior. In Safari 13, both times the SVG positioned with negative margin is hidden. This is the correct, expected behavior. In Safari 14, when contained by a scrollable, the SVG is visible, despite the padding that should "cover" it. You can compare the top and bottom instances to see the difference, with and without the scrollable.
Attachments
Safari 14 (Bad) (22.02 KB, image/png)
2021-04-22 15:34 PDT, John Whelchel
no flags
Safari 13 (Good) (15.66 KB, image/png)
2021-04-22 15:35 PDT, John Whelchel
no flags
WebKit ToT Broken vs Chrome Canary 113 and Firefox Nightly 113 (229.55 KB, image/png)
2023-03-17 17:41 PDT, Ahmad Saleem
no flags
John Whelchel
Comment 1 2021-04-22 15:35:08 PDT
Created attachment 426857 [details] Safari 13 (Good)
Simon Fraser (smfr)
Comment 2 2021-04-22 15:36:08 PDT
This is about accelerated overflow scroll having to make self-painting layers.
John Whelchel
Comment 3 2021-04-22 18:07:36 PDT
Cool, that's definitely beyond me to identify :) Happy to update the title if that's helpful
Radar WebKit Bug Importer
Comment 4 2021-04-29 15:35:38 PDT
Ahmad Saleem
Comment 5 2023-03-17 17:41:18 PDT
Created attachment 465487 [details] WebKit ToT Broken vs Chrome Canary 113 and Firefox Nightly 113 It is still an issue in WebKit ToT as shown in the picture.
Ahmad Saleem
Comment 6 2024-11-30 12:38:29 PST
It works fine now on WebKit ToT (287180@main), no peeking `)` like reference image on test case. Marking this as 'Configuration Changed'.
Ahmad Saleem
Comment 7 2024-11-30 12:39:08 PST
Just to flag - Safari Technology Preview 208 is also working fine.
Note You need to log in before you can comment on or make changes to this bug.