LayoutTests:
authorddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Feb 2007 03:43:40 +0000 (03:43 +0000)
committerddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Feb 2007 03:43:40 +0000 (03:43 +0000)
        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=7266
        Webarchive format saves duplicate WebSubresources to .webarchive file

        * webarchive/test-duplicate-resources-expected.txt: Duplicate resources removed.
        * webarchive/test-frameset-expected.txt: Ditto.

WebKit:

        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=7266
        Webarchive format saves duplicate WebSubresources to .webarchive file

        Tests: webarchive/test-duplicate-resources.html
               webarchive/test-frameset.html

        * WebView/WebArchiver.mm:
        (+[WebArchiver _archiveWithMarkupString:fromFrame:nodes:]): Use an NSMutableSet to prevent
        duplicate subresources from being added to the webarchive.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19422 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/webarchive/test-duplicate-resources-expected.txt
LayoutTests/webarchive/test-frameset-expected.txt
WebKit/ChangeLog
WebKit/WebView/WebArchiver.mm

index 789022e..0dd5c82 100644 (file)
@@ -1,3 +1,13 @@
+2007-02-05  David Kilzer  <ddkilzer@webkit.org>
+
+        Reviewed by Darin.
+
+        http://bugs.webkit.org/show_bug.cgi?id=7266
+        Webarchive format saves duplicate WebSubresources to .webarchive file
+
+        * webarchive/test-duplicate-resources-expected.txt: Duplicate resources removed.
+        * webarchive/test-frameset-expected.txt: Ditto.
+
 2007-02-06  Mark Rowe  <mrowe@apple.com>
 
         Roll out incomplete support for font-stretch (r19350) at Dave Hyatt's request.
index 8f8b0fa..6e0df59 100644 (file)
                                        <key>WebResourceURL</key>
                                        <string>file:///LayoutTests/webarchive/resources/apple.gif</string>
                                </dict>
