WebKit Bugzilla
Attachment 342454 Details for
Bug 186441
: http/tests/security/cors-post-redirect-307.html fails with PSON enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186441-20180611123251.patch (text/plain), 57.78 KB, created by
Chris Dumez
on 2018-06-11 12:32:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-06-11 12:32:52 PDT
Size:
57.78 KB
patch
obsolete
>Subversion Revision: 232717 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ae7f01ab2c0ea1a967b698863295f1096c504d3d..3259c0c011c80d784fa7a01eae7c0142dd1acc74 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,51 @@ >+2018-06-11 Chris Dumez <cdumez@apple.com> >+ >+ http/tests/security/cors-post-redirect-307.html fails with PSON enabled >+ https://bugs.webkit.org/show_bug.cgi?id=186441 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When we are continuing a load in a new process, we currently bypass the navigation policy >+ check. We now also bypass the adding of headers such as the Origin one since the request >+ was already processed in the previous process. This is important because in the case of >+ a cross-origin redirect, the previous process has removed the Origin header from the >+ request and we do not want the new process to add it again. >+ >+ Test: http/tests/security/cors-post-redirect-307-pson.html >+ >+ * WebCore.xcodeproj/project.pbxproj: >+ * history/BackForwardController.cpp: >+ (WebCore::BackForwardController::goBackOrForward): >+ (WebCore::BackForwardController::goBack): >+ (WebCore::BackForwardController::goForward): >+ * loader/FrameLoadRequest.h: >+ (WebCore::FrameLoadRequest::setShouldTreatAsContinuingLoad): >+ (WebCore::FrameLoadRequest::shouldTreatAsContinuingLoad const): >+ (WebCore::FrameLoadRequest::setShouldCheckNavigationPolicy): Deleted. >+ (WebCore::FrameLoadRequest::shouldCheckNavigationPolicy const): Deleted. >+ * loader/FrameLoader.cpp: >+ (WebCore::FrameLoader::loadURLIntoChildFrame): >+ (WebCore::FrameLoader::load): >+ (WebCore::FrameLoader::loadWithNavigationAction): >+ (WebCore::FrameLoader::loadWithDocumentLoader): >+ (WebCore::FrameLoader::reloadWithOverrideEncoding): >+ (WebCore::FrameLoader::reload): >+ (WebCore::FrameLoader::addExtraFieldsToRequest): >+ (WebCore::FrameLoader::addHTTPOriginIfNeeded): >+ (WebCore::FrameLoader::loadDifferentDocumentItem): >+ (WebCore::FrameLoader::loadItem): >+ (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad): >+ * loader/FrameLoader.h: >+ * loader/HistoryController.cpp: >+ (WebCore::HistoryController::goToItem): >+ (WebCore::HistoryController::setDefersLoading): >+ (WebCore::HistoryController::recursiveGoToItem): >+ * loader/HistoryController.h: >+ * loader/ShouldTreatAsContinuingLoad.h: Renamed from Source/WebCore/loader/NavigationPolicyCheck.h. >+ * page/Page.cpp: >+ (WebCore::Page::goToItem): >+ * page/Page.h: >+ > 2018-06-11 Zalan Bujtas <zalan@apple.com> > > [LFC] Remove redundant position functions for out-of-flow elements >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index f1afd16924c7fee46c204759ed1075673e07b98d..4292727f9cd4d0d6dcc5e7a44cc191ef9309f14e 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,31 @@ >+2018-06-11 Chris Dumez <cdumez@apple.com> >+ >+ http/tests/security/cors-post-redirect-307.html fails with PSON enabled >+ https://bugs.webkit.org/show_bug.cgi?id=186441 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Rename existing flag to something a bit more generic, now that it is used for >+ more things than bypassing the navigation policy check. >+ >+ * Shared/LoadParameters.cpp: >+ (WebKit::LoadParameters::encode const): >+ (WebKit::LoadParameters::decode): >+ * Shared/LoadParameters.h: >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::reattachToWebProcessForReload): >+ (WebKit::WebPageProxy::reattachToWebProcessWithItem): >+ (WebKit::WebPageProxy::loadRequest): >+ (WebKit::WebPageProxy::loadRequestWithNavigation): >+ (WebKit::WebPageProxy::goToBackForwardItem): >+ (WebKit::WebPageProxy::continueNavigationInNewProcess): >+ * UIProcess/WebPageProxy.h: >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::loadRequest): >+ (WebKit::WebPage::goToBackForwardItem): >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/WebPage.messages.in: >+ > 2018-06-10 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK][WPE] Add API run run javascript from a WebKitWebView in an isolated world >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 4205ea3a36b20217d4ba487b873176cfe62b471a..d1267559a30ba9f50dc0b44a1011f1d95374379b 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-11 Chris Dumez <cdumez@apple.com> >+ >+ http/tests/security/cors-post-redirect-307.html fails with PSON enabled >+ https://bugs.webkit.org/show_bug.cgi?id=186441 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Rename existing flag to something a bit more generic, now that it is used for >+ more things than bypassing the navigation policy check. >+ >+ * WebView/WebView.mm: >+ (-[WebView _loadBackForwardListFromOtherView:]): >+ (-[WebView goToBackForwardItem:]): >+ > 2018-06-09 Dan Bernstein <mitz@apple.com> > > [Xcode] Clean up and modernize some build setting definitions >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 8d2e6c9519d56469e95dc33dc8db39120b0a20c1..3ca245d86097278087180df06acd70dbe9ab6453 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-11 Chris Dumez <cdumez@apple.com> >+ >+ http/tests/security/cors-post-redirect-307.html fails with PSON enabled >+ https://bugs.webkit.org/show_bug.cgi?id=186441 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Rename existing flag to something a bit more generic, now that it is used for >+ more things than bypassing the navigation policy check. >+ >+ * WebView.cpp: >+ (WebView::goToBackForwardItem): >+ (WebView::loadBackForwardListFromOtherView): >+ > 2018-06-04 Chris Dumez <cdumez@apple.com> > > Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy" >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index fdf2c26d01f1bb92a5f80ce9074507c9815e37b0..e578f644be65a1a7091485847afb68dd9d9a2535 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -1372,7 +1372,6 @@ > 510D4A37103165EE0049EA54 /* SocketStreamHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A31103165EE0049EA54 /* SocketStreamHandle.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 510D4A38103165EE0049EA54 /* SocketStreamHandleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 5110FCFC1E03641D006F8D0B /* IDBCursorRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 5110FCFB1E0362A5006F8D0B /* IDBCursorRecord.h */; }; >- 511E97A32063074600AD4599 /* NavigationPolicyCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 511E97A12063072A00AD4599 /* NavigationPolicyCheck.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 511EC1281C50AACA0032F983 /* IDBSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 511EC1261C50AA570032F983 /* IDBSerialization.h */; }; > 511EC12C1C50ABBF0032F983 /* SQLiteIDBTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 511EC12A1C50ABBA0032F983 /* SQLiteIDBTransaction.h */; }; > 511EC1301C50ABF50032F983 /* SQLiteIDBCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 511EC12E1C50ABEC0032F983 /* SQLiteIDBCursor.h */; }; >@@ -2335,6 +2334,7 @@ > 835D2D781F5F1FBD00141DED /* HTMLInputElementEntriesAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 835D2D751F5F1FB800141DED /* HTMLInputElementEntriesAPI.h */; }; > 835D363719FF6193004C93AB /* StyleBuilderCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 835D363619FF6193004C93AB /* StyleBuilderCustom.h */; }; > 835D54C51F4DE53800E60671 /* FileListCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = 835D54C21F4DE53400E60671 /* FileListCreator.h */; }; >+ 8362E8C120CEF9CB00245886 /* ShouldTreatAsContinuingLoad.h in Headers */ = {isa = PBXBuildFile; fileRef = 8362E8BF20CEF9CB00245886 /* ShouldTreatAsContinuingLoad.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 836589DE1F54A76900DC31F4 /* JSFileSystemDirectoryReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 836589D91F54A76200DC31F4 /* JSFileSystemDirectoryReader.h */; }; > 836589E01F54A76E00DC31F4 /* JSFileSystemEntriesCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 836589D81F54A76200DC31F4 /* JSFileSystemEntriesCallback.h */; }; > 8367587F1C56E99B008A1087 /* JSHTMLDataElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 834B86A81C56E93E00F3F0E3 /* JSHTMLDataElement.h */; }; >@@ -7815,7 +7815,6 @@ > 510D4A31103165EE0049EA54 /* SocketStreamHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketStreamHandle.h; sourceTree = "<group>"; }; > 510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketStreamHandleClient.h; sourceTree = "<group>"; }; > 5110FCFB1E0362A5006F8D0B /* IDBCursorRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorRecord.h; sourceTree = "<group>"; }; >- 511E97A12063072A00AD4599 /* NavigationPolicyCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigationPolicyCheck.h; sourceTree = "<group>"; }; > 511EC1251C50AA570032F983 /* IDBSerialization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBSerialization.cpp; sourceTree = "<group>"; }; > 511EC1261C50AA570032F983 /* IDBSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBSerialization.h; sourceTree = "<group>"; }; > 511EC1291C50ABBA0032F983 /* SQLiteIDBTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLiteIDBTransaction.cpp; sourceTree = "<group>"; }; >@@ -9839,6 +9838,7 @@ > 835D54C11F4DE53400E60671 /* FileListCreator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileListCreator.cpp; sourceTree = "<group>"; }; > 835D54C21F4DE53400E60671 /* FileListCreator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileListCreator.h; sourceTree = "<group>"; }; > 835F8B261D2D90BA00E408EC /* Slotable.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Slotable.idl; sourceTree = "<group>"; }; >+ 8362E8BF20CEF9CB00245886 /* ShouldTreatAsContinuingLoad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShouldTreatAsContinuingLoad.h; sourceTree = "<group>"; }; > 836589D81F54A76200DC31F4 /* JSFileSystemEntriesCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileSystemEntriesCallback.h; sourceTree = "<group>"; }; > 836589D91F54A76200DC31F4 /* JSFileSystemDirectoryReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileSystemDirectoryReader.h; sourceTree = "<group>"; }; > 836589DA1F54A76200DC31F4 /* JSFileSystemEntriesCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileSystemEntriesCallback.cpp; sourceTree = "<group>"; }; >@@ -24231,7 +24231,6 @@ > 93CCF05F0AF6CA7600018E89 /* NavigationAction.cpp */, > 93CCF0260AF6C52900018E89 /* NavigationAction.h */, > 9BA827781F06156500F71E75 /* NavigationDisabler.h */, >- 511E97A12063072A00AD4599 /* NavigationPolicyCheck.h */, > 979F43D11075E44A0000F83B /* NavigationScheduler.cpp */, > 979F43D21075E44A0000F83B /* NavigationScheduler.h */, > 93E227DD0AF589AD00D48324 /* NetscapePlugInStreamLoader.cpp */, >@@ -24263,6 +24262,7 @@ > CBC2D22E1CE5B77D00D1880B /* ResourceTimingInformation.h */, > 286E4DCB2021048800315238 /* ServerTiming.cpp */, > 286E4DCC2021048800315238 /* ServerTiming.h */, >+ 8362E8BF20CEF9CB00245886 /* ShouldTreatAsContinuingLoad.h */, > 51327D5F11A33A2B004F9D65 /* SinkDocument.cpp */, > 51327D5E11A33A2B004F9D65 /* SinkDocument.h */, > D000ED2511C1B9CD00C47726 /* SubframeLoader.cpp */, >@@ -29447,7 +29447,6 @@ > 83B2D1751B8BCD6A00A02E47 /* NativeNodeFilter.h in Headers */, > E10B9B6C0B747599003ED890 /* NativeXPathNSResolver.h in Headers */, > 93CCF0270AF6C52900018E89 /* NavigationAction.h in Headers */, >- 511E97A32063074600AD4599 /* NavigationPolicyCheck.h in Headers */, > 979F43D41075E44A0000F83B /* NavigationScheduler.h in Headers */, > A9C6E5A60D746458006442E9 /* Navigator.h in Headers */, > E12719C70EEEC16800F61213 /* NavigatorBase.h in Headers */, >@@ -30149,6 +30148,7 @@ > 1A4A954E0B4EDCCB002D8C3C /* SharedBuffer.h in Headers */, > 834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */, > 93309EA3099EB78C0056E581 /* SharedTimer.h in Headers */, >+ 8362E8C120CEF9CB00245886 /* ShouldTreatAsContinuingLoad.h in Headers */, > E48944A3180B57D800F165D8 /* SimpleLineLayout.h in Headers */, > 11E067EE1E6246E500162D16 /* SimpleLineLayoutCoverage.h in Headers */, > 585D6E041A1A792E00FA4F12 /* SimpleLineLayoutFlowContents.h in Headers */, >diff --git a/Source/WebCore/history/BackForwardController.cpp b/Source/WebCore/history/BackForwardController.cpp >index 0f05bf65a35d607a68bb26ffdcf4f7762e449ae3..8e64995a4c1366d451dbf7ed27e61a9a6fcf6aaf 100644 >--- a/Source/WebCore/history/BackForwardController.cpp >+++ b/Source/WebCore/history/BackForwardController.cpp >@@ -27,8 +27,8 @@ > #include "BackForwardController.h" > > #include "BackForwardClient.h" >-#include "NavigationPolicyCheck.h" > #include "Page.h" >+#include "ShouldTreatAsContinuingLoad.h" > > namespace WebCore { > >@@ -70,7 +70,7 @@ void BackForwardController::goBackOrForward(int distance) > if (!item) > return; > >- m_page.goToItem(*item, FrameLoadType::IndexedBackForward, NavigationPolicyCheck::Require); >+ m_page.goToItem(*item, FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No); > } > > bool BackForwardController::goBack() >@@ -79,7 +79,7 @@ bool BackForwardController::goBack() > if (!item) > return false; > >- m_page.goToItem(*item, FrameLoadType::Back, NavigationPolicyCheck::Require); >+ m_page.goToItem(*item, FrameLoadType::Back, ShouldTreatAsContinuingLoad::No); > return true; > } > >@@ -89,7 +89,7 @@ bool BackForwardController::goForward() > if (!item) > return false; > >- m_page.goToItem(*item, FrameLoadType::Forward, NavigationPolicyCheck::Require); >+ m_page.goToItem(*item, FrameLoadType::Forward, ShouldTreatAsContinuingLoad::No); > return true; > } > >diff --git a/Source/WebCore/loader/FrameLoadRequest.h b/Source/WebCore/loader/FrameLoadRequest.h >index 049ba47ce481b4f8dd48c32f6ff780a31a3c523d..1297a761d7496a626f55c67c66405cbd707755c0 100644 >--- a/Source/WebCore/loader/FrameLoadRequest.h >+++ b/Source/WebCore/loader/FrameLoadRequest.h >@@ -60,8 +60,8 @@ public: > void setShouldCheckNewWindowPolicy(bool checkPolicy) { m_shouldCheckNewWindowPolicy = checkPolicy; } > bool shouldCheckNewWindowPolicy() const { return m_shouldCheckNewWindowPolicy; } > >- void setShouldCheckNavigationPolicy(bool checkPolicy) { m_shouldCheckNavigationPolicy = checkPolicy; } >- bool shouldCheckNavigationPolicy() const { return m_shouldCheckNavigationPolicy; } >+ void setShouldTreatAsContinuingLoad(bool value) { m_shouldTreatAsContinuingLoad = value; } >+ bool shouldTreatAsContinuingLoad() const { return m_shouldTreatAsContinuingLoad; } > > const SubstituteData& substituteData() const { return m_substituteData; } > void setSubstituteData(const SubstituteData& data) { m_substituteData = data; } >@@ -98,7 +98,7 @@ private: > SubstituteData m_substituteData; > > bool m_shouldCheckNewWindowPolicy { false }; >- bool m_shouldCheckNavigationPolicy { true }; >+ bool m_shouldTreatAsContinuingLoad { false }; > LockHistory m_lockHistory; > LockBackForwardList m_lockBackForwardList; > ShouldSendReferrer m_shouldSendReferrer; >diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp >index 3fb4f280fa06e80c63d549478782c4357bb549b7..ec4b361dcce7201444a303deb858532dc1951c1c 100644 >--- a/Source/WebCore/loader/FrameLoader.cpp >+++ b/Source/WebCore/loader/FrameLoader.cpp >@@ -87,7 +87,6 @@ > #include "MemoryCache.h" > #include "MemoryRelease.h" > #include "NavigationDisabler.h" >-#include "NavigationPolicyCheck.h" > #include "NavigationScheduler.h" > #include "Page.h" > #include "PageCache.h" >@@ -115,6 +114,7 @@ > #include "SegmentedString.h" > #include "SerializedScriptValue.h" > #include "Settings.h" >+#include "ShouldTreatAsContinuingLoad.h" > #include "SubframeLoader.h" > #include "SubresourceLoader.h" > #include "TextResourceDecoder.h" >@@ -969,7 +969,7 @@ void FrameLoader::loadURLIntoChildFrame(const URL& url, const String& referer, F > if (parentItem && parentItem->children().size() && isBackForwardLoadType(loadType()) && !m_frame.document()->loadEventFinished()) { > if (auto* childItem = parentItem->childItemWithTarget(childFrame->tree().uniqueName())) { > childFrame->loader().m_requestedHistoryItem = childItem; >- childFrame->loader().loadDifferentDocumentItem(*childItem, loadType(), MayAttemptCacheOnlyLoadForFormSubmissionItem, NavigationPolicyCheck::Require); >+ childFrame->loader().loadDifferentDocumentItem(*childItem, loadType(), MayAttemptCacheOnlyLoadForFormSubmissionItem, ShouldTreatAsContinuingLoad::No); > return; > } > } >@@ -1454,7 +1454,7 @@ void FrameLoader::load(FrameLoadRequest&& request) > addSameSiteInfoToRequestIfNeeded(loader->request()); > applyShouldOpenExternalURLsPolicyToNewDocumentLoader(m_frame, loader, request); > >- SetForScope<bool> currentLoadShouldCheckNavigationPolicyGuard(m_currentLoadShouldCheckNavigationPolicy, request.shouldCheckNavigationPolicy()); >+ SetForScope<bool> currentLoadShouldBeTreatedAsContinuingLoadGuard(m_currentLoadShouldBeTreatedAsContinuingLoad, request.shouldTreatAsContinuingLoad()); > load(loader.ptr()); > } > >@@ -1470,7 +1470,7 @@ void FrameLoader::loadWithNavigationAction(const ResourceRequest& request, const > if (m_documentLoader) > loader->setOverrideEncoding(m_documentLoader->overrideEncoding()); > >- loadWithDocumentLoader(loader.ptr(), type, WTFMove(formState), allowNavigationToInvalidURL, NavigationPolicyCheck::Require, WTFMove(completionHandler)); >+ loadWithDocumentLoader(loader.ptr(), type, WTFMove(formState), allowNavigationToInvalidURL, ShouldTreatAsContinuingLoad::No, WTFMove(completionHandler)); > } > > void FrameLoader::load(DocumentLoader* newDocumentLoader) >@@ -1509,10 +1509,10 @@ void FrameLoader::load(DocumentLoader* newDocumentLoader) > type = FrameLoadType::Reload; > } > >- loadWithDocumentLoader(newDocumentLoader, type, { }, AllowNavigationToInvalidURL::Yes, NavigationPolicyCheck::Require, [] { }); >+ loadWithDocumentLoader(newDocumentLoader, type, { }, AllowNavigationToInvalidURL::Yes, ShouldTreatAsContinuingLoad::No, [] { }); > } > >-void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType type, RefPtr<FormState>&& formState, AllowNavigationToInvalidURL allowNavigationToInvalidURL, NavigationPolicyCheck, CompletionHandler<void()>&& completionHandler) >+void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType type, RefPtr<FormState>&& formState, AllowNavigationToInvalidURL allowNavigationToInvalidURL, ShouldTreatAsContinuingLoad, CompletionHandler<void()>&& completionHandler) > { > // Retain because dispatchBeforeLoadEvent may release the last reference to it. > Ref<Frame> protect(m_frame); >@@ -1583,7 +1583,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t > > m_frame.navigationScheduler().cancel(true); > >- if (!m_currentLoadShouldCheckNavigationPolicy) { >+ if (m_currentLoadShouldBeTreatedAsContinuingLoad) { > continueLoadAfterNavigationPolicy(loader->request(), formState.get(), ShouldContinue::Yes, allowNavigationToInvalidURL); > return; > } >@@ -1697,7 +1697,7 @@ void FrameLoader::reloadWithOverrideEncoding(const String& encoding) > > loader->setOverrideEncoding(encoding); > >- loadWithDocumentLoader(loader.ptr(), FrameLoadType::Reload, { }, AllowNavigationToInvalidURL::Yes, NavigationPolicyCheck::Require, [] { }); >+ loadWithDocumentLoader(loader.ptr(), FrameLoadType::Reload, { }, AllowNavigationToInvalidURL::Yes, ShouldTreatAsContinuingLoad::No, [] { }); > } > > void FrameLoader::reload(OptionSet<ReloadOption> options) >@@ -1744,7 +1744,7 @@ void FrameLoader::reload(OptionSet<ReloadOption> options) > return FrameLoadType::Reload; > }; > >- loadWithDocumentLoader(loader.ptr(), frameLoadTypeForReloadOptions(options), { }, AllowNavigationToInvalidURL::Yes, NavigationPolicyCheck::Require, [] { }); >+ loadWithDocumentLoader(loader.ptr(), frameLoadTypeForReloadOptions(options), { }, AllowNavigationToInvalidURL::Yes, ShouldTreatAsContinuingLoad::No, [] { }); > } > > void FrameLoader::stopAllLoaders(ClearProvisionalItemPolicy clearProvisionalItemPolicy) >@@ -2752,6 +2752,9 @@ ResourceRequestCachePolicy FrameLoader::defaultRequestCachingPolicy(const Resour > > void FrameLoader::addExtraFieldsToRequest(ResourceRequest& request, FrameLoadType loadType, bool isMainResource) > { >+ if (m_currentLoadShouldBeTreatedAsContinuingLoad) >+ return; >+ > // Don't set the cookie policy URL if it's already been set. > // But make sure to set it on all requests regardless of protocol, as it has significance beyond the cookie policy (<rdar://problem/6616664>). > if (request.firstPartyForCookies().isEmpty()) { >@@ -2833,6 +2836,7 @@ void FrameLoader::addHTTPOriginIfNeeded(ResourceRequest& request, const String& > // server knows we support this feature. > > if (origin.isEmpty()) { >+ WTFReportBacktrace(); > // If we don't know what origin header to attach, we attach the value > // for an empty origin. > request.setHTTPOrigin(SecurityOrigin::createUnique()->toString()); >@@ -3553,14 +3557,14 @@ void FrameLoader::loadSameDocumentItem(HistoryItem& item) > // FIXME: This function should really be split into a couple pieces, some of > // which should be methods of HistoryController and some of which should be > // methods of FrameLoader. >-void FrameLoader::loadDifferentDocumentItem(HistoryItem& item, FrameLoadType loadType, FormSubmissionCacheLoadPolicy cacheLoadPolicy, NavigationPolicyCheck navigationPolicyCheck) >+void FrameLoader::loadDifferentDocumentItem(HistoryItem& item, FrameLoadType loadType, FormSubmissionCacheLoadPolicy cacheLoadPolicy, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad) > { > // Remember this item so we can traverse any child items as child frames load > history().setProvisionalItem(&item); > > auto initiatedByMainFrame = InitiatedByMainFrame::Unknown; > >- SetForScope<bool> currentLoadShouldCheckNavigationPolicyGuard(m_currentLoadShouldCheckNavigationPolicy, navigationPolicyCheck != NavigationPolicyCheck::Bypass); >+ SetForScope<bool> currentLoadShouldBeTreatedAsContinuingLoadGuard(m_currentLoadShouldBeTreatedAsContinuingLoad, shouldTreatAsContinuingLoad == ShouldTreatAsContinuingLoad::Yes); > > if (CachedPage* cachedPage = PageCache::singleton().get(item, m_frame.page())) { > auto documentLoader = cachedPage->documentLoader(); >@@ -3571,7 +3575,7 @@ void FrameLoader::loadDifferentDocumentItem(HistoryItem& item, FrameLoadType loa > documentLoader->setTriggeringAction(WTFMove(action)); > > documentLoader->setLastCheckedRequest(ResourceRequest()); >- loadWithDocumentLoader(documentLoader, loadType, { }, AllowNavigationToInvalidURL::Yes, navigationPolicyCheck, [] { }); >+ loadWithDocumentLoader(documentLoader, loadType, { }, AllowNavigationToInvalidURL::Yes, shouldTreatAsContinuingLoad, [] { }); > return; > } > >@@ -3663,7 +3667,7 @@ void FrameLoader::loadDifferentDocumentItem(HistoryItem& item, FrameLoadType loa > } > > // Loads content into this frame, as specified by history item >-void FrameLoader::loadItem(HistoryItem& item, FrameLoadType loadType, NavigationPolicyCheck navigationPolicyCheck) >+void FrameLoader::loadItem(HistoryItem& item, FrameLoadType loadType, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad) > { > m_requestedHistoryItem = &item; > HistoryItem* currentItem = history().currentItem(); >@@ -3672,7 +3676,7 @@ void FrameLoader::loadItem(HistoryItem& item, FrameLoadType loadType, Navigation > if (sameDocumentNavigation) > loadSameDocumentItem(item); > else >- loadDifferentDocumentItem(item, loadType, MayAttemptCacheOnlyLoadForFormSubmissionItem, navigationPolicyCheck); >+ loadDifferentDocumentItem(item, loadType, MayAttemptCacheOnlyLoadForFormSubmissionItem, shouldTreatAsContinuingLoad); > } > > void FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad() >@@ -3687,7 +3691,7 @@ void FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad() > HistoryItem& item = *history().provisionalItem(); > > stopAllLoaders(ShouldNotClearProvisionalItem); >- loadDifferentDocumentItem(item, loadType, MayNotAttemptCacheOnlyLoadForFormSubmissionItem, NavigationPolicyCheck::Require); >+ loadDifferentDocumentItem(item, loadType, MayNotAttemptCacheOnlyLoadForFormSubmissionItem, ShouldTreatAsContinuingLoad::No); > } > > ResourceError FrameLoader::cancelledError(const ResourceRequest& request) const >diff --git a/Source/WebCore/loader/FrameLoader.h b/Source/WebCore/loader/FrameLoader.h >index cd14755d14ac3a8b219c514f78971ea91c91b117..2588fca0ef007700ed06d1054826176fd07276d5 100644 >--- a/Source/WebCore/loader/FrameLoader.h >+++ b/Source/WebCore/loader/FrameLoader.h >@@ -80,8 +80,8 @@ class SharedBuffer; > class SubframeLoader; > class SubstituteData; > >-enum class NavigationPolicyCheck; > enum class ShouldContinue; >+enum class ShouldTreatAsContinuingLoad; > > struct WindowFeatures; > >@@ -128,7 +128,7 @@ public: > WEBCORE_EXPORT void reloadWithOverrideEncoding(const String& overrideEncoding); > > void open(CachedFrameBase&); >- void loadItem(HistoryItem&, FrameLoadType, NavigationPolicyCheck); >+ void loadItem(HistoryItem&, FrameLoadType, ShouldTreatAsContinuingLoad); > HistoryItem* requestedHistoryItem() const { return m_requestedHistoryItem.get(); } > > void retryAfterFailedCacheOnlyMainResourceLoad(); >@@ -324,7 +324,7 @@ private: > void checkCompletenessNow(); > > void loadSameDocumentItem(HistoryItem&); >- void loadDifferentDocumentItem(HistoryItem&, FrameLoadType, FormSubmissionCacheLoadPolicy, NavigationPolicyCheck); >+ void loadDifferentDocumentItem(HistoryItem&, FrameLoadType, FormSubmissionCacheLoadPolicy, ShouldTreatAsContinuingLoad); > > void loadProvisionalItemFromCachedPage(); > >@@ -367,7 +367,7 @@ private: > > void urlSelected(FrameLoadRequest&&, Event*); > >- void loadWithDocumentLoader(DocumentLoader*, FrameLoadType, RefPtr<FormState>&&, AllowNavigationToInvalidURL, NavigationPolicyCheck, CompletionHandler<void()>&&); // Calls continueLoadAfterNavigationPolicy >+ void loadWithDocumentLoader(DocumentLoader*, FrameLoadType, RefPtr<FormState>&&, AllowNavigationToInvalidURL, ShouldTreatAsContinuingLoad, CompletionHandler<void()>&&); // Calls continueLoadAfterNavigationPolicy > void load(DocumentLoader*); // Calls loadWithDocumentLoader > > void loadWithNavigationAction(const ResourceRequest&, const NavigationAction&, LockHistory, FrameLoadType, RefPtr<FormState>&&, AllowNavigationToInvalidURL, CompletionHandler<void()>&&); // Calls loadWithDocumentLoader >@@ -468,7 +468,7 @@ private: > std::optional<ResourceRequestCachePolicy> m_overrideCachePolicyForTesting; > std::optional<ResourceLoadPriority> m_overrideResourceLoadPriorityForTesting; > bool m_isStrictRawResourceValidationPolicyDisabledForTesting { false }; >- bool m_currentLoadShouldCheckNavigationPolicy { true }; >+ bool m_currentLoadShouldBeTreatedAsContinuingLoad { false }; > > bool m_checkingLoadCompleteForDetachment { false }; > >diff --git a/Source/WebCore/loader/HistoryController.cpp b/Source/WebCore/loader/HistoryController.cpp >index aef7b780e21fd830fe8e75ad48c60aadaba3ebe2..44c437e61ad500093ccb37922a637e5d469c622c 100644 >--- a/Source/WebCore/loader/HistoryController.cpp >+++ b/Source/WebCore/loader/HistoryController.cpp >@@ -43,12 +43,12 @@ > #include "FrameView.h" > #include "HistoryItem.h" > #include "Logging.h" >-#include "NavigationPolicyCheck.h" > #include "Page.h" > #include "PageCache.h" > #include "ScrollingCoordinator.h" > #include "SerializedScriptValue.h" > #include "SharedStringHash.h" >+#include "ShouldTreatAsContinuingLoad.h" > #include "VisitedLinkStore.h" > #include <wtf/text/CString.h> > >@@ -291,7 +291,7 @@ bool HistoryController::shouldStopLoadingForHistoryItem(HistoryItem& targetItem) > > // Main funnel for navigating to a previous location (back/forward, non-search snap-back) > // This includes recursion to handle loading into framesets properly >-void HistoryController::goToItem(HistoryItem& targetItem, FrameLoadType type, NavigationPolicyCheck navigationPolicyCheck) >+void HistoryController::goToItem(HistoryItem& targetItem, FrameLoadType type, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad) > { > LOG(History, "HistoryController %p goToItem %p type=%d", this, &targetItem, static_cast<int>(type)); > >@@ -326,14 +326,14 @@ void HistoryController::goToItem(HistoryItem& targetItem, FrameLoadType type, Na > recursiveSetProvisionalItem(targetItem, currentItem.get()); > > // Now that all other frames have provisional items, do the actual navigation. >- recursiveGoToItem(targetItem, currentItem.get(), type, navigationPolicyCheck); >+ recursiveGoToItem(targetItem, currentItem.get(), type, shouldTreatAsContinuingLoad); > } > > void HistoryController::setDefersLoading(bool defer) > { > m_defersLoading = defer; > if (!defer && m_deferredItem) { >- goToItem(*m_deferredItem, m_deferredFrameLoadType, NavigationPolicyCheck::Require); >+ goToItem(*m_deferredItem, m_deferredFrameLoadType, ShouldTreatAsContinuingLoad::No); > m_deferredItem = nullptr; > } > } >@@ -750,10 +750,10 @@ void HistoryController::recursiveSetProvisionalItem(HistoryItem& item, HistoryIt > > // We now traverse the frame tree and item tree a second time, loading frames that > // do have the content the item requests. >-void HistoryController::recursiveGoToItem(HistoryItem& item, HistoryItem* fromItem, FrameLoadType type, NavigationPolicyCheck navigationPolicyCheck) >+void HistoryController::recursiveGoToItem(HistoryItem& item, HistoryItem* fromItem, FrameLoadType type, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad) > { > if (!itemsAreClones(item, fromItem)) { >- m_frame.loader().loadItem(item, type, navigationPolicyCheck); >+ m_frame.loader().loadItem(item, type, shouldTreatAsContinuingLoad); > return; > } > >@@ -764,7 +764,7 @@ void HistoryController::recursiveGoToItem(HistoryItem& item, HistoryItem* fromIt > HistoryItem* fromChildItem = fromItem->childItemWithTarget(childFrameName); > ASSERT(fromChildItem); > if (Frame* childFrame = m_frame.tree().child(childFrameName)) >- childFrame->loader().history().recursiveGoToItem(childItem, fromChildItem, type, navigationPolicyCheck); >+ childFrame->loader().history().recursiveGoToItem(childItem, fromChildItem, type, shouldTreatAsContinuingLoad); > } > } > >diff --git a/Source/WebCore/loader/HistoryController.h b/Source/WebCore/loader/HistoryController.h >index 4535aaeb380d185c9a1119fb5884c58f30f590f5..4893440e560573d00e0e3ed394e62b2caa25f90c 100644 >--- a/Source/WebCore/loader/HistoryController.h >+++ b/Source/WebCore/loader/HistoryController.h >@@ -40,7 +40,7 @@ class Frame; > class HistoryItem; > class SerializedScriptValue; > >-enum class NavigationPolicyCheck; >+enum class ShouldTreatAsContinuingLoad; > > struct StringWithDirection; > >@@ -94,14 +94,14 @@ public: > private: > friend class Page; > bool shouldStopLoadingForHistoryItem(HistoryItem&) const; >- void goToItem(HistoryItem&, FrameLoadType, NavigationPolicyCheck); >+ void goToItem(HistoryItem&, FrameLoadType, ShouldTreatAsContinuingLoad); > > void initializeItem(HistoryItem&); > Ref<HistoryItem> createItem(); > Ref<HistoryItem> createItemTree(Frame& targetFrame, bool clipAtTarget); > > void recursiveSetProvisionalItem(HistoryItem&, HistoryItem*); >- void recursiveGoToItem(HistoryItem&, HistoryItem*, FrameLoadType, NavigationPolicyCheck); >+ void recursiveGoToItem(HistoryItem&, HistoryItem*, FrameLoadType, ShouldTreatAsContinuingLoad); > bool isReplaceLoadTypeWithProvisionalItem(FrameLoadType); > bool isReloadTypeWithProvisionalItem(FrameLoadType); > void recursiveUpdateForCommit(); >diff --git a/Source/WebCore/loader/NavigationPolicyCheck.h b/Source/WebCore/loader/NavigationPolicyCheck.h >deleted file mode 100644 >index 22178efdca8ed0da8e39a26de2ac5d86cb3c8b64..0000000000000000000000000000000000000000 >--- a/Source/WebCore/loader/NavigationPolicyCheck.h >+++ /dev/null >@@ -1,49 +0,0 @@ >-/* >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#include <wtf/EnumTraits.h> >- >-namespace WebCore { >- >-enum class NavigationPolicyCheck { >- Require, >- Bypass, >-}; >- >-} // namespace WebCore >- >-namespace WTF { >- >-template<> struct EnumTraits<WebCore::NavigationPolicyCheck> { >- using values = EnumValues< >- WebCore::NavigationPolicyCheck, >- WebCore::NavigationPolicyCheck::Require, >- WebCore::NavigationPolicyCheck::Bypass >- >; >-}; >- >-} // namespace WTF >diff --git a/Source/WebCore/loader/ShouldTreatAsContinuingLoad.h b/Source/WebCore/loader/ShouldTreatAsContinuingLoad.h >new file mode 100644 >index 0000000000000000000000000000000000000000..54ec9e5678236aa9ab26d51414f1a9ed2db9f830 >--- /dev/null >+++ b/Source/WebCore/loader/ShouldTreatAsContinuingLoad.h >@@ -0,0 +1,46 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include <wtf/EnumTraits.h> >+ >+namespace WebCore { >+ >+enum class ShouldTreatAsContinuingLoad { No, Yes }; >+ >+} // namespace WebCore >+ >+namespace WTF { >+ >+template<> struct EnumTraits<WebCore::ShouldTreatAsContinuingLoad> { >+ using values = EnumValues< >+ WebCore::ShouldTreatAsContinuingLoad, >+ WebCore::ShouldTreatAsContinuingLoad::No, >+ WebCore::ShouldTreatAsContinuingLoad::Yes >+ >; >+}; >+ >+} // namespace WTF >diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp >index 9e9defc8f4b2d74434bfa6a3e4a974f87244b51f..59a7876dd2bcb00ef667dd2dac5f4288b682050b 100644 >--- a/Source/WebCore/page/Page.cpp >+++ b/Source/WebCore/page/Page.cpp >@@ -476,7 +476,7 @@ void Page::setOpenedByDOM() > m_openedByDOM = true; > } > >-void Page::goToItem(HistoryItem& item, FrameLoadType type, NavigationPolicyCheck navigationPolicyCheck) >+void Page::goToItem(HistoryItem& item, FrameLoadType type, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad) > { > // stopAllLoaders may end up running onload handlers, which could cause further history traversals that may lead to the passed in HistoryItem > // being deref()-ed. Make sure we can still use it with HistoryController::goToItem later. >@@ -486,7 +486,7 @@ void Page::goToItem(HistoryItem& item, FrameLoadType type, NavigationPolicyCheck > if (frameLoader.history().shouldStopLoadingForHistoryItem(item)) > m_mainFrame->loader().stopAllLoadersAndCheckCompleteness(); > >- m_mainFrame->loader().history().goToItem(item, type, navigationPolicyCheck); >+ m_mainFrame->loader().history().goToItem(item, type, shouldTreatAsContinuingLoad); > } > > void Page::setGroupName(const String& name) >diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h >index 2b6328aa13f8dc14eadc8a3b805b11f4a1b2b42f..6b8482ad23e887f7d05561c075cf3b6b8be814b0 100644 >--- a/Source/WebCore/page/Page.h >+++ b/Source/WebCore/page/Page.h >@@ -156,8 +156,8 @@ enum class EventThrottlingBehavior { > > enum class CanWrap : bool; > enum class DidWrap : bool; >-enum class NavigationPolicyCheck; > enum class RouteSharingPolicy; >+enum class ShouldTreatAsContinuingLoad; > > class Page : public Supplementable<Page> { > WTF_MAKE_NONCOPYABLE(Page); >@@ -194,7 +194,7 @@ public: > bool openedByDOM() const; > void setOpenedByDOM(); > >- WEBCORE_EXPORT void goToItem(HistoryItem&, FrameLoadType, NavigationPolicyCheck); >+ WEBCORE_EXPORT void goToItem(HistoryItem&, FrameLoadType, ShouldTreatAsContinuingLoad); > > WEBCORE_EXPORT void setGroupName(const String&); > WEBCORE_EXPORT const String& groupName() const; >diff --git a/Source/WebKit/Shared/LoadParameters.cpp b/Source/WebKit/Shared/LoadParameters.cpp >index a6791efa074dfe50d59fe0a1ce6feea246d3d5fe..17d032a234ab671ce5ad00127df194060ec9b40d 100644 >--- a/Source/WebKit/Shared/LoadParameters.cpp >+++ b/Source/WebKit/Shared/LoadParameters.cpp >@@ -48,7 +48,7 @@ void LoadParameters::encode(IPC::Encoder& encoder) const > encoder << unreachableURLString; > encoder << provisionalLoadErrorURLString; > encoder << shouldOpenExternalURLsPolicy; >- encoder << shouldCheckNavigationPolicy; >+ encoder << shouldTreatAsContinuingLoad; > encoder << userData; > > platformEncode(encoder); >@@ -103,7 +103,7 @@ bool LoadParameters::decode(IPC::Decoder& decoder, LoadParameters& data) > if (!decoder.decode(data.shouldOpenExternalURLsPolicy)) > return false; > >- if (!decoder.decode(data.shouldCheckNavigationPolicy)) >+ if (!decoder.decode(data.shouldTreatAsContinuingLoad)) > return false; > > if (!decoder.decode(data.userData)) >diff --git a/Source/WebKit/Shared/LoadParameters.h b/Source/WebKit/Shared/LoadParameters.h >index 8402ddc85002a5aca0ce01f310caebab08f1fd5c..5a1b3484af5d9e86bab3671683c63149951ebaa7 100644 >--- a/Source/WebKit/Shared/LoadParameters.h >+++ b/Source/WebKit/Shared/LoadParameters.h >@@ -62,7 +62,7 @@ struct LoadParameters { > String provisionalLoadErrorURLString; > > uint64_t shouldOpenExternalURLsPolicy; >- bool shouldCheckNavigationPolicy { true }; >+ bool shouldTreatAsContinuingLoad { false }; > UserData userData; > > #if PLATFORM(COCOA) >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 792b455e86b716469ac6b5902c94d441f8c6e401..c1c961d82256a9b049516aeba8b59fad78b2f09d 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -136,13 +136,13 @@ > #include <WebCore/LengthBox.h> > #include <WebCore/MIMETypeRegistry.h> > #include <WebCore/MediaStreamRequest.h> >-#include <WebCore/NavigationPolicyCheck.h> > #include <WebCore/PerformanceLoggingClient.h> > #include <WebCore/PublicSuffix.h> > #include <WebCore/RenderEmbeddedObject.h> > #include <WebCore/SSLKeyGenerator.h> > #include <WebCore/SerializedCryptoKeyWrap.h> > #include <WebCore/SharedBuffer.h> >+#include <WebCore/ShouldTreatAsContinuingLoad.h> > #include <WebCore/TextCheckerClient.h> > #include <WebCore/TextIndicator.h> > #include <WebCore/URL.h> >@@ -794,7 +794,7 @@ RefPtr<API::Navigation> WebPageProxy::reattachToWebProcessForReload() > auto navigation = m_navigationState->createReloadNavigation(); > > // We allow stale content when reloading a WebProcess that's been killed or crashed. >- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), m_backForwardList->currentItem()->itemID(), FrameLoadType::IndexedBackForward, NavigationPolicyCheck::Require), m_pageID); >+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), m_backForwardList->currentItem()->itemID(), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No), m_pageID); > m_process->responsivenessTimer().start(); > > return WTFMove(navigation); >@@ -813,7 +813,7 @@ RefPtr<API::Navigation> WebPageProxy::reattachToWebProcessWithItem(WebBackForwar > > auto navigation = m_navigationState->createBackForwardNavigation(item, m_backForwardList->currentItem(), FrameLoadType::IndexedBackForward); > >- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item.itemID(), FrameLoadType::IndexedBackForward, NavigationPolicyCheck::Require), m_pageID); >+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item.itemID(), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No), m_pageID); > m_process->responsivenessTimer().start(); > > return WTFMove(navigation); >@@ -964,11 +964,11 @@ RefPtr<API::Navigation> WebPageProxy::loadRequest(ResourceRequest&& request, Sho > return nullptr; > > auto navigation = m_navigationState->createLoadRequestNavigation(ResourceRequest(request), m_backForwardList->currentItem()); >- loadRequestWithNavigation(navigation.get(), WTFMove(request), shouldOpenExternalURLsPolicy, userData, NavigationPolicyCheck::Require); >+ loadRequestWithNavigation(navigation.get(), WTFMove(request), shouldOpenExternalURLsPolicy, userData, ShouldTreatAsContinuingLoad::No); > return WTFMove(navigation); > } > >-void WebPageProxy::loadRequestWithNavigation(API::Navigation& navigation, ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData, NavigationPolicyCheck navigationPolicyCheck) >+void WebPageProxy::loadRequestWithNavigation(API::Navigation& navigation, ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad) > { > ASSERT(!m_isClosed); > >@@ -985,7 +985,7 @@ void WebPageProxy::loadRequestWithNavigation(API::Navigation& navigation, Resour > loadParameters.request = WTFMove(request); > loadParameters.shouldOpenExternalURLsPolicy = (uint64_t)shouldOpenExternalURLsPolicy; > loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get()); >- loadParameters.shouldCheckNavigationPolicy = navigationPolicyCheck == NavigationPolicyCheck::Require; >+ loadParameters.shouldTreatAsContinuingLoad = shouldTreatAsContinuingLoad == ShouldTreatAsContinuingLoad::Yes; > bool createdExtension = maybeInitializeSandboxExtensionHandle(url, loadParameters.sandboxExtensionHandle); > if (createdExtension) > m_process->willAcquireUniversalFileReadSandboxExtension(); >@@ -1290,7 +1290,7 @@ RefPtr<API::Navigation> WebPageProxy::goToBackForwardItem(WebBackForwardListItem > if (!m_backForwardList->currentItem()->itemIsInSameDocument(item)) > navigation = m_navigationState->createBackForwardNavigation(item, m_backForwardList->currentItem(), frameLoadType); > >- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation ? navigation->navigationID() : 0, item.itemID(), frameLoadType, NavigationPolicyCheck::Require), m_pageID); >+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation ? navigation->navigationID() : 0, item.itemID(), frameLoadType, ShouldTreatAsContinuingLoad::No), m_pageID); > m_process->responsivenessTimer().start(); > > return navigation; >@@ -2496,7 +2496,7 @@ void WebPageProxy::continueNavigationInNewProcess(API::Navigation& navigation, R > return &item != targetItem; > }); > m_process->send(Messages::WebPage::UpdateBackForwardListForReattach(WTFMove(itemStates)), m_pageID); >- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation.navigationID(), item->itemID(), *navigation.backForwardFrameLoadType(), NavigationPolicyCheck::Bypass), m_pageID); >+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation.navigationID(), item->itemID(), *navigation.backForwardFrameLoadType(), ShouldTreatAsContinuingLoad::Yes), m_pageID); > m_process->responsivenessTimer().start(); > > return; >@@ -2504,7 +2504,7 @@ void WebPageProxy::continueNavigationInNewProcess(API::Navigation& navigation, R > > // FIXME: Work out timing of responding with the last policy delegate, etc > ASSERT(!navigation.currentRequest().isEmpty()); >- loadRequestWithNavigation(navigation, ResourceRequest { navigation.currentRequest() }, WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, nullptr, NavigationPolicyCheck::Bypass); >+ loadRequestWithNavigation(navigation, ResourceRequest { navigation.currentRequest() }, WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, nullptr, ShouldTreatAsContinuingLoad::Yes); > > // Normally, notification of a server redirect comes from the WebContent process. > // If we are process swapping in response to a server redirect then that notification will not come from the new WebContent process. >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index 288a36d0d197e2419f4a930506c128f162cea56d..039250f193d27b8f7646fd01b48bf03b6cfb58a9 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -171,9 +171,9 @@ enum SelectionDirection : uint8_t; > > enum class AutoplayEvent; > enum class HasInsecureContent; >-enum class NavigationPolicyCheck; > enum class NotificationDirection; > enum class ShouldSample; >+enum class ShouldTreatAsContinuingLoad; > > struct ApplicationManifest; > struct BackForwardItemIdentifier; >@@ -1483,7 +1483,7 @@ private: > RefPtr<API::Navigation> reattachToWebProcessForReload(); > RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem&); > >- void loadRequestWithNavigation(API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::NavigationPolicyCheck); >+ void loadRequestWithNavigation(API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad); > > void requestNotificationPermission(uint64_t notificationID, const String& originString); > void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, WebCore::NotificationDirection, const String& originString, uint64_t notificationID); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index af6dc65af0454667c90c658830f77645d2f1e40c..43bd0c08708042f4505165744b85446d886e6ee7 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -1268,7 +1268,7 @@ void WebPage::loadRequest(LoadParameters&& loadParameters) > FrameLoadRequest frameLoadRequest { *m_mainFrame->coreFrame(), loadParameters.request, ShouldOpenExternalURLsPolicy::ShouldNotAllow }; > ShouldOpenExternalURLsPolicy externalURLsPolicy = static_cast<ShouldOpenExternalURLsPolicy>(loadParameters.shouldOpenExternalURLsPolicy); > frameLoadRequest.setShouldOpenExternalURLsPolicy(externalURLsPolicy); >- frameLoadRequest.setShouldCheckNavigationPolicy(loadParameters.shouldCheckNavigationPolicy); >+ frameLoadRequest.setShouldTreatAsContinuingLoad(loadParameters.shouldTreatAsContinuingLoad); > > corePage()->userInputBridge().loadRequest(WTFMove(frameLoadRequest)); > >@@ -1393,7 +1393,7 @@ void WebPage::reload(uint64_t navigationID, uint32_t reloadOptions, SandboxExten > } > } > >-void WebPage::goToBackForwardItem(uint64_t navigationID, const BackForwardItemIdentifier& backForwardItemID, FrameLoadType backForwardType, NavigationPolicyCheck navigationPolicyCheck) >+void WebPage::goToBackForwardItem(uint64_t navigationID, const BackForwardItemIdentifier& backForwardItemID, FrameLoadType backForwardType, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad) > { > SendStopResponsivenessTimer stopper; > >@@ -1409,7 +1409,7 @@ void WebPage::goToBackForwardItem(uint64_t navigationID, const BackForwardItemId > ASSERT(!m_pendingNavigationID); > m_pendingNavigationID = navigationID; > >- m_page->goToItem(*item, backForwardType, navigationPolicyCheck); >+ m_page->goToItem(*item, backForwardType, shouldTreatAsContinuingLoad); > } > > void WebPage::tryRestoreScrollPosition() >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index 63485fc8e7f1e347916c8a5e5741dbc33e0c1b1c..db22c16979d3c6da22c5f0e8313bb00bb3263da5 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -157,7 +157,7 @@ class URL; > class VisiblePosition; > > enum SyntheticClickType : int8_t; >-enum class NavigationPolicyCheck; >+enum class ShouldTreatAsContinuingLoad; > enum class TextIndicatorPresentationTransition : uint8_t; > > struct BackForwardItemIdentifier; >@@ -1160,7 +1160,7 @@ private: > void loadAlternateHTMLString(const LoadParameters&); > void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint); > void reload(uint64_t navigationID, uint32_t reloadOptions, SandboxExtension::Handle&&); >- void goToBackForwardItem(uint64_t navigationID, const WebCore::BackForwardItemIdentifier&, WebCore::FrameLoadType, WebCore::NavigationPolicyCheck); >+ void goToBackForwardItem(uint64_t navigationID, const WebCore::BackForwardItemIdentifier&, WebCore::FrameLoadType, WebCore::ShouldTreatAsContinuingLoad); > void tryRestoreScrollPosition(); > void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, CallbackID); > void updateIsInWindow(bool isInitialState = false); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >index d216f5bedac3067bbf06becc593a8a6d3bdbee1e..5e96a7be95fb43623bcf114af6f01e247a969eaa 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >@@ -139,7 +139,7 @@ messages -> WebPage LegacyReceiver { > ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity) > CenterSelectionInVisibleArea() > >- GoToBackForwardItem(uint64_t navigationID, struct WebCore::BackForwardItemIdentifier backForwardItemID, enum WebCore::FrameLoadType backForwardType, enum WebCore::NavigationPolicyCheck navigationPolicyCheck) >+ GoToBackForwardItem(uint64_t navigationID, struct WebCore::BackForwardItemIdentifier backForwardItemID, enum WebCore::FrameLoadType backForwardType, enum WebCore::ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad) > TryRestoreScrollPosition() > > LoadURLInFrame(WebCore::URL url, uint64_t frameID) >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index 4077e91ab12d7fb07b740cd0591e29b6fda81ad3..bdf97e78eeaa9ff7d288025562fccedaba1f7bc8 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -173,7 +173,6 @@ > #import <WebCore/MIMETypeRegistry.h> > #import <WebCore/MemoryCache.h> > #import <WebCore/MemoryRelease.h> >-#import <WebCore/NavigationPolicyCheck.h> > #import <WebCore/NetworkStorageSession.h> > #import <WebCore/NodeList.h> > #import <WebCore/Notification.h> >@@ -198,6 +197,7 @@ > #import <WebCore/SecurityOrigin.h> > #import <WebCore/SecurityPolicy.h> > #import <WebCore/Settings.h> >+#import <WebCore/ShouldTreatAsContinuingLoad.h> > #import <WebCore/SocketProvider.h> > #import <WebCore/StyleProperties.h> > #import <WebCore/TextResourceDecoder.h> >@@ -2637,7 +2637,7 @@ - (void)_loadBackForwardListFromOtherView:(WebView *)otherView > } > > ASSERT(newItemToGoTo); >- _private->page->goToItem(*newItemToGoTo, FrameLoadType::IndexedBackForward, NavigationPolicyCheck::Require); >+ _private->page->goToItem(*newItemToGoTo, FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No); > } > > - (void)_setFormDelegate: (id<WebFormDelegate>)delegate >@@ -6463,7 +6463,7 @@ - (BOOL)goToBackForwardItem:(WebHistoryItem *)item > return NO; > > ASSERT(item); >- _private->page->goToItem(*core(item), FrameLoadType::IndexedBackForward, NavigationPolicyCheck::Require); >+ _private->page->goToItem(*core(item), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No); > return YES; > } > >diff --git a/Source/WebKitLegacy/win/WebView.cpp b/Source/WebKitLegacy/win/WebView.cpp >index 34366ea264a5df0e63fcf21702b5578dc51999bf..c9e52137df1f2c5d99215f702afbc69872fd419f 100644 >--- a/Source/WebKitLegacy/win/WebView.cpp >+++ b/Source/WebKitLegacy/win/WebView.cpp >@@ -126,7 +126,6 @@ > #include <WebCore/MIMETypeRegistry.h> > #include <WebCore/MemoryCache.h> > #include <WebCore/MemoryRelease.h> >-#include <WebCore/NavigationPolicyCheck.h> > #include <WebCore/NetworkStorageSession.h> > #include <WebCore/NotImplemented.h> > #include <WebCore/Page.h> >@@ -157,6 +156,7 @@ > #include <WebCore/SecurityOrigin.h> > #include <WebCore/SecurityPolicy.h> > #include <WebCore/Settings.h> >+#include <WebCore/ShouldTreatAsContinuingLoad.h> > #include <WebCore/SocketProvider.h> > #include <WebCore/SubframeLoader.h> > #include <WebCore/SystemInfo.h> >@@ -3438,7 +3438,7 @@ HRESULT WebView::goToBackForwardItem(_In_opt_ IWebHistoryItem* item, _Out_ BOOL* > if (FAILED(hr)) > return hr; > >- m_page->goToItem(*webHistoryItem->historyItem(), FrameLoadType::IndexedBackForward, NavigationPolicyCheck::Require); >+ m_page->goToItem(*webHistoryItem->historyItem(), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No); > *succeeded = TRUE; > > return S_OK; >@@ -5975,7 +5975,7 @@ HRESULT WebView::loadBackForwardListFromOtherView(_In_opt_ IWebView* otherView) > } > > ASSERT(newItemToGoTo); >- m_page->goToItem(*newItemToGoTo, FrameLoadType::IndexedBackForward, NavigationPolicyCheck::Require); >+ m_page->goToItem(*newItemToGoTo, FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No); > return S_OK; > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 856584f94ece567d52676979ca87e8ac4c31af72..0150053de5ea6f64c92cb50907f698dead6a8d58 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-06-11 Chris Dumez <cdumez@apple.com> >+ >+ http/tests/security/cors-post-redirect-307.html fails with PSON enabled >+ https://bugs.webkit.org/show_bug.cgi?id=186441 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add layout test coverage. >+ >+ * http/tests/security/cors-post-redirect-307-pson-expected.txt: Added. >+ * http/tests/security/cors-post-redirect-307-pson.html: Added. >+ > 2018-06-11 Antti Koivisto <antti@apple.com> > > REGRESSION (Mojave): LayoutTest http/tests/cache/disk-cache/disk-cache-media-small.html is failing >diff --git a/LayoutTests/http/tests/security/cors-post-redirect-307-pson-expected.txt b/LayoutTests/http/tests/security/cors-post-redirect-307-pson-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..5ac1a76c4ce10678688a2c51ede542d5fb8b9cc9 >--- /dev/null >+++ b/LayoutTests/http/tests/security/cors-post-redirect-307-pson-expected.txt >@@ -0,0 +1 @@ >+There was no origin header >diff --git a/LayoutTests/http/tests/security/cors-post-redirect-307-pson.html b/LayoutTests/http/tests/security/cors-post-redirect-307-pson.html >new file mode 100644 >index 0000000000000000000000000000000000000000..133ff75c5a48451a64afbd00485d50ddfb58c114 >--- /dev/null >+++ b/LayoutTests/http/tests/security/cors-post-redirect-307-pson.html >@@ -0,0 +1,25 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ enableProcessSwapOnNavigation=true ] --> >+<head> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ testRunner.dumpAsText(); >+} >+</script> >+</head> >+<body> >+ >+This test is designed to work only when loaded from http://127.0.0.1:8000 >+ >+<form id='testForm' method='POST'> >+<input id='redircode' type='hidden' name='redircode' value='307'> >+</form> >+ >+<script> >+ >+var form = document.getElementById('testForm'); >+form.action = "/resources/redirect.php?code=307&url=http://localhost:8000/security/resources/cors-post-redirect-target.php"; >+form.submit(); >+ >+</script> >+</body>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186441
:
342325
|
342330
|
342332
|
342454
|
342461