LayoutTests:
authorddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jan 2007 03:31:04 +0000 (03:31 +0000)
committerddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jan 2007 03:31:04 +0000 (03:31 +0000)
        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=11882
        Need a way to regression test .webarchive output files

        Created webarchive tests that exercise various features of the WebArchive format.

        * webarchive/resources/apple.gif: Copied from fast/canvas/resources/apple.gif.
        * webarchive/resources/dump-webarchive.js: Added.
        * webarchive/resources/test-frame.html: Added.
        * webarchive/resources/test-style.css: Added.
        * webarchive/test-body-background-expected.txt: Added.
        * webarchive/test-body-background.html: Added.
        * webarchive/test-duplicate-resources-expected.txt: Added.
        * webarchive/test-duplicate-resources.html: Added.
        * webarchive/test-frameset-expected.txt: Added.
        * webarchive/test-frameset.html: Added.
        * webarchive/test-img-src-expected.txt: Added.
        * webarchive/test-img-src.html: Added.
        * webarchive/test-input-src-expected.txt: Added.
        * webarchive/test-input-src.html: Added.
        * webarchive/test-link-href-expected.txt: Added.
        * webarchive/test-link-href.html: Added.
        * webarchive/test-object-data-expected.txt: Added.
        * webarchive/test-object-data.html: Added.
        * webarchive/test-script-src-expected.txt: Added.
        * webarchive/test-script-src.html: Added.
        * webarchive/test-table-background-expected.txt: Added.
        * webarchive/test-table-background.html: Added.
        * webarchive/test-td-background-expected.txt: Added.
        * webarchive/test-td-background.html: Added.

WebKitTools:

        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=11882
        Need a way to regression test .webarchive output files

        Implement layoutTestController.dumpAsWebArchive() to test WebArchive format.
        Alters WebResourceResponse and WebResourceURL properties within WebArchive format
        to normalize URLs to remove path where WebKit was checked out.  Also converts
        WebDataResource properties from data to string if the corresponding
        WebResourceMIMEType property starts with "text/" or equals
        "application/x-javascript".

        * DumpRenderTree/DumpRenderTree.m:
        (convertWebResourceDataToString): Added.
        (normalizeWebResourceURL): Added.
        (normalizeWebResourceResponse): Added.
        (serializeWebArchiveToXML): Added.
        (dump):
        (+[LayoutTestController isSelectorExcludedFromWebScript:]):
        (-[LayoutTestController dumpAsWebArchive]): Added.
        (runTest):

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

27 files changed:
LayoutTests/ChangeLog
LayoutTests/webarchive/resources/apple.gif [new file with mode: 0644]
LayoutTests/webarchive/resources/dump-webarchive.js [new file with mode: 0644]
LayoutTests/webarchive/resources/test-frame.html [new file with mode: 0644]
LayoutTests/webarchive/resources/test-style.css [new file with mode: 0644]
LayoutTests/webarchive/test-body-background-expected.txt [new file with mode: 0644]
LayoutTests/webarchive/test-body-background.html [new file with mode: 0644]
LayoutTests/webarchive/test-duplicate-resources-expected.txt [new file with mode: 0644]
LayoutTests/webarchive/test-duplicate-resources.html [new file with mode: 0644]
LayoutTests/webarchive/test-frameset-expected.txt [new file with mode: 0644]
LayoutTests/webarchive/test-frameset.html [new file with mode: 0644]
LayoutTests/webarchive/test-img-src-expected.txt [new file with mode: 0644]
LayoutTests/webarchive/test-img-src.html [new file with mode: 0644]
LayoutTests/webarchive/test-input-src-expected.txt [new file with mode: 0644]
LayoutTests/webarchive/test-input-src.html [new file with mode: 0644]
LayoutTests/webarchive/test-link-href-expected.txt [new file with mode: 0644]
LayoutTests/webarchive/test-link-href.html [new file with mode: 0644]
LayoutTests/webarchive/test-object-data-expected.txt [new file with mode: 0644]
LayoutTests/webarchive/test-object-data.html [new file with mode: 0644]
LayoutTests/webarchive/test-script-src-expected.txt [new file with mode: 0644]
LayoutTests/webarchive/test-script-src.html [new file with mode: 0644]
LayoutTests/webarchive/test-table-background-expected.txt [new file with mode: 0644]
LayoutTests/webarchive/test-table-background.html [new file with mode: 0644]
LayoutTests/webarchive/test-td-background-expected.txt [new file with mode: 0644]
LayoutTests/webarchive/test-td-background.html [new file with mode: 0644]
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.m