-                               <dict>
-                                       <key>WebResourceData</key>
-                                       <data>
-                                       R0lGODlhNABAAMQfAGJiYvLz9ImKitvb2/39
-                                       /cnJyaSkpOPj49TU1MHBwbW1terq7Lu7u/X1
-                                       9uXm5+3u7+fo6eDg4e/w8t7e3/n5+RcXF87O
-                                       z/f398fHx9fX16+vr9HR0fDw8Pj4+MzMzAAA
-                                       ACH5BAEAAB8ALAAAAAA0AEAAQAX/4CeOZGme
-                                       5iFUlYC+cCwKD7FAxxElAiTDnATAcCEYj8aA
-                                       BiBIDCIbjQCgqBEojUCjQSEEpoXTAUCQLB4P
-                                       iZoTaG/fjcuFgj1kBrnIZDLoDzIIgRsTAgYm
-                                       Bk8TEQ4OEGdpbBQLDAUQEA55e32AGxsWHh4F
-                                       BRgJCQgFAhQoCwIDlgsSFxyFOnt8foAInp+j
-                                       pQkMwArCGsQaCg0KBgEoDwAAHoHRgroW1aEY
-                                       pL7A28LDxcUGGgalhi8IAAgYoOvrn5/soL2l
-                                       wcThEBQAAz/7JxYAXVcCPNjggp/BEwIYOHNm
-                                       wMHBErMSEMgCR47FC3EwwnlzocOFBxMy3NHk
-                                       p88EBwU///gjcKCRo0cPOEhwM6fDgUGWMuHK
-                                       tQvUBgBhThhQ4CBCSwhoJDToQKxljlq4BPHC
-                                       No+bggXEXnwZMNMAupJ/ckm9RvUXg27dvqll
-                                       kEFADxMQAKirZs3Du1CiRpX1ZfasN3EGAlsY
-                                       IIADv3MCDnBowKEAQwSGSRzAMEVABIwTmCB4
-                                       yHkEQQMACQDY0LmzgAlXZF0ac6D0QwUJOAxA
-                                       kMArgAyuT3gQ5zYwBh8jBmhgoG9EBgYG3BbS
-                                       QHpfBAEKjHSYTt3jxQ4BH3DB2EaLnAYLIgC6
-                                       EyGuBhMDyDSI2X3jlu8Vay7480TPrU250p8n
-                                       0SrASzQxsTGTFu9hF4B45WESgf8e+EWzy0/N
-                                       lTBOeDk0AtNMcVAQQCcH5LTgLSJJ9c4ooQiw
-                                       jFAI7GGUhWkE0AFWv+GQB4N/6OJJPNnMY0EA
-                                       ACyAgmMSLIKUBBxQgEoGRX0IIk8j5hiMNwxQ
-                                       kBAKDAhgxgMdeCBXBGCJFGInvMhj1V/fJMCj
-                                       mSVEAEBcAFiQS4jS9HSNNk+mpZZaBmAwWgmZ
-                                       UeNJJ4DWJUqOdI6JZ2DjEHKiCRwEBg88BbCT
-                                       l15O+lUPoo3u94MCAERAijrx+NQHBuIo4EGN
-                                       gBRQigcRdAFAArl9EAAbBnWgRaylObCEiQQI
-                                       ECGu+2i5gBEaxgUcsDJk1sAVtp4xJbIy6Jkd
-                                       JhBAB63/DCstoOAGXhV3LQxeubWQZd/+kBBD
-                                       uF17AKcAaDDAAuEp1G4GDZiAgBRMYODAAgdY
-                                       YBsD+zjgFUAUVGedERf8NO49AQ2YkX85ZNDu
-                                       CyoUcEVGBlunEUVbuBHHdBwcMNtIfkwQFwYl
-                                       UMDDRA5v9B18FRUMHn22gBUWIZp+QEGeBKSh
-                                       Rnceu5cRHbLdodNO0aSngAlV2vCIBD4PSOB7
-                                       c0hidCb31TgNDyfEdcElLz3Cwdgt07HAHY0c
-                                       rbWN7iiQUgluN7DiK2eQ3cYcFwywQYcy0ggn
-                                       mLx48FNrQllQ1FGvxIQhBQ+o0wgmUIU1Fl7Y
-                                       bEBZByggskeFjiQVAAUQKFDJ/2p5REUNjlSx
-                                       1dYFmWOgh5BiazhcTlhvMpZedMIm2q8kuE1h
-                                       5zNRkMxJM97HJI65D7NBBz2ekNkDLZ0hQQeE
-                                       JZAkjbafPmdVdhKDQAMAEC5hAg8g9XlyeNRs
-                                       +o1kVeWXAncywDwD9ZKQmSMBLDAEl13ydCPu
-                                       3CPTnRKgPwP4aARVuoBjEBGW8fivSdkYE/zu
-                                       dCcPCMADvUOXNOIEJtQVCi0CxFN6HlCCKgFq
-                                       A4II1F0A6L46kQlRgRkDBk0ghV3Q5YYQxAah
-                                       tvGkb8DQgM94gWPuAoq6xCMvGKDUDl8YmOig
-                                       IwYyjNSjpriOQUXQUpfilwAc8gMhZCABc8Hh
-                                       NSJlgTkOgoIUZykG+UQTFIMohBEIKGN9BmCb
-                                       QgRmCq+awAIwgh0bvMo1C6hNZfJ0wBdMwG29
-                                       KQAJy/WtEAAAO1BvbG9udXMK
-                                       </data>
-                                       <key>WebResourceMIMEType</key>
-                                       <string>image/gif</string>
-                                       <key>WebResourceResponse</key>
-                                       <data>
-                                       YnBsaXN0MDDUAQIDBAUGBwpZJGFyY2hpdmVy
-                                       WCR2ZXJzaW9uVCR0b3BYJG9iamVjdHNfEA9O
-                                       U0tleWVkQXJjaGl2ZXISAAGGoNEICV8QE1dl
-                                       YlJlc291cmNlUmVzcG9uc2WAAaQLDBscVSRu
-                                       dWxs1w0ODxAREhMUFRYXGBkVUiQyUiQzUiQ0
-                                       UiQwViRjbGFzc1IkNVIkMYACgAARBcQQB4AD
-                                       I3/v////////gABZaW1hZ2UvZ2lm0h0eHyBY
-                                       JGNsYXNzZXNaJGNsYXNzbmFtZaIgIV1OU1VS
-                                       TFJlc3BvbnNlWE5TT2JqZWN0CBEbJCkyRElM
-                                       YmRpb36BhIeKkZSXmZueoKKrrbe8xdDT4QAA
-                                       AAAAAAEBAAAAAAAAACIAAAAAAAAAAAAAAAAA
-                                       AADq
-                                       </data>
-                                       <key>WebResourceURL</key>
-                                       <string>file:///LayoutTests/webarchive/resources/apple.gif</string>
-                               </dict>
                        </array>
                </dict>
        </array>
                </dict>
                <dict>
                        <key>WebResourceData</key>
