When you toggle <object> HTML element between display:block and display:none the object is reloaded. Didn't happen on iPadOS 14.0 and doesn't happen on Chrome and FireFox. Tested on iPadOS 15.0, 14.8 To reproduce see that the timestamp on Safari changes every time you click on the 'Toggle Display' button. On Chrome and Firefox the timestamp doesn't change. https://jsbin.com/yoboxuhegu/1/edit?html,output <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> </head> <body> <button onclick="toggleDisplay()">Toggle Display</button> <object style="display: block;" data="data:text/html;utf-8,<body onload='document.body.innerText = Date.now()'>hello"></object> <script> let el = document.querySelector('object'); let count = 1; function log() { el.text = count; count++; } function toggleDisplay() { let display = el.style.display == 'block' ? 'none' : 'block'; el.style.display = display; } </script> </body> </html>
<rdar://problem/83534931>
I am able to reproduce this bug in Safari 15.6 and Technical Preview 150 on macOS 12.5 and toggling "Display" button changes timestamp every time unlike other browsers (Chrome Canary 106 and Firefox Nightly 105). Thanks!
Adding 'BrowserCompat' since it is still reproducible in STP172.