index 1fea452..f86f413 100644 (file)
@@ -1,3 +1,37 @@
+2007-01-30  David Kilzer  <ddkilzer@webkit.org>
+
+        Reviewed by Darin.
+
+        http://bugs.webkit.org/show_bug.cgi?id=11882
+        Need a way to regression test .webarchive output files
+
+        Created webarchive tests that exercise various features of the WebArchive format.
+
+        * webarchive/resources/apple.gif: Copied from fast/canvas/resources/apple.gif.
+        * webarchive/resources/dump-webarchive.js: Added.
+        * webarchive/resources/test-frame.html: Added.
+        * webarchive/resources/test-style.css: Added.
+        * webarchive/test-body-background-expected.txt: Added.
+        * webarchive/test-body-background.html: Added.
+        * webarchive/test-duplicate-resources-expected.txt: Added.
+        * webarchive/test-duplicate-resources.html: Added.
+        * webarchive/test-frameset-expected.txt: Added.
+        * webarchive/test-frameset.html: Added.
+        * webarchive/test-img-src-expected.txt: Added.
+        * webarchive/test-img-src.html: Added.
+        * webarchive/test-input-src-expected.txt: Added.
+        * webarchive/test-input-src.html: Added.
+        * webarchive/test-link-href-expected.txt: Added.
+        * webarchive/test-link-href.html: Added.
+        * webarchive/test-object-data-expected.txt: Added.
+        * webarchive/test-object-data.html: Added.
+        * webarchive/test-script-src-expected.txt: Added.
+        * webarchive/test-script-src.html: Added.
+        * webarchive/test-table-background-expected.txt: Added.
+        * webarchive/test-table-background.html: Added.
+        * webarchive/test-td-background-expected.txt: Added.
+        * webarchive/test-td-background.html: Added.
+
 2007-01-30  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Geoff.
