RESOLVED FIXED 266181
Advanced tracking and fingerprinting protection performance issues with drawImage
https://bugs.webkit.org/show_bug.cgi?id=266181
Summary Advanced tracking and fingerprinting protection performance issues with drawI...
Daniel Beauchamp
Reported 2023-12-10 09:27:10 PST
Description: In iOS 17 and mac OS Sonoma, using drawPixels performance is slowed when paired with webgl rendering. It is a common technique to get around webgl context limitations to render a scene to an offscreen canvas, then output it to a desired 2d canvas using drawImage. However with Advanced Tracking and Fingerprinting protection, framerate seems to decrease dramatically. Version: Latest: 271834@main Reproduction steps: - Open the following in latest: https://evanescent-traveling-radio.glitch.me/ - You should see a box that you can spin smoothly - Now open it in Privacy mode (which has advanced fingerprinting protection turned on) - Spinning the box is now sluggish and choppy If you turn off advanced fingerprinting protection, then suddenly its fast again. This is the same on iOS 17 The minimal test case code is here: https://gist.github.com/pushmatrix/bd72b5853b49ff217b0a780ea54e5bd5 My assumption is that advanced tracking protection has a false positive here and is introducing noise to the drawImage functionality that is slowing rendering to a crawl. Impact: Model viewer (https://modelviewer.dev/) uses this offscreen technique to allow for lots of 3D elements on a page. It is currently affected by this: https://github.com/google/model-viewer/issues/4587 Many sites rely on this technique. Shopify relies on this viewer for displaying 3D models on hundreds of thousands of sites. Currently anyone viewing it in webkit in privacy mode has a very degraded experience.
Attachments
Alexey Proskuryakov
Comment 1 2023-12-11 13:39:35 PST
This sounds like a duplicate of bug 263129. Does this still reproduce with iOS 17.2?
Alexey Proskuryakov
Comment 2 2023-12-11 13:40:29 PST
Please feel free to re-open if this still happens. *** This bug has been marked as a duplicate of bug 263129 ***
Daniel Beauchamp
Comment 3 2023-12-16 23:13:34 PST
This is still happening in 17.2 I’ll be able to test on Mac this coming week, but it’s definitely still in 17.2 iOS 17.2 (21C62)
Radar WebKit Bug Importer
Comment 4 2023-12-17 09:28:13 PST
Paul Neave
Comment 5 2023-12-18 06:32:50 PST
This is not fixed in iOS 17.2. Safari TP 17.4 still shows this issue too.
Daniel Beauchamp
Comment 6 2024-01-10 12:56:38 PST
Update on this. The issue seems to only persist when the source canvas is not in the DOM. Ex: if you just do document.createElement('canvas') to have function as an offscreen canvas, then the drawImage calls will be really slow. If you however add the offscreen canvas to the DOM with appendChild, the problem goes away. Interestingly, if you do `display:none` on that canvas, the problem comes back. But if you set height to 0px to hide it, then everything is fine. Here's an updated glitch with the offscreen canvas in the DOM and "hidden" with 0px height: https://common-teal-okapi.glitch.me
Matthew Finkel
Comment 7 2024-01-12 10:45:31 PST
Thanks for these details and providing the reduced test cases. I believe I see the issue.
Matthew Finkel
Comment 8 2024-01-12 10:47:30 PST
*** Bug 266473 has been marked as a duplicate of this bug. ***
Matthew Finkel
Comment 9 2024-01-12 23:30:24 PST
Matthew Finkel
Comment 10 2024-01-13 13:31:35 PST
*** Bug 263013 has been marked as a duplicate of this bug. ***
EWS
Comment 11 2024-01-22 08:15:36 PST
Committed 273301@main (4c31678fef68): <https://commits.webkit.org/273301@main> Reviewed commits have been landed. Closing PR #22746 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.