CSS view transitions crashed my webpage
My 'view transitions' were causing my game to crash in Chrome.
I got the 'Aw Shucks' message from Chrome.
I thought maybe the 'view transitions' needed a lot of memory to prepare the new page state in the background. I had just added lots of SVG's to my game which may use up memory. But Chrome's tools showed the 'view transitions' only used a modest amount of memory compared to holding the total page size.
It seems 'view transitions' are supported by most browsers now and are no longer experimental.
I get the same 'Aw Shucks' message when I run my large game through the online JSHint on an old PC.
I had a 'view-transition-name' on the 'root' element. I moved the name to smaller areas of the page that are actually displayed when the transition runs. Chrome now crashed much less often.
I removed the 'view transition' animation from the start of the game because the page changes a lot. This seemed to have stopped Chrome crashing.
I was going to add an old-style CSS animation to the start of the game as a fallback. But there would be a pause between animating out the old page and animating in the new layout as the page is changed.
I also planned to move the SVG's from the HTML 'body' to data URL's in 'background images' in the CSS. I hoped this would remove all the elements within the SVG's from the document model
But, a few months later, I noticed Chrome no longer crashes when the 'view transitions' at the start of the game run. Maybe the Chrome developers improved the code. Maybe the problem was where two 'view transitions' ran at the same time

Comments
Post a Comment