diff --git a/LayoutTests/webarchive/resources/apple.gif b/LayoutTests/webarchive/resources/apple.gif
new file mode 100644 (file)
index 0000000..55844c8
Binary files /dev/null and b/LayoutTests/webarchive/resources/apple.gif differ
diff --git a/LayoutTests/webarchive/resources/dump-webarchive.js b/LayoutTests/webarchive/resources/dump-webarchive.js
new file mode 100644 (file)
index 0000000..e7379ce
--- /dev/null
@@ -0,0 +1,2 @@
+if (window.layoutTestController)
+    layoutTestController.dumpAsWebArchive();
diff --git a/LayoutTests/webarchive/resources/test-frame.html b/LayoutTests/webarchive/resources/test-frame.html
new file mode 100644 (file)
index 0000000..3d8b660
--- /dev/null
@@ -0,0 +1,16 @@
+<html>
+<head>
+<link rel="stylesheet" href="test-style.css" type="text/css">
+</head>
+<body>
+<div>
+  <img src="apple.gif">
+</div>
+<div>
+  This is a subframe.  This text should be red sans-serif.
+</div>
+<div>
+  <img src="apple.gif">
+</div>
+</body>
+</html>
diff --git a/LayoutTests/webarchive/resources/test-style.css b/LayoutTests/webarchive/resources/test-style.css
new file mode 100644 (file)
index 0000000..6a5dab8
--- /dev/null
@@ -0,0 +1 @@
+div { font-family: Arial, Helvetica, sans-serif; color: red; }
diff --git a/LayoutTests/webarchive/test-body-background-expected.txt b/LayoutTests/webarchive/test-body-background-expected.txt
new file mode 100644 (file)
index 0000000..1005fdd
--- /dev/null
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>WebMainResource</key>
+       <dict>
+               <key>WebResourceData</key>
+               <string>&lt;html&gt;&lt;head&gt;
+&lt;script&gt;
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+&lt;/script&gt;
+&lt;/head&gt;&lt;body background="resources/apple.gif"&gt;
+
+
+&lt;/body&gt;&lt;/html&gt;</string>
+               <key>WebResourceFrameName</key>
+               <string></string>
+               <key>WebResourceMIMEType</key>
+               <string>text/html</string>
+               <key>WebResourceTextEncodingName</key>
+               <string>UTF-8</string>
+               <key>WebResourceURL</key>
+               <string>file:///LayoutTests/webarchive/test-body-background.html</string>
+       </dict>
+       <key>WebSubresources</key>
+       <array>
+               <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>
+       </array>
+</dict>
+</plist>
diff --git a/LayoutTests/webarchive/test-body-background.html b/LayoutTests/webarchive/test-body-background.html
new file mode 100644 (file)
index 0000000..1307275
--- /dev/null
@@ -0,0 +1,10 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+</script>
+</head>
+<body background="resources/apple.gif">
+</body>
+</html>
diff --git a/LayoutTests/webarchive/test-duplicate-resources-expected.txt b/LayoutTests/webarchive/test-duplicate-resources-expected.txt
new file mode 100644 (file)
index 0000000..8f8b0fa
--- /dev/null
@@ -0,0 +1,457 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>WebMainResource</key>
+       <dict>
+               <key>WebResourceData</key>
+               <string>&lt;html&gt;&lt;head&gt;
+&lt;script src="resources/dump-webarchive.js" language="javascript" type="text/javascript"&gt;&lt;/script&gt;
+&lt;link rel="stylesheet" href="resources/test-style.css" type="text/css"&gt;
+&lt;script src="resources/dump-webarchive.js" language="javascript" type="text/javascript"&gt;&lt;/script&gt;
+&lt;link rel="stylesheet" href="resources/test-style.css" type="text/css"&gt;
+&lt;/head&gt;&lt;body&gt;
+&lt;div&gt;
+  &lt;img src="resources/apple.gif"&gt;
+&lt;/div&gt;
+&lt;div&gt;
+  This is not a frameset.  This text should be red sans-serif.
+&lt;/div&gt;
+&lt;div&gt;
+  &lt;img src="resources/apple.gif"&gt;
+&lt;/div&gt;
+&lt;iframe src="resources/test-frame.html"&gt;&lt;/iframe&gt;
+
+
+&lt;/body&gt;&lt;/html&gt;</string>
+               <key>WebResourceFrameName</key>
+               <string></string>
+               <key>WebResourceMIMEType</key>
+               <string>text/html</string>
+               <key>WebResourceTextEncodingName</key>
+               <string>UTF-8</string>
+               <key>WebResourceURL</key>
+               <string>file:///LayoutTests/webarchive/test-duplicate-resources.html</string>
+       </dict>
+       <key>WebSubframeArchives</key>
+       <array>
+               <dict>
+                       <key>WebMainResource</key>
+                       <dict>
+                               <key>WebResourceData</key>
+                               <string>&lt;html&gt;&lt;head&gt;
+&lt;link rel="stylesheet" href="test-style.css" type="text/css"&gt;
+&lt;/head&gt;&lt;body&gt;
+&lt;div&gt;
+  &lt;img src="apple.gif"&gt;
+&lt;/div&gt;
+&lt;div&gt;
+  This is a subframe.  This text should be red sans-serif.
+&lt;/div&gt;
+&lt;div&gt;
+  &lt;img src="apple.gif"&gt;
+&lt;/div&gt;
+
+
+&lt;/body&gt;&lt;/html&gt;</string>
+                               <key>WebResourceFrameName</key>
+                               <string>&lt;!--framePath //&lt;!--frame0--&gt;--&gt;</string>
+                               <key>WebResourceMIMEType</key>
+                               <string>text/html</string>
+                               <key>WebResourceTextEncodingName</key>
+                               <string>UTF-8</string>
+                               <key>WebResourceURL</key>
+                               <string>file:///LayoutTests/webarchive/resources/test-frame.html</string>
+                       </dict>
+                       <key>WebSubresources</key>
+                       <array>
+                               <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>
+                                       YnBsaXN0MDDUAQIDBAUGBwpZJGFyY2hpdmVy
+                                       WCR2ZXJzaW9uVCR0b3BYJG9iamVjdHNfEA9O
+                                       U0tleWVkQXJjaGl2ZXISAAGGoNEICV8QE1dl
+                                       YlJlc291cmNlUmVzcG9uc2WAAaQLDBscVSRu
+                                       dWxs1w0ODxAREhMUFRYXGBkVUiQyUiQzUiQ0
+                                       UiQwViRjbGFzc1IkNVIkMYACgAAQPxAHgAMj
+                                       f+////////+AAFh0ZXh0L2Nzc9IdHh8gWCRj
+                                       bGFzc2VzWiRjbGFzc25hbWWiICFdTlNVUkxS
+                                       ZXNwb25zZVhOU09iamVjdAgRGyQpMkRJTGJk
+                                       aW9+gYSHipGUl5mbnZ+hqqy1usPO0d8AAAAA
+                                       AAABAQAAAAAAAAAiAAAAAAAAAAAAAAAAAAAA
+                                       6A==
+                                       </data>
+                                       <key>WebResourceURL</key>
+                                       <string>file:///LayoutTests/webarchive/resources/test-style.css</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>
+                               <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>
+       <key>WebSubresources</key>
+       <array>
+               <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>
+                       <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
+                       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>
+       </array>
+</dict>
+</plist>
diff --git a/LayoutTests/webarchive/test-duplicate-resources.html b/LayoutTests/webarchive/test-duplicate-resources.html
new file mode 100644 (file)
index 0000000..e4cb802
--- /dev/null
@@ -0,0 +1,20 @@
+<html>
+<head>
+<script src="resources/dump-webarchive.js" language="javascript" type="text/javascript"></script>
+<link rel="stylesheet" href="resources/test-style.css" type="text/css">
+<script src="resources/dump-webarchive.js" language="javascript" type="text/javascript"></script>
+<link rel="stylesheet" href="resources/test-style.css" type="text/css">
+</head>
+<body>
+<div>
+  <img src="resources/apple.gif">
+</div>
+<div>
+  This is not a frameset.  This text should be red sans-serif.
+</div>
+<div>
+  <img src="resources/apple.gif">
+</div>
+<iframe src="resources/test-frame.html"></iframe>
+</body>
+</html>
diff --git a/LayoutTests/webarchive/test-frameset-expected.txt b/LayoutTests/webarchive/test-frameset-expected.txt
new file mode 100644 (file)
index 0000000..cf26721
--- /dev/null
@@ -0,0 +1,241 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>WebMainResource</key>
+       <dict>
+               <key>WebResourceData</key>
+               <string>&lt;html&gt;&lt;head&gt;
+&lt;script&gt;
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+&lt;/script&gt;
+&lt;/head&gt;&lt;frameset rows="*"&gt;&lt;frame src="resources/test-frame.html" name="myframe"&gt;&lt;/frameset&gt;&lt;/html&gt;</string>
+               <key>WebResourceFrameName</key>
+               <string></string>
+               <key>WebResourceMIMEType</key>
+               <string>text/html</string>
+               <key>WebResourceTextEncodingName</key>
+               <string>UTF-8</string>
+               <key>WebResourceURL</key>
+               <string>file:///LayoutTests/webarchive/test-frameset.html</string>
+       </dict>
+       <key>WebSubframeArchives</key>
+       <array>
+               <dict>
+                       <key>WebMainResource</key>
+                       <dict>
+                               <key>WebResourceData</key>
+                               <string>&lt;html&gt;&lt;head&gt;
+&lt;link rel="stylesheet" href="test-style.css" type="text/css"&gt;
+&lt;/head&gt;&lt;body&gt;
+&lt;div&gt;
+  &lt;img src="apple.gif"&gt;
+&lt;/div&gt;
+&lt;div&gt;
+  This is a subframe.  This text should be red sans-serif.
+&lt;/div&gt;
+&lt;div&gt;
+  &lt;img src="apple.gif"&gt;
+&lt;/div&gt;
+
+
+&lt;/body&gt;&lt;/html&gt;</string>
+                               <key>WebResourceFrameName</key>
+                               <string>myframe</string>
+                               <key>WebResourceMIMEType</key>
+                               <string>text/html</string>
+                               <key>WebResourceTextEncodingName</key>
+                               <string>UTF-8</string>
+                               <key>WebResourceURL</key>
+                               <string>file:///LayoutTests/webarchive/resources/test-frame.html</string>
+                       </dict>
+                       <key>WebSubresources</key>
+                       <array>
+                               <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>
+                                       YnBsaXN0MDDUAQIDBAUGBwpZJGFyY2hpdmVy
+                                       WCR2ZXJzaW9uVCR0b3BYJG9iamVjdHNfEA9O
+                                       U0tleWVkQXJjaGl2ZXISAAGGoNEICV8QE1dl
+                                       YlJlc291cmNlUmVzcG9uc2WAAaQLDBscVSRu
+                                       dWxs1w0ODxAREhMUFRYXGBkVUiQyUiQzUiQ0
+                                       UiQwViRjbGFzc1IkNVIkMYACgAAQPxAHgAMj
+                                       f+////////+AAFh0ZXh0L2Nzc9IdHh8gWCRj
+                                       bGFzc2VzWiRjbGFzc25hbWWiICFdTlNVUkxS
+                                       ZXNwb25zZVhOU09iamVjdAgRGyQpMkRJTGJk
+                                       aW9+gYSHipGUl5mbnZ+hqqy1usPO0d8AAAAA
+                                       AAABAQAAAAAAAAAiAAAAAAAAAAAAAAAAAAAA
+                                       6A==
+                                       </data>
+                                       <key>WebResourceURL</key>
+                                       <string>file:///LayoutTests/webarchive/resources/test-style.css</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>
+                               <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>
+</plist>
diff --git a/LayoutTests/webarchive/test-frameset.html b/LayoutTests/webarchive/test-frameset.html
new file mode 100644 (file)
index 0000000..a0d5d53
--- /dev/null
@@ -0,0 +1,11 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+</script>
+</head>
+<frameset rows="*">
+  <frame src="resources/test-frame.html" name="myframe">
+</frameset>
+</html>
diff --git a/LayoutTests/webarchive/test-img-src-expected.txt b/LayoutTests/webarchive/test-img-src-expected.txt
new file mode 100644 (file)
index 0000000..aa8f4ba
--- /dev/null
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>WebMainResource</key>
+       <dict>
+               <key>WebResourceData</key>
+               <string>&lt;html&gt;&lt;head&gt;
+&lt;script&gt;
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+&lt;/script&gt;
+&lt;/head&gt;&lt;body&gt;
+  &lt;img src="resources/apple.gif"&gt;
+
+
+&lt;/body&gt;&lt;/html&gt;</string>
+               <key>WebResourceFrameName</key>
+               <string></string>
+               <key>WebResourceMIMEType</key>
+               <string>text/html</string>
+               <key>WebResourceTextEncodingName</key>
+               <string>UTF-8</string>
+               <key>WebResourceURL</key>
+               <string>file:///LayoutTests/webarchive/test-img-src.html</string>
+       </dict>
+       <key>WebSubresources</key>
+       <array>
+               <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>
+       </array>
+</dict>
+</plist>
diff --git a/LayoutTests/webarchive/test-img-src.html b/LayoutTests/webarchive/test-img-src.html
new file mode 100644 (file)
index 0000000..a220114
--- /dev/null
@@ -0,0 +1,11 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+</script>
+</head>
+<body>
+  <img src="resources/apple.gif">
+</body>
+</html>
diff --git a/LayoutTests/webarchive/test-input-src-expected.txt b/LayoutTests/webarchive/test-input-src-expected.txt
new file mode 100644 (file)
index 0000000..9f92432
--- /dev/null
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>WebMainResource</key>
+       <dict>
+               <key>WebResourceData</key>
+               <string>&lt;html&gt;&lt;head&gt;
+&lt;script&gt;
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+&lt;/script&gt;
+&lt;/head&gt;&lt;body&gt;
+&lt;form&gt;
+&lt;input type="image" src="resources/apple.gif"&gt;
+&lt;/form&gt;
+
+
+&lt;/body&gt;&lt;/html&gt;</string>
+               <key>WebResourceFrameName</key>
+               <string></string>
+               <key>WebResourceMIMEType</key>
+               <string>text/html</string>
+               <key>WebResourceTextEncodingName</key>
+               <string>UTF-8</string>
+               <key>WebResourceURL</key>
+               <string>file:///LayoutTests/webarchive/test-input-src.html</string>
+       </dict>
+       <key>WebSubresources</key>
+       <array>
+               <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>
+       </array>
+</dict>
+</plist>
diff --git a/LayoutTests/webarchive/test-input-src.html b/LayoutTests/webarchive/test-input-src.html
new file mode 100644 (file)
index 0000000..aaa31e5
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+</script>
+</head>
+<body>
+<form>
+<input type="image" src="resources/apple.gif">
+</form>
+</body>
+</html>
diff --git a/LayoutTests/webarchive/test-link-href-expected.txt b/LayoutTests/webarchive/test-link-href-expected.txt
new file mode 100644 (file)
index 0000000..92f8800
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>WebMainResource</key>
+       <dict>
+               <key>WebResourceData</key>
+               <string>&lt;html&gt;&lt;head&gt;
+&lt;script&gt;
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+&lt;/script&gt;
+&lt;link rel="stylesheet" href="resources/test-style.css" type="text/css"&gt;
+&lt;/head&gt;&lt;body&gt;
+&lt;div&gt;
+This text should be red sans-serif.
+&lt;/div&gt;
+
+
+&lt;/body&gt;&lt;/html&gt;</string>
+               <key>WebResourceFrameName</key>
+               <string></string>
+               <key>WebResourceMIMEType</key>
+               <string>text/html</string>
+               <key>WebResourceTextEncodingName</key>
+               <string>UTF-8</string>
+               <key>WebResourceURL</key>
+               <string>file:///LayoutTests/webarchive/test-link-href.html</string>
+       </dict>
+       <key>WebSubresources</key>
+       <array>
+               <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>
+       </array>
+</dict>
+</plist>
diff --git a/LayoutTests/webarchive/test-link-href.html b/LayoutTests/webarchive/test-link-href.html
new file mode 100644 (file)
index 0000000..425c7b3
--- /dev/null
@@ -0,0 +1,14 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+</script>
+<link rel="stylesheet" href="resources/test-style.css" type="text/css">
+</head>
+<body>
+<div>
+This text should be red sans-serif.
+</div>
+</body>
+</html>
diff --git a/LayoutTests/webarchive/test-object-data-expected.txt b/LayoutTests/webarchive/test-object-data-expected.txt
new file mode 100644 (file)
index 0000000..6d8a83e
--- /dev/null
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>WebMainResource</key>
+       <dict>
+               <key>WebResourceData</key>
+               <string>&lt;html&gt;&lt;head&gt;
+&lt;script&gt;
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+&lt;/script&gt;
+&lt;/head&gt;&lt;body&gt;
+  &lt;object data="resources/apple.gif" type="image/gif"&gt;&lt;/object&gt;
+
+
+&lt;/body&gt;&lt;/html&gt;</string>
+               <key>WebResourceFrameName</key>
+               <string></string>
+               <key>WebResourceMIMEType</key>
+               <string>text/html</string>
+               <key>WebResourceTextEncodingName</key>
+               <string>UTF-8</string>
+               <key>WebResourceURL</key>
+               <string>file:///LayoutTests/webarchive/test-object-data.html</string>
+       </dict>
+       <key>WebSubresources</key>
+       <array>
+               <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>
+       </array>
+</dict>
+</plist>
diff --git a/LayoutTests/webarchive/test-object-data.html b/LayoutTests/webarchive/test-object-data.html
new file mode 100644 (file)
index 0000000..c02de04
--- /dev/null
@@ -0,0 +1,11 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+</script>
+</head>
+<body>
+  <object data="resources/apple.gif" type="image/gif"></object>
+</body>
+</html>
diff --git a/LayoutTests/webarchive/test-script-src-expected.txt b/LayoutTests/webarchive/test-script-src-expected.txt
new file mode 100644 (file)
index 0000000..ab28a10
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>WebMainResource</key>
+       <dict>
+               <key>WebResourceData</key>
+               <string>&lt;html&gt;&lt;head&gt;
+&lt;script src="resources/dump-webarchive.js" type="text/javascript"&gt;&lt;/script&gt;
+&lt;/head&gt;&lt;body&gt;
+
+
+&lt;/body&gt;&lt;/html&gt;</string>
+               <key>WebResourceFrameName</key>
+               <string></string>
+               <key>WebResourceMIMEType</key>
+               <string>text/html</string>
+               <key>WebResourceTextEncodingName</key>
+               <string>UTF-8</string>
+               <key>WebResourceURL</key>
+               <string>file:///LayoutTests/webarchive/test-script-src.html</string>
+       </dict>
+       <key>WebSubresources</key>
+       <array>
+               <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>
+       </array>
+</dict>
+</plist>
diff --git a/LayoutTests/webarchive/test-script-src.html b/LayoutTests/webarchive/test-script-src.html
new file mode 100644 (file)
index 0000000..ba129fd
--- /dev/null
@@ -0,0 +1,7 @@
+<html>
+<head>
+<script src="resources/dump-webarchive.js" type="text/javascript"></script>
+</head>
+<body>
+</body>
+</html>
diff --git a/LayoutTests/webarchive/test-table-background-expected.txt b/LayoutTests/webarchive/test-table-background-expected.txt
new file mode 100644 (file)
index 0000000..9e7cbe4
--- /dev/null
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>WebMainResource</key>
+       <dict>
+               <key>WebResourceData</key>
+               <string>&lt;html&gt;&lt;head&gt;
+&lt;script&gt;
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+&lt;/script&gt;
+&lt;/head&gt;&lt;body&gt;
+  &lt;table background="resources/apple.gif" style="width: 52px; height: 64px;"&gt;
+    &lt;tbody&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
+
+
+&lt;/body&gt;&lt;/html&gt;</string>
+               <key>WebResourceFrameName</key>
+               <string></string>
+               <key>WebResourceMIMEType</key>
+               <string>text/html</string>
+               <key>WebResourceTextEncodingName</key>
+               <string>UTF-8</string>
+               <key>WebResourceURL</key>
+               <string>file:///LayoutTests/webarchive/test-table-background.html</string>
+       </dict>
+       <key>WebSubresources</key>
+       <array>
+               <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>
+       </array>
+</dict>
+</plist>
diff --git a/LayoutTests/webarchive/test-table-background.html b/LayoutTests/webarchive/test-table-background.html
new file mode 100644 (file)
index 0000000..ee4d2e4
--- /dev/null
@@ -0,0 +1,14 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+</script>
+</head>
+<body>
+  <table background="resources/apple.gif" style="width: 52px; height: 64px;">
+    <tr>
+    </tr>
+  </table>
+</body>
+</html>
diff --git a/LayoutTests/webarchive/test-td-background-expected.txt b/LayoutTests/webarchive/test-td-background-expected.txt
new file mode 100644 (file)
index 0000000..e34578b
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>WebMainResource</key>
+       <dict>
+               <key>WebResourceData</key>
+               <string>&lt;html&gt;&lt;head&gt;
+&lt;script&gt;
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+&lt;/script&gt;
+&lt;/head&gt;&lt;body&gt;
+  &lt;table&gt;
+    &lt;tbody&gt;&lt;tr&gt;&lt;td background="resources/apple.gif"&gt;
+        &lt;p style="width: 52px; height: 64px;"&gt;&lt;/p&gt;
+      &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
+
+
+&lt;/body&gt;&lt;/html&gt;</string>
+               <key>WebResourceFrameName</key>
+               <string></string>
+               <key>WebResourceMIMEType</key>
+               <string>text/html</string>
+               <key>WebResourceTextEncodingName</key>
+               <string>UTF-8</string>
+               <key>WebResourceURL</key>
+               <string>file:///LayoutTests/webarchive/test-td-background.html</string>
+       </dict>
+       <key>WebSubresources</key>
+       <array>
+               <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>
+       </array>
+</dict>
+</plist>
diff --git a/LayoutTests/webarchive/test-td-background.html b/LayoutTests/webarchive/test-td-background.html
new file mode 100644 (file)
index 0000000..4a8f75c
--- /dev/null
@@ -0,0 +1,17 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsWebArchive();
+</script>
+</head>
+<body>
+  <table>
+    <tr>
+      <td background="resources/apple.gif">
+        <p style="width: 52px; height: 64px;"></p>
+      </td>
+    </tr>
+  </table>
+</body>
+</html>
index eb079e5..26ff8cb 100644 (file)
@@ -1,5 +1,29 @@
 2007-01-30  David Kilzer  <ddkilzer@webkit.org>
 
