Erik Dahlström's testpage shows the SVG logo referenced three times in one page, using all three embedding techniques respectively: object, embed, iframe and then works some JavaScript on them Load the page in Safari http://dahlström.net/svg/html/get-embedded-svg-document-script.html all three SVG logos (original fill: orange) get a green fill via script then load any other page then hit the back button the first two svg logos (object, embed) will be orange (their original state before script), the one with iframe will have a green fill Firefox 17, Chrome 23, IE9/10 seem to fire another onload event on hitting the backbutton, resulting in identical display on first load and on returning via backbutton. Opera 12 behaves like Safari in this scenario.
This might be expected behavior.
Posted the previous comment prematurely. This sounds like a consequence of caching pages with plug-ins, and treating <object> and <embed> as plug-in content.
Yup - we blindly treat <embed> and <object> as plug-ins even if they aren't actually backed by a plugin instance. We should be able to detect this and properly cache such elements.
*** Bug 130018 has been marked as a duplicate of this bug. ***
Created attachment 226517 [details] [Web Archive] http://dahlström.net/svg/html/get-embedded-svg-document-script.html For historical preservation, attached a web archive of <http://dahlström.net/svg/html/get-embedded-svg-document-script.html> as it appeared on 03/12/2014 using Safari Version 7.0.2 (9537.74.9).
Created attachment 226519 [details] [Screenshot] Initial load of http://dahlström.net/svg/html/get-embedded-svg-document-script.html Screenshot of initial load of <http://dahlström.net/svg/html/get-embedded-svg-document-script.html>.
Created attachment 226520 [details] [Screenshot] After navigating to another site and hitting back button Screenshot of <http://dahlström.net/svg/html/get-embedded-svg-document-script.html> after navigating to another site and hitting the back button to return to the dahlström.net page. Note, sometimes I needed to navigate to another site (e.g. apple.com), click the back button, click the forward button and then click the back button to reproduce this issue.
<rdar://problem/27088113>
It is still reproducible in Safari 17. 1) Go to > http://dahlström.net/svg/html/get-embedded-svg-document-script.html 2) All Green filled 3) Open 'gmail.com' or 'google.com' or any website on same tab 4) then using back button or swipe back gesture to go back to (1) page First two are now not 'green' filled. Adding 'BrowserCompat' as needed. Since Chrome Canary 119 and Firefox Nightly 120 are working fine.