-                       <string>if (window.layoutTestController)
-    layoutTestController.dumpAsWebArchive();
-</string>
-                       <key>WebResourceMIMEType</key>
-                       <string>application/x-javascript</string>
-                       <key>WebResourceResponse</key>
-                       <data>
-                       YnBsaXN0MDDUAQIDBAUGBwpZJGFyY2hpdmVyWCR2ZXJzaW9uVCR0
-                       b3BYJG9iamVjdHNfEA9OU0tleWVkQXJjaGl2ZXISAAGGoNEICV8Q
-                       E1dlYlJlc291cmNlUmVzcG9uc2WAAaQLDBscVSRudWxs1w0ODxAR
-                       EhMUFRYXGBkVUiQyUiQzUiQ0UiQwViRjbGFzc1IkNVIkMYACgAAQ
-                       ThAHgAMjf+////////+AAF8QGGFwcGxpY2F0aW9uL3gtamF2YXNj
-                       cmlwdNIdHh8gWCRjbGFzc2VzWiRjbGFzc25hbWWiICFdTlNVUkxS
-                       ZXNwb25zZVhOU09iamVjdAgRGyQpMkRJTGJkaW9+gYSHipGUl5mb
-                       nZ+hqqzHzNXg4/EAAAAAAAABAQAAAAAAAAAiAAAAAAAAAAAAAAAA
-                       AAAA+g==
-                       </data>
-                       <key>WebResourceURL</key>
-                       <string>file:///LayoutTests/webarchive/resources/dump-webarchive.js</string>
-               </dict>
-               <dict>
-                       <key>WebResourceData</key>
-                       <string>div { font-family: Arial, Helvetica, sans-serif; color: red; }
-</string>
-                       <key>WebResourceMIMEType</key>
-                       <string>text/css</string>
-                       <key>WebResourceResponse</key>
-                       <data>
-                       YnBsaXN0MDDUAQIDBAUGBwpZJGFyY2hpdmVyWCR2ZXJzaW9uVCR0
-                       b3BYJG9iamVjdHNfEA9OU0tleWVkQXJjaGl2ZXISAAGGoNEICV8Q
-                       E1dlYlJlc291cmNlUmVzcG9uc2WAAaQLDBscVSRudWxs1w0ODxAR
-                       EhMUFRYXGBkVUiQyUiQzUiQ0UiQwViRjbGFzc1IkNVIkMYACgAAQ
-                       PxAHgAMjf+////////+AAFh0ZXh0L2Nzc9IdHh8gWCRjbGFzc2Vz
-                       WiRjbGFzc25hbWWiICFdTlNVUkxSZXNwb25zZVhOU09iamVjdAgR
-                       GyQpMkRJTGJkaW9+gYSHipGUl5mbnZ+hqqy1usPO0d8AAAAAAAAB
-                       AQAAAAAAAAAiAAAAAAAAAAAAAAAAAAAA6A==
-                       </data>
-                       <key>WebResourceURL</key>
-                       <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
-               </dict>
-               <dict>
-                       <key>WebResourceData</key>
-                       <data>
-                       R0lGODlhNABAAMQfAGJiYvLz9ImKitvb2/39/cnJyaSkpOPj49TU
-                       1MHBwbW1terq7Lu7u/X19uXm5+3u7+fo6eDg4e/w8t7e3/n5+RcX
-                       F87Oz/f398fHx9fX16+vr9HR0fDw8Pj4+MzMzAAAACH5BAEAAB8A
-                       LAAAAAA0AEAAQAX/4CeOZGme5iFUlYC+cCwKD7FAxxElAiTDnATA
-                       cCEYj8aABiBIDCIbjQCgqBEojUCjQSEEpoXTAUCQLB4PiZoTaG/f
-                       jcuFgj1kBrnIZDLoDzIIgRsTAgYmBk8TEQ4OEGdpbBQLDAUQEA55
-                       e32AGxsWHh4FBRgJCQgFAhQoCwIDlgsSFxyFOnt8foAInp+jpQkM
-                       wArCGsQaCg0KBgEoDwAAHoHRgroW1aEYpL7A28LDxcUGGgalhi8I
-                       AAgYoOvrn5/soL2lwcThEBQAAz/7JxYAXVcCPNjggp/BEwIYOHNm
-                       wMHBErMSEMgCR47FC3EwwnlzocOFBxMy3NHkp88EBwU///gjcKCR
-                       o0cPOEhwM6fDgUGWMuHKtQvUBgBhThhQ4CBCSwhoJDToQKxljlq4
-                       BPHCNo+bggXEXnwZMNMAupJ/ckm9RvUXg27dvqllkEFADxMQAKir
-                       Zs3Du1CiRpX1ZfasN3EGAlsYIIADv3MCDnBowKEAQwSGSRzAMEVA
-                       BIwTmCB4yHkEQQMACQDY0LmzgAlXZF0ac6D0QwUJOAxAkMArgAyu
-                       T3gQ5zYwBh8jBmhgoG9EBgYG3BbSQHpfBAEKjHSYTt3jxQ4BH3DB
-                       2EaLnAYLIgC6EyGuBhMDyDSI2X3jlu8Vay7480TPrU250p8n0SrA
-                       SzQxsTGTFu9hF4B45WESgf8e+EWzy0/NlTBOeDk0AtNMcVAQQCcH
-                       5LTgLSJJ9c4ooQiwjFAI7GGUhWkE0AFWv+GQB4N/6OJJPNnMY0EA
-                       ACyAgmMSLIKUBBxQgEoGRX0IIk8j5hiMNwxQkBAKDAhgxgMdeCBX
-                       BGCJFGInvMhj1V/fJMCjmSVEAEBcAFiQS4jS9HSNNk+mpZZaBmAw
-                       WgmZUeNJJ4DWJUqOdI6JZ2DjEHKiCRwEBg88BbCTl15O+lUPoo3u
-                       94MCAERAijrx+NQHBuIo4EGNgBRQigcRdAFAArl9EAAbBnWgRayl
-                       ObCEiQQIECGu+2i5gBEaxgUcsDJk1sAVtp4xJbIy6JkdJhBAB63/
-                       DCstoOAGXhV3LQxeubWQZd/+kBBDuF17AKcAaDDAAuEp1G4GDZiA
-                       gBRMYODAAgdYYBsD+zjgFUAUVGedERf8NO49AQ2YkX85ZNDuCyoU
-                       cEVGBlunEUVbuBHHdBwcMNtIfkwQFwYlUMDDRA5v9B18FRUMHn22
-                       gBUWIZp+QEGeBKShRnceu5cRHbLdodNO0aSngAlV2vCIBD4PSOB7
-                       c0hidCb31TgNDyfEdcElLz3Cwdgt07HAHY0crbWN7iiQUgluN7Di
-                       K2eQ3cYcFwywQYcy0ggnmLx48FNrQllQ1FGvxIQhBQ+o0wgmUIU1
-                       Fl7YbEBZByggskeFjiQVAAUQKFDJ/2p5REUNjlSx1dYFmWOgh5Bi
-                       azhcTlhvMpZedMIm2q8kuE1h5zNRkMxJM97HJI65D7NBBz2ekNkD
-                       LZ0hQQeEJZAkjbafPmdVdhKDQAMAEC5hAg8g9XlyeNRs+o1kVeWX
-                       AncywDwD9ZKQmSMBLDAEl13ydCPu3CPTnRKgPwP4aARVuoBjEBGW
-                       8fivSdkYE/zudCcPCMADvUOXNOIEJtQVCi0CxFN6HlCCKgFqA4II
-                       1F0A6L46kQlRgRkDBk0ghV3Q5YYQxAahtvGkb8DQgM94gWPuAoq6
-                       xCMvGKDUDl8YmOigIwYyjNSjpriOQUXQUpfilwAc8gMhZCABc8Hh
-                       NSJlgTkOgoIUZykG+UQTFIMohBEIKGN9BmCbQgRmCq+awAIwgh0b
-                       vMo1C6hNZfJ0wBdMwG29KQAJy/WtEAAAO1BvbG9udXMK
-                       </data>
-                       <key>WebResourceMIMEType</key>
-                       <string>image/gif</string>
-                       <key>WebResourceResponse</key>
-                       <data>
-                       YnBsaXN0MDDUAQIDBAUGBwpZJGFyY2hpdmVyWCR2ZXJzaW9uVCR0
-                       b3BYJG9iamVjdHNfEA9OU0tleWVkQXJjaGl2ZXISAAGGoNEICV8Q
-                       E1dlYlJlc291cmNlUmVzcG9uc2WAAaQLDBscVSRudWxs1w0ODxAR
-                       EhMUFRYXGBkVUiQyUiQzUiQ0UiQwViRjbGFzc1IkNVIkMYACgAAR
-                       BcQQB4ADI3/v////////gABZaW1hZ2UvZ2lm0h0eHyBYJGNsYXNz
-                       ZXNaJGNsYXNzbmFtZaIgIV1OU1VSTFJlc3BvbnNlWE5TT2JqZWN0
-                       CBEbJCkyRElMYmRpb36BhIeKkZSXmZueoKKrrbe8xdDT4QAAAAAA
-                       AAEBAAAAAAAAACIAAAAAAAAAAAAAAAAAAADq
-                       </data>
-                       <key>WebResourceURL</key>
-                       <string>file:///LayoutTests/webarchive/resources/apple.gif</string>
-               </dict>
-               <dict>
-                       <key>WebResourceData</key>
                        <data>
                        R0lGODlhNABAAMQfAGJiYvLz9ImKitvb2/39/cnJyaSkpOPj49TU
                        1MHBwbW1terq7Lu7u/X19uXm5+3u7+fo6eDg4e/w8t7e3/n5+RcX
