Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: Source/WebCore/loader/FrameLoader.cpp

Issue 8585026: Merge 100550 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/dom/Document.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/loader/FrameLoader.cpp
===================================================================
--- Source/WebCore/loader/FrameLoader.cpp (revision 100576)
+++ Source/WebCore/loader/FrameLoader.cpp (working copy)
@@ -568,7 +568,7 @@
void FrameLoader::receivedFirstData()
{
KURL workingURL = activeDocumentLoader()->documentURL();
-#if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
+#if ENABLE(WEB_ARCHIVE)
// FIXME: The document loader, not the frame loader, should be in charge of loading web archives.
// Once this is done, we can just make DocumentLoader::documentURL() return the right URL
// based on whether it has a non-null archive or not.
@@ -581,7 +581,15 @@
dispatchDidCommitLoad();
dispatchDidClearWindowObjectsInAllWorlds();
-
+
+#if ENABLE(MHTML)
+ if (m_archive) {
+ // The origin is the MHTML file, we need to set the base URL to the document encoded in the MHTML so
+ // relative URLs are resolved properly.
+ m_frame->document()->setBaseURLOverride(m_archive->mainResource()->url());
+ }
+#endif
+
if (m_documentLoader) {
StringWithDirection ptitle = m_documentLoader->title();
// If we have a title let the WebView know about it.
« no previous file with comments | « Source/WebCore/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698