+        Reviewed by Darin.
+
+        http://bugs.webkit.org/show_bug.cgi?id=11882
+        Need a way to regression test .webarchive output files
+
+        Implement layoutTestController.dumpAsWebArchive() to test WebArchive format.
+        Alters WebResourceResponse and WebResourceURL properties within WebArchive format
+        to normalize URLs to remove path where WebKit was checked out.  Also converts
+        WebDataResource properties from data to string if the corresponding
+        WebResourceMIMEType property starts with "text/" or equals
+        "application/x-javascript".
+
+        * DumpRenderTree/DumpRenderTree.m:
+        (convertWebResourceDataToString): Added.
+        (normalizeWebResourceURL): Added.
+        (normalizeWebResourceResponse): Added.
+        (serializeWebArchiveToXML): Added.
+        (dump):
+        (+[LayoutTestController isSelectorExcludedFromWebScript:]):
+        (-[LayoutTestController dumpAsWebArchive]): Added.
+        (runTest):
+
+2007-01-30  David Kilzer  <ddkilzer@webkit.org>
+
         Reviewed by Mark Rowe.
 
         http://bugs.webkit.org/show_bug.cgi?id=12470
index e6f3424..e425368 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2005, 2006, 2007 Apple, Inc.  All rights reserved.
  *           (C) 2007 Graham Dennis (graham.dennis@gmail.com)
  *
  * Redistribution and use in source and binary forms, with or without