index cf26721..627dee9 100644 (file)
                                        <key>WebResourceURL</key>
                                        <string>file:///LayoutTests/webarchive/resources/apple.gif</string>
                                </dict>
-                               <dict>
-                                       <key>WebResourceData</key>
-                                       <data>
-                                       R0lGODlhNABAAMQfAGJiYvLz9ImKitvb2/39
-                                       /cnJyaSkpOPj49TU1MHBwbW1terq7Lu7u/X1
-                                       9uXm5+3u7+fo6eDg4e/w8t7e3/n5+RcXF87O
-                                       z/f398fHx9fX16+vr9HR0fDw8Pj4+MzMzAAA
-                                       ACH5BAEAAB8ALAAAAAA0AEAAQAX/4CeOZGme
-                                       5iFUlYC+cCwKD7FAxxElAiTDnATAcCEYj8aA
-                                       BiBIDCIbjQCgqBEojUCjQSEEpoXTAUCQLB4P
-                                       iZoTaG/fjcuFgj1kBrnIZDLoDzIIgRsTAgYm
-                                       Bk8TEQ4OEGdpbBQLDAUQEA55e32AGxsWHh4F
-                                       BRgJCQgFAhQoCwIDlgsSFxyFOnt8foAInp+j
-                                       pQkMwArCGsQaCg0KBgEoDwAAHoHRgroW1aEY
-                                       pL7A28LDxcUGGgalhi8IAAgYoOvrn5/soL2l
-                                       wcThEBQAAz/7JxYAXVcCPNjggp/BEwIYOHNm
-                                       wMHBErMSEMgCR47FC3EwwnlzocOFBxMy3NHk
-                                       p88EBwU///gjcKCRo0cPOEhwM6fDgUGWMuHK
-                                       tQvUBgBhThhQ4CBCSwhoJDToQKxljlq4BPHC
-                                       No+bggXEXnwZMNMAupJ/ckm9RvUXg27dvqll
-                                       kEFADxMQAKirZs3Du1CiRpX1ZfasN3EGAlsY
-                                       IIADv3MCDnBowKEAQwSGSRzAMEVABIwTmCB4
-                                       yHkEQQMACQDY0LmzgAlXZF0ac6D0QwUJOAxA
-                                       kMArgAyuT3gQ5zYwBh8jBmhgoG9EBgYG3BbS
-                                       QHpfBAEKjHSYTt3jxQ4BH3DB2EaLnAYLIgC6
-                                       EyGuBhMDyDSI2X3jlu8Vay7480TPrU250p8n
-                                       0SrASzQxsTGTFu9hF4B45WESgf8e+EWzy0/N
-                                       lTBOeDk0AtNMcVAQQCcH5LTgLSJJ9c4ooQiw
-                                       jFAI7GGUhWkE0AFWv+GQB4N/6OJJPNnMY0EA
-                                       ACyAgmMSLIKUBBxQgEoGRX0IIk8j5hiMNwxQ
-                                       kBAKDAhgxgMdeCBXBGCJFGInvMhj1V/fJMCj
-                                       mSVEAEBcAFiQS4jS9HSNNk+mpZZaBmAwWgmZ
-                                       UeNJJ4DWJUqOdI6JZ2DjEHKiCRwEBg88BbCT
-                                       l15O+lUPoo3u94MCAERAijrx+NQHBuIo4EGN
-                                       gBRQigcRdAFAArl9EAAbBnWgRaylObCEiQQI
-                                       ECGu+2i5gBEaxgUcsDJk1sAVtp4xJbIy6Jkd
-                                       JhBAB63/DCstoOAGXhV3LQxeubWQZd/+kBBD
-                                       uF17AKcAaDDAAuEp1G4GDZiAgBRMYODAAgdY
-                                       YBsD+zjgFUAUVGedERf8NO49AQ2YkX85ZNDu
-                                       CyoUcEVGBlunEUVbuBHHdBwcMNtIfkwQFwYl
-                                       UMDDRA5v9B18FRUMHn22gBUWIZp+QEGeBKSh
-                                       Rnceu5cRHbLdodNO0aSngAlV2vCIBD4PSOB7
-                                       c0hidCb31TgNDyfEdcElLz3Cwdgt07HAHY0c
-                                       rbWN7iiQUgluN7DiK2eQ3cYcFwywQYcy0ggn
-                                       mLx48FNrQllQ1FGvxIQhBQ+o0wgmUIU1Fl7Y
-                                       bEBZByggskeFjiQVAAUQKFDJ/2p5REUNjlSx
-                                       1dYFmWOgh5BiazhcTlhvMpZedMIm2q8kuE1h
-                                       5zNRkMxJM97HJI65D7NBBz2ekNkDLZ0hQQeE
-                                       JZAkjbafPmdVdhKDQAMAEC5hAg8g9XlyeNRs
-                                       +o1kVeWXAncywDwD9ZKQmSMBLDAEl13ydCPu
-                                       3CPTnRKgPwP4aARVuoBjEBGW8fivSdkYE/zu
-                                       dCcPCMADvUOXNOIEJtQVCi0CxFN6HlCCKgFq
-                                       A4II1F0A6L46kQlRgRkDBk0ghV3Q5YYQxAah
-                                       tvGkb8DQgM94gWPuAoq6xCMvGKDUDl8YmOig
-                                       IwYyjNSjpriOQUXQUpfilwAc8gMhZCABc8Hh
-                                       NSJlgTkOgoIUZykG+UQTFIMohBEIKGN9BmCb
-                                       QgRmCq+awAIwgh0bvMo1C6hNZfJ0wBdMwG29
-                                       KQAJy/WtEAAAO1BvbG9udXMK
-                                       </data>
-                                       <key>WebResourceMIMEType</key>
-                                       <string>image/gif</string>
-                                       <key>WebResourceResponse</key>
-                                       <data>
-                                       YnBsaXN0MDDUAQIDBAUGBwpZJGFyY2hpdmVy
-                                       WCR2ZXJzaW9uVCR0b3BYJG9iamVjdHNfEA9O
-                                       U0tleWVkQXJjaGl2ZXISAAGGoNEICV8QE1dl
-                                       YlJlc291cmNlUmVzcG9uc2WAAaQLDBscVSRu
-                                       dWxs1w0ODxAREhMUFRYXGBkVUiQyUiQzUiQ0
-                                       UiQwViRjbGFzc1IkNVIkMYACgAARBcQQB4AD
-                                       I3/v////////gABZaW1hZ2UvZ2lm0h0eHyBY
-                                       JGNsYXNzZXNaJGNsYXNzbmFtZaIgIV1OU1VS
-                                       TFJlc3BvbnNlWE5TT2JqZWN0CBEbJCkyRElM
-                                       YmRpb36BhIeKkZSXmZueoKKrrbe8xdDT4QAA
-                                       AAAAAAEBAAAAAAAAACIAAAAAAAAAAAAAAAAA
-                                       AADq
-                                       </data>
-                                       <key>WebResourceURL</key>
-                                       <string>file:///LayoutTests/webarchive/resources/apple.gif</string>
-                               </dict>
                        </array>
                </dict>
        </array>
