Commit c2019dd7 authored by jcivelli@chromium.org's avatar jcivelli@chromium.org

2011-05-24 Jay Civelli <jcivelli@chromium.org>

        Reviewed by Adam Barth.

        Adding MHTML reading support.
        https://bugs.webkit.org/show_bug.cgi?id=7168

        * configure.ac:
2011-05-24  Jay Civelli  <jcivelli@chromium.org>

        Reviewed by Adam Barth.

        Adding MHTML reading support to WebCore.
        https://bugs.webkit.org/show_bug.cgi?id=7168

        * mhtml/frame_0.html_original: Added.
        * mhtml/frame_1.html_original: Added.
        * mhtml/frame_2.html_original: Added.
        * mhtml/frame_4.html_original: Added.
        * mhtml/multi_frames.html_original: Added.
        * mhtml/multi_frames_ie.mht: Added.
        * mhtml/multi_frames_unmht.mht: Added.
        * mhtml/page_with_css_and_js.html_original: Added.
        * mhtml/page_with_css_and_js_ie.mht: Added.
        * mhtml/page_with_css_and_js_unmht.mht: Added.
        * mhtml/page_with_image.html_original: Added.
        * mhtml/page_with_image_ie.mht: Added.
        * mhtml/page_with_image_unmht.mht: Added.
        * mhtml/resources/red_square.png: Added.
        * mhtml/simple_page.html_original: Added.
        * mhtml/simple_page_ie.mht: Added.
        * mhtml/simple_page_unmht.mht: Added.
        * platform/chromium/mhtml/multi_frames_ie-expected.txt: Added.
        * platform/chromium/mhtml/multi_frames_unmht-expected.txt: Added.
        * platform/chromium/mhtml/page_with_css_and_js_ie-expected.txt: Added.
        * platform/chromium/mhtml/page_with_css_and_js_unmht-expected.txt: Added.
        * platform/chromium/mhtml/page_with_image_ie-expected.txt: Added.
        * platform/chromium/mhtml/page_with_image_unmht-expected.txt: Added.
        * platform/chromium/mhtml/simple_page_ie-expected.txt: Added.
        * platform/chromium/mhtml/simple_page_unmht-expected.txt: Added.
2011-05-24  Jay Civelli  <jcivelli@chromium.org>

        Reviewed by Adam Barth.

        Adding MHTML reading support. That required some basic MIME header parsing.
        Modified DocumentLoader to keep a reference to the currently Archive loaded,
        so we can have different policies for loading subresources depending on the
        archive type.
        https://bugs.webkit.org/show_bug.cgi?id=7168

        * CMakeLists.txt:
        * Configurations/FeatureDefines.xcconfig:
        * GNUmakefile.am:
        * GNUmakefile.list.am:
        * WebCore.gyp/WebCore.gyp:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * features.pri:
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::commitLoad):
        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
        (WebCore::DocumentLoader::popArchiveForSubframe):
        (WebCore::DocumentLoader::scheduleArchiveLoad):
        * loader/DocumentLoader.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadURLIntoChildFrame):
        (WebCore::FrameLoader::loadArchive):
        (WebCore::FrameLoader::stopAllLoaders):
        (WebCore::FrameLoader::finishedLoadingDocument):
        * loader/FrameLoader.h:
        (WebCore::FrameLoader::archive):
        * loader/MainResourceLoader.cpp:
        (WebCore::MainResourceLoader::continueAfterContentPolicy):
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::start):
        * loader/archive/Archive.cpp: Added.
        * loader/archive/Archive.h:
        (WebCore::Archive::mainResource):
        * loader/archive/ArchiveFactory.cpp:
        (WebCore::archiveFactoryCreate):
        (WebCore::archiveMIMETypes):
        (WebCore::ArchiveFactory::create):
        (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes):
        * loader/archive/ArchiveFactory.h:
        * loader/archive/ArchiveResourceCollection.cpp:
        (WebCore::ArchiveResourceCollection::addAllResources):
        (WebCore::ArchiveResourceCollection::popSubframeArchive):
        * loader/archive/ArchiveResourceCollection.h:
        * loader/archive/cf/LegacyWebArchive.cpp:
        (WebCore::LegacyWebArchive::create):
        (WebCore::LegacyWebArchive::type):
        * loader/archive/cf/LegacyWebArchive.h:
        * loader/archive/mhtml/MHTMLArchive.cpp: Added.
        * loader/archive/mhtml/MHTMLArchive.h: Added.
        * loader/archive/mhtml/MHTMLParser.cpp: Added.
        * loader/archive/mhtml/MHTMLParser.h: Added.
        * platform/MIMETypeRegistry.cpp:
        (WebCore::initializeSupportedNonImageMimeTypes):
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::documentFragment):
        * platform/network/MIMEHeader.cpp: Added.
        * platform/network/MIMEHeader.h: Added.
