NEW 32307
SVG (and other content) embedded via object tag cannot be loaded from application cache
https://bugs.webkit.org/show_bug.cgi?id=32307
Summary SVG (and other content) embedded via object tag cannot be loaded from applica...
Koralewski Benoit
Reported 2009-12-09 00:23:31 PST
An html file including a svg file in an object tag, a manifest with the two files. index.html : -------------------------------------------------------------- !DOCTYPE html> <html manifest = "test.manifest"> <body> <object data="foo.svg" type="image/svg+xml" ></object> </body> </html> foo.svg : -------------------------------------------------------------- <svg xmlns="http://www.w3.org/2000/svg" version="1.1"> <circle id="myCircle" cx="100" cy="75" r="50" fill="blue" stroke="firebrick" stroke-width="3" /> <text x="60" y="155">Hello World</text> </svg> test.manifest : -------------------------------------------------------------- CACHE MANIFEST index.html foo.svg In offline mode the svg don't appear ! Ps: it works in firefox
Attachments
Alexey Proskuryakov
Comment 1 2009-12-10 15:03:12 PST
One workaround is to use <img> instead of <object>.
Alexey Proskuryakov
Comment 2 2009-12-10 21:22:15 PST
It's is broken due to this code in MainResourceLoader::continueAfterContentPolicy(): if (status < 200 || status >= 300) { bool hostedByObject = frameLoader()->isHostedByObjectElement(); frameLoader()->handleFallbackContent(); // object elements are no longer rendered after we fallback, so don't // keep trying to process data from their load if (hostedByObject) cancel(); } A response generated in MainResourceLoader::handleDataLoadNow() from substitute data has status of 0, so the substitute data is not used for OBJECT.
Alexey Proskuryakov
Comment 3 2009-12-10 21:29:13 PST
This code was added in <http://trac.webkit.org/changeset/13615>.
Nikolas Zimmermann
Comment 4 2010-07-09 07:17:02 PDT
Changed component to SVG, so it shows up in my all-svg-bugs search.
Alexey Proskuryakov
Comment 5 2010-07-09 10:12:15 PDT
This is not really about SVG, it's a general issue with OBJECT and appcache.
Michael Nordman
Comment 6 2011-03-01 17:06:57 PST
This looks like it may be related to https://bugs.webkit.org/show_bug.cgi?id=55500
Alexey Proskuryakov
Comment 7 2011-05-13 09:52:26 PDT
This is related, but is not a duplicate. The additional problem here is that SubstituteData doesn't even have a field for response code, so we don't pass it from ApplicationCacheResource to MainResourceLoader. This should be a very easy fix.
Ahmad Saleem
Comment 8 2022-09-03 10:31:08 PDT
I changed the test case from Comment 0 into JSFiddle: Link - https://jsfiddle.net/2fmvz7da/ Only Firefox Nightly 106 show "Image" while other Chrome Canary 107, Safari 15.6.1 and Safari Technology Preview 152 does not show SVG inside object. Just wanted to share updated testing results. Thanks!
Ahmad Saleem
Comment 9 2022-09-03 10:32:20 PDT
Just to update - my testing can be wrong because I didn't test it in offline mode. Thanks!
Alexey Proskuryakov
Comment 10 2022-09-04 13:38:20 PDT
Once an appcache is saved, it intercepts loads even when online. So in a correct test, the SVG will show up the very first time, but not after that. This JSFiddle is not a correct test, as this issue is about subresources that are part of appcache, and are loaded separately from the main resource.
Note You need to log in before you can comment on or make changes to this bug.