diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2012-12-04 16:44:48 +0100 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2012-12-04 16:45:30 +0100 |
commit | 0d84466d757621046458c609fb3ac640a06cab4f (patch) | |
tree | 6a9d468e6bcf9271d2b4c51f224bfbb642320e34 /Source/WebCore/loader/FrameLoader.cpp | |
parent | 56a644a26fa61a8e5c0270e15687e7ef25c0312a (diff) | |
download | qtwebkit-0d84466d757621046458c609fb3ac640a06cab4f.tar.gz |
Document::initSecurityContext() fails to call securityOrigin().grantLoadLocalResources()
https://bugs.webkit.org/show_bug.cgi?id=68711
Reviewed by Adam Barth.
Source/WebCore:
It currently fails since Document::loader() will return 0 until
Frame::setDocument is called and we are doing this check before it happens.
Delay the check and let the FrameLoader take care of doing grantLoadLocalResources()
on the Document along with other header checks in FrameLoader::didBeginDocument.
* dom/Document.cpp:
(WebCore::Document::initSecurityContext):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
Source/WebKit/qt:
* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::testStopScheduledPageRefresh): Unmark the expected failure.
Change-Id: Iec4f0106c42af572a1e4a8d352baa9d1a2fc8a1a
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Source/WebCore/loader/FrameLoader.cpp')
-rw-r--r-- | Source/WebCore/loader/FrameLoader.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp index 0352b1d8c..5716e39d3 100644 --- a/Source/WebCore/loader/FrameLoader.cpp +++ b/Source/WebCore/loader/FrameLoader.cpp @@ -676,6 +676,14 @@ void FrameLoader::didBeginDocument(bool dispatch) if (!headerContentLanguage.isEmpty()) m_frame->document()->setContentLanguage(headerContentLanguage); } + + if (SecurityPolicy::allowSubstituteDataAccessToLocal() && m_documentLoader->substituteData().isValid()) { + // If this document was loaded with substituteData, then the document can + // load local resources. See https://bugs.webkit.org/show_bug.cgi?id=16756 + // and https://bugs.webkit.org/show_bug.cgi?id=19760 for further + // discussion. + m_frame->document()->securityOrigin()->grantLoadLocalResources(); + } } history()->restoreDocumentState(); |