2011-05-24  Jay Civelli  <jcivelli@chromium.org>

        Reviewed by Adam Barth.

        Adding MHTML reading support to WebCore.
        https://bugs.webkit.org/show_bug.cgi?id=7168

       * features.gypi:
2011-05-24  Jay Civelli  <jcivelli@chromium.org>

        Reviewed by Adam Barth.

        Adding MHTML reading support.
        https://bugs.webkit.org/show_bug.cgi?id=7168

        * Scripts/build-webkit:
        * Scripts/old-run-webkit-tests:
        * Scripts/webkitperl/features.pm:
        * Scripts/webkitpy/layout_tests/port/test_files.py:
        * Scripts/webkitpy/layout_tests/port/webkit.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6b0bbaad
2011-05-24 Jay Civelli <jcivelli@chromium.org>
Reviewed by Adam Barth.
Adding MHTML reading support.
https://bugs.webkit.org/show_bug.cgi?id=7168
* configure.ac:
2011-05-23 Ryuan Choi <ryuan.choi@samsung.com>
Rubber stamped by Eric Seidel.
......
2011-05-24 Jay Civelli <jcivelli@chromium.org>
Reviewed by Adam Barth.
Adding MHTML reading support to WebCore.
https://bugs.webkit.org/show_bug.cgi?id=7168
* mhtml/frame_0.html_original: Added.
* mhtml/frame_1.html_original: Added.
* mhtml/frame_2.html_original: Added.
* mhtml/frame_4.html_original: Added.
* mhtml/multi_frames.html_original: Added.
* mhtml/multi_frames_ie.mht: Added.
* mhtml/multi_frames_unmht.mht: Added.
* mhtml/page_with_css_and_js.html_original: Added.
* mhtml/page_with_css_and_js_ie.mht: Added.
* mhtml/page_with_css_and_js_unmht.mht: Added.
* mhtml/page_with_image.html_original: Added.
* mhtml/page_with_image_ie.mht: Added.
* mhtml/page_with_image_unmht.mht: Added.
* mhtml/resources/red_square.png: Added.
* mhtml/simple_page.html_original: Added.
* mhtml/simple_page_ie.mht: Added.
* mhtml/simple_page_unmht.mht: Added.
* platform/chromium/mhtml/multi_frames_ie-expected.txt: Added.
* platform/chromium/mhtml/multi_frames_unmht-expected.txt: Added.
* platform/chromium/mhtml/page_with_css_and_js_ie-expected.txt: Added.
* platform/chromium/mhtml/page_with_css_and_js_unmht-expected.txt: Added.
* platform/chromium/mhtml/page_with_image_ie-expected.txt: Added.
* platform/chromium/mhtml/page_with_image_unmht-expected.txt: Added.
* platform/chromium/mhtml/simple_page_ie-expected.txt: Added.
* platform/chromium/mhtml/simple_page_unmht-expected.txt: Added.
2011-05-24 Sam Weinig <sam@webkit.org>
Reviewed by Beth Dakin.
<html>
<body>
The first frame!
</body>
</html>
<html>
<body>
The second frame!
</body>
</html>
<html>
<body>
The third frame!<br>
This one contains yet another frame. What a twist!</br>
<iframe src="frame_4.html"></iframe>
</body>
</html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head><body>
This is frame 4!<br>
<img src="frame_4_files/red_square.png" onerror="document.getElementById('error').innerHTML+='Failed to load image!'">
<div id="error">Failed to load image!</div>
</body></html>
\ No newline at end of file
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>A page that contains multiple nested frames</title>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.dumpChildFramesAsText();
}
</script>
</head><body>
This page contains several frames.<br>
<iframe src="multi_frames_files/frame_0.html"></iframe><br>
<iframe src="multi_frames_files/frame_1.html"></iframe><br>
<iframe src="multi_frames_files/frame_2.html"></iframe><br>
And a red square:<br>
<img src="frame_4_data/red_square.png" onerror="document.getElementById('error').innerHTML+='Failed to load image!'">
<div id="error"></div>
</body></html>
\ No newline at end of file
From: "Saved by Windows Internet Explorer 9"
Subject: A page that contains multiple nested frames
Date: Wed, 18 May 2011 16:50:17 -0700
MIME-Version: 1.0
Content-Type: multipart/related;
type="multipart/alternative";
boundary="----=_NextPart_000_0020_01CC157B.AAC3EF70"
X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7600.16776
This is a multi-part message in MIME format.
------=_NextPart_000_0020_01CC157B.AAC3EF70
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-Location: http://localhost/resources/red_square.png
iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAACESURBVEhL7ZYxDoAwCEXB2LGTo46ewXj/zXgV
PQKgexP/Ai6l889/6Stp4HtZjYKOiRCpEpfSEIYgJqxNMFTkFUjVXiZhT6qGirwCqdrLJOxJ1VCR
V6A/1XxNc9jqQ6JkpjTU2rwQR+5c4769YCM5zn/BX4PY33Dljb0+JtiTqqEir8ADWEIY6dz7d1cA
AAAASUVORK5CYII=
------=_NextPart_000_0020_01CC157B.AAC3EF70
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0023_01CC157B.AAC41680"
------=_NextPart_001_0023_01CC157B.AAC41680
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/top_frame.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>A page that contains multiple nested frames</TITLE>
<META content=3D"text/html; charset=3Dwindows-1252" =
http-equiv=3DContent-Type>
<SCRIPT>=0A=
if (window.layoutTestController) {=0A=
layoutTestController.dumpAsText();=0A=
layoutTestController.dumpChildFramesAsText();=0A=
}=0A=
</SCRIPT>
<META name=3DGENERATOR content=3D"MSHTML 9.00.8112.16421"></HEAD>
<BODY>This page contains several frames.<BR><IFRAME=20
src=3D"http://localhost/frame_0.html"></IFRAME><BR><IFRAME=20
src=3D"http://localhost/frame_1.html"></IFRAME><BR><IFRAME=20
src=3D"http://localhost/frame_2.html"></IFRAME><BR>And a red =
square:<BR><IMG=20
onerror=3D"document.getElementById('error').innerHTML+=3D'Failed to load =
image!'"=20
src=3D"http://localhost/resources/red_square.png">=20
<DIV id=3Derror></DIV></BODY></HTML>
------=_NextPart_001_0023_01CC157B.AAC41680
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
Content-Location: http://localhost/frame_0.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16421"></HEAD>
<BODY>The first frame! </BODY></HTML>
------=_NextPart_001_0023_01CC157B.AAC41680--
------=_NextPart_000_0020_01CC157B.AAC3EF70
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
Content-Location: http://localhost/frame_1.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16421"></HEAD>
<BODY>The second frame! </BODY></HTML>
------=_NextPart_000_0020_01CC157B.AAC3EF70
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/frame_4.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dwindows-1252" =
http-equiv=3DContent-Type>
<META name=3DGENERATOR content=3D"MSHTML 9.00.8112.16421"></HEAD>
<BODY>This is frame 4!<BR><IMG=20
onerror=3D"document.getElementById('error').innerHTML+=3D'Failed to load =
image!'"=20
src=3D"http://localhost/resources/red_square.png">=20
<DIV id=3Derror></DIV></BODY></HTML>
------=_NextPart_000_0020_01CC157B.AAC3EF70
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
Content-Location: http://localhost/frame_2.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16421"></HEAD>
<BODY>The third frame!<BR>This one contains yet another frame. What a
twist!<BR><IFRAME
src="http://localhost/frame_4.html"></IFRAME></BODY></HTML>
------=_NextPart_000_0020_01CC157B.AAC3EF70--
From: <Saved by UnMHT>
Subject: =?iso-2022-jp?B?QSBwYWdlIHRoYXQgY29udGFpbnMgbXVsdGlwbGUgbmVzdGVkIGZyYW1lcw==?=
Date: Wed, May 18 2011 15:20:34 GMT-0700
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_NextPart_000_0000_58874EE0.2096A571";
type="text/html"
------=_NextPart_000_0000_58874EE0.2096A571
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/top_frame.html
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3Diso-8859-1">
<title>A page that contains multiple nested frames</title>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.dumpChildFramesAsText();
}
</script>
<base href=3D"http://localhost/"></base></head><body>
This page contains several frames.<br>
<iframe src=3D"http://localhost/frame_0.html"></iframe><br>
<iframe src=3D"http://localhost/frame_1.html"></iframe><br>
<iframe src=3D"http://localhost/frame_2.html"></iframe><br>
And a red square:<br>
<img onerror=3D"document.getElementById(&#x27;error&#x27;).innerHTML+=3D&#x=
27;Failed to load image!&#x27;" src=3D"resources/red_square.png">
<div id=3D"error"></div>
</body></html>
------=_NextPart_000_0000_58874EE0.2096A571
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/frame_0.html
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3Diso-8859-1">
<base href=3D"http://localhost/"></base></head><body>
The first frame!
</body></html>
------=_NextPart_000_0000_58874EE0.2096A571
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/frame_1.html
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3Diso-8859-1">
<base href=3D"http://localhost/"></base></head><body>
The second frame!
</body></html>
------=_NextPart_000_0000_58874EE0.2096A571
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/frame_2.html
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3Diso-8859-1">
<base href=3D"http://localhost/"></base></head><body>
The third frame!<br>
This one contains yet another frame. What a twist!<br>
<iframe src=3D"http://localhost/frame_4.html"></iframe>
</body></html>
------=_NextPart_000_0000_58874EE0.2096A571
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/frame_4.html
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3Diso-8859-1">
<base href=3D"http://localhost/"></base></head><body>
This is frame 4!<br>
<img onerror=3D"document.getElementById(&#x27;error&#x27;).innerHTML+=3D&#x=
27;Failed to load image!&#x27;" src=3D"resources/red_square.png">
<div id=3D"error"></div>
</body></html>
------=_NextPart_000_0000_58874EE0.2096A571
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-Location: http://localhost/resources/red_square.png
iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAACESURBVEhL7ZYxDoAwCEXB2LGTo46ewXj/zXgV
PQKgexP/Ai6l889/6Stp4HtZjYKOiRCpEpfSEIYgJqxNMFTkFUjVXiZhT6qGirwCqdrLJOxJ1VCR
V6A/1XxNc9jqQ6JkpjTU2rwQR+5c4769YCM5zn/BX4PY33Dljb0+JtiTqqEir8ADWEIY6dz7d1cA
AAAASUVORK5CYII=
------=_NextPart_000_0000_58874EE0.2096A571--
<html>
<head>
<link href="resources/hide_image.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="resources/remove_image_script.js"></script>
</head>
<body onload="onLoad()">
This page tests that CSS and JavaScript resources are retrieved correctly for MHTML files.<br><br>
There should be only one red square below:
<div id="firstDiv">
<img src="resources/red_square.png"><br><br>
</div>
<div id="secondDiv">
The red square below should be hidden by way of CSS.<br>
<img src="resources/red_square.png"><br><br>
</div>
<div id="thirdDiv">
The red square below should be hidden by way of JavaScript.<br>
<img src="resources/red_square.png"><br><br>
</div>
</body>
</html>
From: "Saved by Windows Internet Explorer 9"
Subject:
Date: Wed, 18 May 2011 16:49:23 -0700
MIME-Version: 1.0
Content-Type: multipart/related;
type="text/html";
boundary="----=_NextPart_000_0012_01CC157B.8AA06570"
X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7600.16776
This is a multi-part message in MIME format.
------=_NextPart_000_0012_01CC157B.8AA06570
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/page_with_css_and_js.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dwindows-1252" =
http-equiv=3DContent-Type><LINK=20
rel=3Dstylesheet type=3Dtext/css =
href=3D"http://localhost/resources/hide_image.css">
<SCRIPT type=3Dtext/javascript=20
src=3D"http://localhost/resources/remove_image_script.js"></SCRIPT>
<SCRIPT>=0A=
if (window.layoutTestController) {=0A=
layoutTestController.dumpAsText();=0A=
layoutTestController.waitUntilDone();=0A=
}=0A=
</SCRIPT>
<META name=3DGENERATOR content=3D"MSHTML 9.00.8112.16421"></HEAD>
<BODY onload=3DonLoad()>This page tests that CSS and JavaScript =
resources are=20
retrieved correctly for MHTML files.<BR><BR>There should be only one red =
square=20
below:=20
<DIV id=3DfirstDiv><IMG=20
src=3D"http://localhost/resources/red_square.png"><BR><BR></DIV>
<DIV id=3DsecondDiv>The red square below should be hidden by way of =
CSS.<BR><IMG=20
src=3D"http://localhost/resources/red_square.png"><BR><BR></DIV>
<DIV id=3DthirdDiv>The red square below should be hidden by way of=20
JavaScript.<BR><IMG=20
src=3D"http://localhost/resources/red_square.png"><BR><BR></DIV></BODY><=
/HTML>
------=_NextPart_000_0012_01CC157B.8AA06570
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-Location: http://localhost/resources/red_square.png
iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAACESURBVEhL7ZYxDoAwCEXB2LGTo46ewXj/zXgV
PQKgexP/Ai6l889/6Stp4HtZjYKOiRCpEpfSEIYgJqxNMFTkFUjVXiZhT6qGirwCqdrLJOxJ1VCR
V6A/1XxNc9jqQ6JkpjTU2rwQR+5c4769YCM5zn/BX4PY33Dljb0+JtiTqqEir8ADWEIY6dz7d1cA
AAAASUVORK5CYII=
------=_NextPart_000_0012_01CC157B.8AA06570
Content-Type: text/css;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Location: http://localhost/resources/hide_image.css
#secondDiv {
DISPLAY: none
}
------=_NextPart_000_0012_01CC157B.8AA06570
Content-Type: application/octet-stream
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/resources/remove_image_script.js
function onLoad() {=0A=
divToRemove =3D document.getElementById("thirdDiv");=0A=
divToRemove.parentNode.removeChild(divToRemove);=0A=
if (window.layoutTestController)=0A=
layoutTestController.notifyDone();=0A=
}
------=_NextPart_000_0012_01CC157B.8AA06570--
From: <Saved by UnMHT>
Subject: =?iso-2022-jp?B??=
Date: Wed, May 18 2011 15:21:05 GMT-0700
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_NextPart_000_0000_C2ECC76E.5EC79255";
type="text/html"
------=_NextPart_000_0000_C2ECC76E.5EC79255
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/page_with_css_and_js.html
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3Diso-8859-1">
<link type=3D"text/css" rel=3D"stylesheet" href=3D"resources/hide_image.c=
ss"></link>
=20
<script src=3D"resources/remove_image_script.js" type=3D"text/javascript"=
></script>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
</script>
<base href=3D"http://localhost/"></base></head><body onload=3D"onLoad()">
This page tests that CSS and JavaScript resources are retrieved correctly=
for MHTML files.<br><br>
There should be only one red square below:
<div id=3D"firstDiv">
<img src=3D"resources/red_square.png"><br><br>
</div>
<div id=3D"secondDiv">
The red square below should be hidden by way of CSS.<br>
<img src=3D"resources/red_square.png"><br><br>
</div>
<div id=3D"thirdDiv">
The red square below should be hidden by way of JavaScript.<br>
<img src=3D"resources/red_square.png"><br><br>
</div>
=20
</body></html>
------=_NextPart_000_0000_C2ECC76E.5EC79255
Content-Type: text/css
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/resources/hide_image.css
#secondDiv { display: none; }
------=_NextPart_000_0000_C2ECC76E.5EC79255
Content-Type: text/javascript
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/resources/remove_image_script.js
function onLoad() {
divToRemove =3D document.getElementById("thirdDiv");
divToRemove.parentNode.removeChild(divToRemove);
if (window.layoutTestController)
layoutTestController.notifyDone();
}
------=_NextPart_000_0000_C2ECC76E.5EC79255
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-Location: http://localhost/resources/red_square.png
iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAACESURBVEhL7ZYxDoAwCEXB2LGTo46ewXj/zXgV
PQKgexP/Ai6l889/6Stp4HtZjYKOiRCpEpfSEIYgJqxNMFTkFUjVXiZhT6qGirwCqdrLJOxJ1VCR
V6A/1XxNc9jqQ6JkpjTU2rwQR+5c4769YCM5zn/BX4PY33Dljb0+JtiTqqEir8ADWEIY6dz7d1cA
AAAASUVORK5CYII=
------=_NextPart_000_0000_C2ECC76E.5EC79255--
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Page with square</title>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
}
</script>
</head><body>
This is a red square:<br>
<img src="page_with_image_files/red_square.png" onerror="document.getElementById('error').innerHTML+='Failed to load image!'">
<div id="error"></div>
</body></html>
\ No newline at end of file
From: "Saved by Windows Internet Explorer 9"
Subject: Page with square
Date: Wed, 18 May 2011 16:49:44 -0700
MIME-Version: 1.0
Content-Type: multipart/related;
type="text/html";
boundary="----=_NextPart_000_001B_01CC157B.96F808A0"
X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7600.16776
This is a multi-part message in MIME format.
------=_NextPart_000_001B_01CC157B.96F808A0
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/page_with_image.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Page with square</TITLE>
<META content=3D"text/html; charset=3Dwindows-1252" =
http-equiv=3DContent-Type>
<SCRIPT>=0A=
if (window.layoutTestController) {=0A=
layoutTestController.dumpAsText();=0A=
}=0A=
=0A=
</SCRIPT>
<META name=3DGENERATOR content=3D"MSHTML 9.00.8112.16421"></HEAD>
<BODY>This is a red square:<BR><IMG=20
onerror=3D"document.getElementById('error').innerHTML+=3D'Failed to load =
image!'"=20
src=3D"http://localhost/resources/red_square.png">=20
<DIV id=3Derror></DIV></BODY></HTML>
------=_NextPart_000_001B_01CC157B.96F808A0
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-Location: http://localhost/resources/red_square.png
iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAACESURBVEhL7ZYxDoAwCEXB2LGTo46ewXj/zXgV
PQKgexP/Ai6l889/6Stp4HtZjYKOiRCpEpfSEIYgJqxNMFTkFUjVXiZhT6qGirwCqdrLJOxJ1VCR
V6A/1XxNc9jqQ6JkpjTU2rwQR+5c4769YCM5zn/BX4PY33Dljb0+JtiTqqEir8ADWEIY6dz7d1cA
AAAASUVORK5CYII=
------=_NextPart_000_001B_01CC157B.96F808A0--
From: <Saved by UnMHT>
Subject: =?iso-2022-jp?B?UGFnZSB3aXRoIHNxdWFyZQ==?=
Date: Wed, May 18 2011 16:38:33 GMT-0700
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_NextPart_000_0000_02C8A5EE.D896CA6B";
type="text/html"
------=_NextPart_000_0000_02C8A5EE.D896CA6B
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/page_with_image.html
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3Diso-8859-1">
<title>Page with square</title>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
}
</script>
<base href=3D"http://localhost/"></base></head><body>
This is a red square:<br>
<img onerror=3D"document.getElementById(&#x27;error&#x27;).innerHTML+=3D&#x=
27;Failed to load image!&#x27;" src=3D"resources/red_square.png">
<div id=3D"error"></div>
</body></html>
------=_NextPart_000_0000_02C8A5EE.D896CA6B
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-Location: http://localhost/resources/red_square.png
iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAACESURBVEhL7ZYxDoAwCEXB2LGTo46ewXj/zXgV
PQKgexP/Ai6l889/6Stp4HtZjYKOiRCpEpfSEIYgJqxNMFTkFUjVXiZhT6qGirwCqdrLJOxJ1VCR
V6A/1XxNc9jqQ6JkpjTU2rwQR+5c4769YCM5zn/BX4PY33Dljb0+JtiTqqEir8ADWEIY6dz7d1cA
AAAASUVORK5CYII=
------=_NextPart_000_0000_02C8A5EE.D896CA6B--
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>A simple page</title>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
</head><body>
<h1>This is a very simple page</h1>
Very <b>basic</b> page.
</body></html>
\ No newline at end of file
From: "Saved by Windows Internet Explorer 9"
Subject: A simple page
Date: Wed, 18 May 2011 16:50:01 -0700
MIME-Version: 1.0
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/simple_page.html
X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7600.16776
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>A simple page</TITLE>
<META content=3D"text/html; charset=3Dwindows-1252" =
http-equiv=3DContent-Type>
<SCRIPT>=0A=
if (window.layoutTestController)=0A=
layoutTestController.dumpAsText();=0A=
</SCRIPT>
<META name=3DGENERATOR content=3D"MSHTML 9.00.8112.16421"></HEAD>
<BODY>
<H1>This is a very simple page</H1>Very <B>basic</B> page. =
</BODY></HTML>
From: <Saved by UnMHT>
Subject: =?iso-2022-jp?B?QSBzaW1wbGUgcGFnZQ==?=
Date: Wed, May 11 2011 15:36:36 GMT-0700
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_NextPart_000_0000_87206557.D2C008B0";
type="text/html"
------=_NextPart_000_0000_87206557.D2C008B0
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/simple_page.html
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3Diso-8859-1">
<title>A simple page</title>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
<base href=3D"http://localhost/"></base></head><body>
<h1>This is a very simple page</h1>
Very <b>basic</b> page.
</body></html>
------=_NextPart_000_0000_87206557.D2C008B0--
This page contains several frames.
And a red square:
--------
Frame: '<!--framePath //<!--frame0-->-->'
--------
The first frame!
--------
Frame: '<!--framePath //<!--frame1-->-->'
--------
The second frame!
--------
Frame: '<!--framePath //<!--frame2-->-->'
--------
The third frame!
This one contains yet another frame. What a twist!
--------
Frame: '<!--framePath //<!--frame2-->/<!--frame0-->-->'