index 7f4067e..c72e3d0 100644 (file)
@@ -1,3 +1,17 @@
+2007-02-05  David Kilzer  <ddkilzer@webkit.org>
+
+        Reviewed by Darin.
+
+        http://bugs.webkit.org/show_bug.cgi?id=7266
+        Webarchive format saves duplicate WebSubresources to .webarchive file
+
+        Tests: webarchive/test-duplicate-resources.html
+               webarchive/test-frameset.html
+
+        * WebView/WebArchiver.mm:
+        (+[WebArchiver _archiveWithMarkupString:fromFrame:nodes:]): Use an NSMutableSet to prevent
+        duplicate subresources from being added to the webarchive.
+
 2007-02-06  Mark Rowe  <mrowe@apple.com>
 
         Roll out incomplete support for font-stretch (r19350) at Dave Hyatt's request.
index 599a93c..983780f 100644 (file)
@@ -89,6 +89,7 @@ using namespace WebCore;
     
     NSMutableArray *subframeArchives = [[NSMutableArray alloc] init];
     NSMutableArray *subresources = [[NSMutableArray alloc] init];
+    NSMutableSet *uniqueSubresources = [[NSMutableSet alloc] init];
     NSEnumerator *enumerator = [nodes objectEnumerator];
     DOMNode *node;
     while ((node = [enumerator nextObject]) != nil) {
@@ -102,6 +103,9 @@ using namespace WebCore;
             NSEnumerator *enumerator = [[node _subresourceURLs] objectEnumerator];
             NSURL *URL;
             while ((URL = [enumerator nextObject]) != nil) {
+                if ([uniqueSubresources containsObject:URL])
+                    continue;
+                [uniqueSubresources addObject:URL];
                 WebResource *subresource = [[frame dataSource] subresourceForURL:URL];
                 if (subresource)
                     [subresources addObject:subresource];
@@ -114,6 +118,7 @@ using namespace WebCore;
     
     WebArchive *archive = [[[WebArchive alloc] initWithMainResource:mainResource subresources:subresources subframeArchives:subframeArchives] autorelease];
     [mainResource release];
+    [uniqueSubresources release];
     [subresources release];
     [subframeArchives release];