diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
commit | 43a42f108af6bcbd91f2672731c3047c26213af1 (patch) | |
tree | 7fa092e5f5d873c72f2486a70e26be26f7a38bec /Source/WebCore/loader/FrameLoader.cpp | |
parent | d9cf437c840c6eb7417bdd97e6c40979255d3158 (diff) | |
download | qtwebkit-43a42f108af6bcbd91f2672731c3047c26213af1.tar.gz |
Imported WebKit commit 302e7806bff028bd1167a1ec7c86a1ee00ecfb49 (http://svn.webkit.org/repository/webkit/trunk@132067)
New snapshot that fixes build without QtWidgets
Diffstat (limited to 'Source/WebCore/loader/FrameLoader.cpp')
-rw-r--r-- | Source/WebCore/loader/FrameLoader.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp index a84c508eb..9c3966cab 100644 --- a/Source/WebCore/loader/FrameLoader.cpp +++ b/Source/WebCore/loader/FrameLoader.cpp @@ -70,6 +70,7 @@ #include "HTMLFormElement.h" #include "HTMLNames.h" #include "HTMLObjectElement.h" +#include "HTMLParserIdioms.h" #include "HTTPParsers.h" #include "HistoryItem.h" #include "InspectorController.h" @@ -666,6 +667,15 @@ void FrameLoader::didBeginDocument(bool dispatch) String reportOnlyContentSecurityPolicy = m_documentLoader->response().httpHeaderField("X-WebKit-CSP-Report-Only"); if (!reportOnlyContentSecurityPolicy.isEmpty()) m_frame->document()->contentSecurityPolicy()->didReceiveHeader(reportOnlyContentSecurityPolicy, ContentSecurityPolicy::ReportOnly); + + String headerContentLanguage = m_documentLoader->response().httpHeaderField("Content-Language"); + if (!headerContentLanguage.isEmpty()) { + size_t commaIndex = headerContentLanguage.find(','); + headerContentLanguage.truncate(commaIndex); // notFound == -1 == don't truncate + headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTMLSpace); + if (!headerContentLanguage.isEmpty()) + m_frame->document()->setContentLanguage(headerContentLanguage); + } } history()->restoreDocumentState(); @@ -1689,6 +1699,9 @@ void FrameLoader::commitProvisionalLoad() prepareForCachedPageRestore(); cachedPage->restore(m_frame->page()); + // The page should be removed from the cache immediately after a restoration in order for the PageCache to be consistent. + pageCache()->remove(history()->currentItem()); + dispatchDidCommitLoad(); // If we have a title let the WebView know about it. @@ -1697,8 +1710,11 @@ void FrameLoader::commitProvisionalLoad() m_client->dispatchDidReceiveTitle(title); checkCompleted(); - } else + } else { + if (cachedPage) + pageCache()->remove(history()->currentItem()); didOpenURL(); + } LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame->tree()->uniqueName().string().utf8().data(), m_frame->document() ? m_frame->document()->url().string().utf8().data() : ""); @@ -1726,8 +1742,6 @@ void FrameLoader::commitProvisionalLoad() // Could be an issue with a giant local file. notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, response, 0, static_cast<int>(response.expectedContentLength()), 0, error); } - - pageCache()->remove(history()->currentItem()); // FIXME: Why only this frame and not parent frames? checkLoadCompleteForThisFrame(); @@ -3192,8 +3206,10 @@ void FrameLoader::dispatchDidCommitLoad() m_client->dispatchDidCommitLoad(); - if (isLoadingMainFrame()) + if (isLoadingMainFrame()) { m_frame->page()->resetSeenPlugins(); + m_frame->page()->resetSeenMediaEngines(); + } InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get()); } |