28/04/07 1:21 AM Sky Huvard: Summary: Saving a webarchive with a <script><noscript> will render images in both when opened again. Steps to Reproduce: Save a web archive with a <script><img></script><noscript><img (same)></noscript> Open the web archive and see both references to the image being rendered, the noscript one and the script one. Expected Results: Only one should be rendered Actual Results: Both are rendered <rdar://problem/5166344>
Reporter confirmed via IRC that he has seen this with the latest nightly build (r21143) and in the released version of WebKit.
Created attachment 14230 [details] Test case An <img> tag within <script></script> tags is not even valid, and content within <noscript></noscript> tags should only appear if JavaScript is turned off. Thus the webarchive should show zero images (assuming JavaScript is on), as the test case does when loaded. Hixie's live dom viewer is handy in this situation as well: http://software.hixie.ch/utilities/js/live-dom-viewer/
(In reply to comment #2) > Created an attachment (id=14230) [edit] > Test case When I save a .webarchive of this test page, then view the source after opening it with Safari, I see the following HTML: <html><script> <img src="http://webkit.org/images/icon-gold.png"> </script><body><noscript></noscript> </body></html> Admittedly, the content in the <noscript></noscript> is NOT getting saved (and should be), but I can't reproduce the behavior the reporter is talking about. I also saved the webarchive and loaded the webarchive using a local debug build of WebKit r21145 with Safari 2.0.4 (419.3) on Mac OS X 10.4.9 (8P135). I haven't tried creating a webarchive with shippng Safari.
(In reply to comment #3) > I haven't tried creating a webarchive with shippng Safari. Shipping Safari doesn't even save the <noscript></noscript> tags in its webarchive: <HTML><SCRIPT> <img src="http://webkit.org/images/icon-gold.png"> </SCRIPT><BODY></BODY></HTML> Need more information (good test case) to reproduce the issue.
The source of the WebArchive on trunk is as follows: <html><head><script> <img src="http://webkit.org/images/icon-gold.png"> </script> <noscript> <img src="http://webkit.org/images/icon-gold.png"> </noscript> </head><body></body></html> The entification of the contents of <noscript> seems wrong, but the description in Comment #0 no longer seems to be happening.
This sounds much like bug 80170. Related Radar issues for Apple engineers: <rdar://problem/10972577>, <rdar://problem/10758026>. > The entification of the contents of <noscript> seems wrong I had a brief look at this a while ago. WebKit doesn't match HTML5, but the spec also seemed wrong in some respects. Anyway, we think that WebArchives are a special case, as they don't have to follow HTML serialization rules.
(In reply to comment #6) > This sounds much like bug 80170. > > Related Radar issues for Apple engineers: <rdar://problem/10972577>, <rdar://problem/10758026>. > > > The entification of the contents of <noscript> seems wrong > > I had a brief look at this a while ago. WebKit doesn't match HTML5, but the spec also seemed wrong in some respects. Anyway, we think that WebArchives are a special case, as they don't have to follow HTML serialization rules. In deed. I even have a patch locally that simply and effectively does the right entification of noscript elements when serializing to a WebArchive, but that resulted in more of our favorite "double content when loading the archive" bug, which is why we went with stripping out noscripts altogether.