Created attachment 461639 [details] Code reproduction When compositing a large number of elements that have z-index, WebKit will crash. This behavior first appeared on iOS 15.6. Steps to reproduce: 1. Open the code reproduction on a device running iOS 15.6. 2. Inspect the page and open the "Layers" tab in dev tools. 3. Tap the "Crash" button. 4. Observe that memory usage spikes and Safari reloads the page. Other Information: - I tested this on an iPhone 11 running iOS 15.6. In my tests, the memory usage spiked to over 1GB. - This code reproduction does use a large number of elements. While using a smaller number of elements (such as 100) won't crash the browser, it will still cause the memory usage to spike. - This issue can also been seen on Safari for macOS. On Safari 15.5, clicking the "Crash" button brings the memory usage up to 40mb. On STP 151, clicking the "Crash" button brings the memory usage up to over 700mb. (Tested on a 2021 MacBook Pro with M1 Pro) - This issue also happens on WKWebView.
The testcase triggers backing store allocation on all the `div.native` but I'm not sure why the ones outside the viewport have backing store.
<rdar://problem/98686446>
Created attachment 461661 [details] Static testcase We make backing store for all the layers because they are inside a large, animated element ("container") so we keep all their backing stores alive. There are several issues here: 1. The animation is a no-op, so we shouldn't consider it as something that extends backing store 2. z-index:-1 should not trigger backing store (`.native`) is a stacking context 3. Only `.container` should have backing while animating, because it's a stacking context.
Still an issue with iOS 16, please fix as this is highly affecting users in one of our apps 😕
This issue is also severely affecting our application and in some cases rendering it almost un-usable.
Looks like this is still an issue in iOS 15.7 as well.
I think the fix for https://bugs.webkit.org/show_bug.cgi?id=244543 will fix this.
I can confirm that I can reproduce this with 15.7 as well. Since our app is based on pinch zoom it makes it not usable at all. Would be nice if we can get this fixed soon.
> I think the fix for https://bugs.webkit.org/show_bug.cgi?id=244543 will fix this. Simon or Matt, would you mind confirming that it did?
The issue seems to be resolved on STP 156 on macOS. However, the issue persists on iOS 16.2 beta 2. The memory usage spikes to over 2GB when following the original steps to reproduce on an iPhone 13.
I experience the same issue with cordova on 16.2
This no longer reproduces on iOS 16.3.