@@ -120,6 +120,7 @@ static WebFrame *topLoadingFrame;     // !nil iff a load is in progress
 static BOOL waitToDump;     // TRUE if waitUntilDone() has been called, but notifyDone() has not yet been called
 
 static BOOL dumpAsText;
+static BOOL dumpAsWebArchive;
 static BOOL dumpSelectionRect;
 static BOOL dumpTitleChanges;
 static BOOL dumpBackForwardList;
@@ -505,6 +506,103 @@ static void dumpFrameScrollPosition(WebFrame *f)
     }
 }
 
+static void convertWebResourceDataToString(NSMutableDictionary *resource)
+{
+    NSString *mimeType = [resource objectForKey:@"WebResourceMIMEType"];
+    if ([mimeType hasPrefix:@"text/"] || [mimeType isEqualToString:@"application/x-javascript"]) {
+        NSData *data = [resource objectForKey:@"WebResourceData"];
+        NSString *dataAsString = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
+        [resource setObject:dataAsString forKey:@"WebResourceData"];
+    }
+}
+
+static void normalizeWebResourceURL(NSMutableString *webResourceURL, NSString *oldURLBase)
+{
+    [webResourceURL replaceOccurrencesOfString:oldURLBase
+                                    withString:@"file://"
+                                       options:NSLiteralSearch
+                                         range:NSMakeRange(0, [webResourceURL length])];
+}
+
+static void normalizeWebResourceResponse(NSMutableDictionary *propertyList, NSString *oldURLBase)
+{
+    NSURLResponse *response = nil;
+    NSData *responseData = [propertyList objectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
+    if ([responseData isKindOfClass:[NSData class]]) {
+        // Decode NSURLResponse
+        NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:responseData];
+        response = [unarchiver decodeObjectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
+        [unarchiver finishDecoding];
+        [unarchiver release];
+
+        // Create replacement NSURLReponse
+        NSMutableString *URL = [[[NSMutableString alloc] initWithContentsOfURL:[response URL]] autorelease];
+        normalizeWebResourceURL(URL, oldURLBase);
+        NSURLResponse *newResponse = [[NSURLResponse alloc] initWithURL:[[[NSURL alloc] initWithString:URL] autorelease]
+                                                               MIMEType:[response MIMEType]
+                                                  expectedContentLength:[response expectedContentLength]
+                                                       textEncodingName:[response textEncodingName]];
+        [newResponse autorelease];
+
+        // Encode replacement NSURLResponse
+        NSMutableData *newResponseData = [[NSMutableData alloc] init];
+        NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:newResponseData];
+        [archiver encodeObject:newResponse forKey:@"WebResourceResponse"];
+        [archiver finishEncoding];
+        [archiver release];
+        [propertyList setObject:newResponseData forKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
+        [newResponseData release];
+    }
+}
+
+static NSString *serializeWebArchiveToXML(WebArchive *webArchive)
+{
+    NSString *errorString;
+    NSMutableDictionary *propertyList = [NSPropertyListSerialization propertyListFromData:[webArchive data]
+                                                                         mutabilityOption:NSPropertyListMutableContainersAndLeaves
+                                                                                   format:NULL
+                                                                         errorDescription:&errorString];
+    if (!propertyList)
+        return errorString;
+
+    // Normalize WebResourceResponse and WebResourceURL values in plist for testing
+    NSString *cwdURL = [@"file://" stringByAppendingString:[[[NSFileManager defaultManager] currentDirectoryPath] stringByExpandingTildeInPath]];
+
+    NSMutableArray *resources = [NSMutableArray arrayWithCapacity:1];
+    [resources addObject:propertyList];
+
+    while ([resources count]) {
+        NSMutableDictionary *resourcePropertyList = [resources objectAtIndex:0];
+        [resources removeObjectAtIndex:0];
+
+        NSMutableDictionary *mainResource = [resourcePropertyList objectForKey:@"WebMainResource"];
+        normalizeWebResourceURL([mainResource objectForKey:@"WebResourceURL"], cwdURL);
+        convertWebResourceDataToString(mainResource);
+
+        // Add subframeArchives to list for processing
+        NSMutableArray *subframeArchives = [resourcePropertyList objectForKey:@"WebSubframeArchives"]; // WebSubframeArchivesKey in WebArchive.m
+        if (subframeArchives)
+            [resources addObjectsFromArray:subframeArchives];
+
+        NSMutableArray *subresources = [resourcePropertyList objectForKey:@"WebSubresources"]; // WebSubresourcesKey in WebArchive.m
+        NSEnumerator *enumerator = [subresources objectEnumerator];
+        NSMutableDictionary *subresourcePropertyList;
+        while ((subresourcePropertyList = [enumerator nextObject])) {
+            normalizeWebResourceURL([subresourcePropertyList objectForKey:@"WebResourceURL"], cwdURL);
+            normalizeWebResourceResponse(subresourcePropertyList, cwdURL);
+            convertWebResourceDataToString(subresourcePropertyList);
+        }
+    }
+
+    NSData *xmlData = [NSPropertyListSerialization dataFromPropertyList:propertyList
+                                                                 format:NSPropertyListXMLFormat_v1_0
+                                                       errorDescription:&errorString];
+    if (!xmlData)
+        return errorString;
+
+    return [[[NSMutableString alloc] initWithData:xmlData encoding:NSUTF8StringEncoding] autorelease];
+}
+
 static void dump(void)
 {
     NSString *result = nil;
@@ -513,6 +611,9 @@ static void dump(void)
         if (dumpAsText) {
             DOMElement *documentElement = [[frame DOMDocument] documentElement];
             result = [[(DOMElement *)documentElement innerText] stringByAppendingString:@"\n"];
+        } else if (dumpAsWebArchive) {
+            WebArchive *webArchive = [[frame DOMDocument] webArchive];
+            result = serializeWebArchiveToXML(webArchive);
         } else {
             bool isSVGW3CTest = ([currentTest rangeOfString:@"svg/W3C-SVG-1.1"].length);
             if (isSVGW3CTest)
@@ -521,12 +622,19 @@ static void dump(void)
                 [[frame webView] setFrameSize:NSMakeSize(maxViewWidth, maxViewHeight)];
             result = [frame renderTreeAsExternalRepresentation];
         }
-        
-        if (!result)
-            printf("ERROR: nil result from %s", dumpAsText ? "[documentElement innerText]" : "[frame renderTreeAsExternalRepresentation]");
-        else {
+
+        if (!result) {
+            const char *errorMessage;
+            if (dumpAsText)
+                errorMessage = "[documentElement innerText]";
+            else if (dumpAsWebArchive)
+                errorMessage = "[[frame DOMDocument] webArchive]";
+            else
+                errorMessage = "[frame renderTreeAsExternalRepresentation]";
+            printf("ERROR: nil result from %s", errorMessage);
+        } else {
             fputs([result UTF8String], stdout);
-            if (!dumpAsText)
+            if (!dumpAsText && !dumpAsWebArchive)
                 dumpFrameScrollPosition(frame);
         }
 
@@ -567,7 +675,7 @@ static void dump(void)
     }
     
     if (dumpPixels) {
-        if (!dumpAsText) {
+        if (!dumpAsText && !dumpAsWebArchive) {
             // grab a bitmap from the view
             WebView* view = [frame webView];
             NSSize webViewSize = [view frame].size;
@@ -768,6 +876,7 @@ static void dump(void)
     if (aSelector == @selector(waitUntilDone)
             || aSelector == @selector(notifyDone)
             || aSelector == @selector(dumpAsText)
+            || aSelector == @selector(dumpAsWebArchive)
             || aSelector == @selector(dumpTitleChanges)
             || aSelector == @selector(dumpBackForwardList)
             || aSelector == @selector(dumpChildFrameScrollPositions)
@@ -854,6 +963,11 @@ static void dump(void)
     dumpAsText = YES;
 }
 
+- (void)dumpAsWebArchive
+{
+    dumpAsWebArchive = YES;
+}
+
 - (void)dumpSelectionRect
 {
     dumpSelectionRect = YES;
@@ -1050,6 +1164,7 @@ static void runTest(const char *pathOrURL)
     topLoadingFrame = nil;
     waitToDump = NO;
     dumpAsText = NO;
+    dumpAsWebArchive = NO;
     dumpChildFrameScrollPositions = NO;
     shouldDumpEditingCallbacks = NO;
     dumpSelectionRect = NO;