Changeset 270273 in webkit
- Timestamp:
- Nov 30, 2020 3:43:42 PM (20 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 18 edited
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/loader/EmptyFrameLoaderClient.h (modified) (1 diff)
-
Source/WebCore/loader/FrameLoader.cpp (modified) (1 diff)
-
Source/WebCore/loader/FrameLoaderClient.h (modified) (1 diff)
-
Source/WebCore/page/Chrome.cpp (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (modified) (2 diffs)
-
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (modified) (1 diff)
-
Source/WebKitLegacy/mac/ChangeLog (modified) (1 diff)
-
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h (modified) (1 diff)
-
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm (modified) (1 diff)
-
Source/WebKitLegacy/win/ChangeLog (modified) (1 diff)
-
Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp (modified) (1 diff)
-
Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (modified) (6 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/SessionStorage.mm (added)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/alert.html (added)
-
Tools/TestWebKitAPI/cocoa/TestUIDelegate.h (modified) (1 diff)
-
Tools/TestWebKitAPI/cocoa/TestUIDelegate.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r270269 r270273 1 2020-11-30 Chris Dumez <cdumez@apple.com> 2 3 sessionStorage should not be cloned when a window is opened with rel=noopener 4 https://bugs.webkit.org/show_bug.cgi?id=218804 5 <rdar://problem/71286606> 6 7 Reviewed by Alex Christensen. 8 9 sessionStorage should not be cloned when a window is opened with rel=noopener, as per: 10 - https://html.spec.whatwg.org/multipage/browsers.html#copy-session-storage 11 12 Both Firefox and Chrome have already implemented this behavior. 13 14 * loader/EmptyFrameLoaderClient.h: 15 * loader/FrameLoader.cpp: 16 (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): 17 * loader/FrameLoaderClient.h: 18 * page/Chrome.cpp: 19 (WebCore::Chrome::createWindow const): 20 1 21 2020-11-30 Alex Christensen <achristensen@webkit.org> 2 22 -
trunk/Source/WebCore/loader/EmptyFrameLoaderClient.h
r269612 r270273 96 96 void dispatchDidReachVisuallyNonEmptyState() final { } 97 97 98 Frame* dispatchCreatePage(const NavigationAction& ) final { return nullptr; }98 Frame* dispatchCreatePage(const NavigationAction&, NewFrameOpenerPolicy) final { return nullptr; } 99 99 void dispatchShow() final { } 100 100 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r269983 r270273 3524 3524 3525 3525 Ref<Frame> frame(m_frame); 3526 RefPtr<Frame> mainFrame = m_client->dispatchCreatePage(action );3526 RefPtr<Frame> mainFrame = m_client->dispatchCreatePage(action, openerPolicy); 3527 3527 if (!mainFrame) 3528 3528 return; -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r269612 r270273 188 188 virtual void dispatchDidReachVisuallyNonEmptyState() { } 189 189 190 virtual Frame* dispatchCreatePage(const NavigationAction& ) = 0;190 virtual Frame* dispatchCreatePage(const NavigationAction&, NewFrameOpenerPolicy) = 0; 191 191 virtual void dispatchShow() = 0; 192 192 -
trunk/Source/WebCore/page/Chrome.cpp
r269710 r270273 194 194 return nullptr; 195 195 196 if (auto* oldSessionStorage = m_page.sessionStorage(false)) 197 newPage->setSessionStorage(oldSessionStorage->copy(*newPage)); 196 if (!features.noopener && !features.noreferrer) { 197 if (auto* oldSessionStorage = m_page.sessionStorage(false)) 198 newPage->setSessionStorage(oldSessionStorage->copy(*newPage)); 199 } 198 200 199 201 return newPage; -
trunk/Source/WebKit/ChangeLog
r270256 r270273 1 2020-11-30 Chris Dumez <cdumez@apple.com> 2 3 sessionStorage should not be cloned when a window is opened with rel=noopener 4 https://bugs.webkit.org/show_bug.cgi?id=218804 5 <rdar://problem/71286606> 6 7 Reviewed by Alex Christensen. 8 9 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 10 (WebKit::WebFrameLoaderClient::dispatchCreatePage): 11 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 12 1 13 2020-11-30 Youenn Fablet <youenn@apple.com> 2 14 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r269712 r270273 785 785 } 786 786 787 Frame* WebFrameLoaderClient::dispatchCreatePage(const NavigationAction& navigationAction )787 Frame* WebFrameLoaderClient::dispatchCreatePage(const NavigationAction& navigationAction, NewFrameOpenerPolicy newFrameOpenerPolicy) 788 788 { 789 789 WebPage* webPage = m_frame->page(); … … 792 792 793 793 // Just call through to the chrome client. 794 Page* newPage = webPage->corePage()->chrome().createWindow(*m_frame->coreFrame(), { }, navigationAction); 794 WindowFeatures windowFeatures; 795 windowFeatures.noopener = newFrameOpenerPolicy == NewFrameOpenerPolicy::Suppress; 796 Page* newPage = webPage->corePage()->chrome().createWindow(*m_frame->coreFrame(), windowFeatures, navigationAction); 795 797 if (!newPage) 796 798 return nullptr; -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r269612 r270273 127 127 void dispatchDidLayout() final; 128 128 129 WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction& ) final;129 WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&, WebCore::NewFrameOpenerPolicy) final; 130 130 void dispatchShow() final; 131 131 -
trunk/Source/WebKitLegacy/mac/ChangeLog
r270152 r270273 1 2020-11-30 Chris Dumez <cdumez@apple.com> 2 3 sessionStorage should not be cloned when a window is opened with rel=noopener 4 https://bugs.webkit.org/show_bug.cgi?id=218804 5 <rdar://problem/71286606> 6 7 Reviewed by Alex Christensen. 8 9 * WebCoreSupport/WebFrameLoaderClient.h: 10 * WebCoreSupport/WebFrameLoaderClient.mm: 11 (WebFrameLoaderClient::dispatchCreatePage): 12 1 13 2020-11-21 Simon Fraser <simon.fraser@apple.com> 2 14 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h
r269612 r270273 123 123 void dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>) final; 124 124 125 WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction& ) final;125 WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&, WebCore::NewFrameOpenerPolicy) final; 126 126 void dispatchShow() final; 127 127 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
r269612 r270273 834 834 } 835 835 836 WebCore::Frame* WebFrameLoaderClient::dispatchCreatePage(const WebCore::NavigationAction& )836 WebCore::Frame* WebFrameLoaderClient::dispatchCreatePage(const WebCore::NavigationAction&, WebCore::NewFrameOpenerPolicy) 837 837 { 838 838 WebView *currentWebView = getWebView(m_webFrame.get()); -
trunk/Source/WebKitLegacy/win/ChangeLog
r270071 r270273 1 2020-11-30 Chris Dumez <cdumez@apple.com> 2 3 sessionStorage should not be cloned when a window is opened with rel=noopener 4 https://bugs.webkit.org/show_bug.cgi?id=218804 5 <rdar://problem/71286606> 6 7 Reviewed by Alex Christensen. 8 9 * WebCoreSupport/WebFrameLoaderClient.cpp: 10 (WebFrameLoaderClient::dispatchCreatePage): 11 * WebCoreSupport/WebFrameLoaderClient.h: 12 1 13 2020-11-19 Fujii Hironori <Hironori.Fujii@sony.com> 2 14 -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp
r269612 r270273 497 497 } 498 498 499 Frame* WebFrameLoaderClient::dispatchCreatePage(const NavigationAction& navigationAction )499 Frame* WebFrameLoaderClient::dispatchCreatePage(const NavigationAction& navigationAction, NewFrameOpenerPolicy) 500 500 { 501 501 WebView* webView = m_webFrame->webView(); -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h
r269612 r270273 112 112 bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length) override; 113 113 114 WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction& ) override;114 WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&, WebCore::NewFrameOpenerPolicy) override; 115 115 void dispatchShow() override; 116 116 -
trunk/Tools/ChangeLog
r270268 r270273 1 2020-11-30 Chris Dumez <cdumez@apple.com> 2 3 sessionStorage should not be cloned when a window is opened with rel=noopener 4 https://bugs.webkit.org/show_bug.cgi?id=218804 5 <rdar://problem/71286606> 6 7 Reviewed by Alex Christensen. 8 9 Add API test coverage. 10 11 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 12 * TestWebKitAPI/Tests/WebKitCocoa/SessionStorage.mm: Added. 13 (-[SessionStorageUIDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]): 14 (-[SessionStorageUIDelegate webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:]): 15 (createAndInitializeTestWebView): 16 (checkSessionStorageInNewWindow): 17 (TEST): 18 * TestWebKitAPI/Tests/WebKitCocoa/confirm.html: Added. 19 1 20 2020-11-30 Jonathan Bedard <jbedard@apple.com> 2 21 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r270002 r270273 260 260 468F2F942368DAF100F4B864 /* window-open-then-document-open.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 468F2F932368DAA700F4B864 /* window-open-then-document-open.html */; }; 261 261 46918EFC2237283C00468DFE /* DeviceOrientation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46918EFB2237283500468DFE /* DeviceOrientation.mm */; }; 262 46A46A1A2575645600A1B118 /* SessionStorage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A46A192575645600A1B118 /* SessionStorage.mm */; }; 262 263 46A911592108E6780078D40D /* CustomUserAgent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A911582108E66B0078D40D /* CustomUserAgent.mm */; }; 263 264 46AE5A3720F9066D00E0873E /* SimpleServiceWorkerRegistrations-4.sqlite3 in Copy Resources */ = {isa = PBXBuildFile; fileRef = 4656A75720F9054F0002E21F /* SimpleServiceWorkerRegistrations-4.sqlite3 */; }; 265 46C1EA9825758820005E409E /* alert.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 46C1EA9725758805005E409E /* alert.html */; }; 264 266 46C3AEB323D0E529001B0680 /* beforeunload.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 46C3AEB223D0E50F001B0680 /* beforeunload.html */; }; 265 267 46C519DA1D355AB200DAA51A /* LocalStorageNullEntries.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46C519D81D355A7300DAA51A /* LocalStorageNullEntries.mm */; }; … … 1295 1297 725C3EF322058A5B007C36FC /* AdditionalSupportedImageTypes.html in Copy Resources */, 1296 1298 1C2B81871C8925A000A5529F /* Ahem.ttf in Copy Resources */, 1299 46C1EA9825758820005E409E /* alert.html in Copy Resources */, 1297 1300 1A63479F183D72A4005B1707 /* all-content-in-one-iframe.html in Copy Resources */, 1298 1301 C25CCA0D1E5141840026CB8A /* AllAhem.svg in Copy Resources */, … … 1991 1994 468F2F932368DAA700F4B864 /* window-open-then-document-open.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "window-open-then-document-open.html"; sourceTree = "<group>"; }; 1992 1995 46918EFB2237283500468DFE /* DeviceOrientation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DeviceOrientation.mm; sourceTree = "<group>"; }; 1996 46A46A192575645600A1B118 /* SessionStorage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SessionStorage.mm; sourceTree = "<group>"; }; 1993 1997 46A911582108E66B0078D40D /* CustomUserAgent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CustomUserAgent.mm; sourceTree = "<group>"; }; 1998 46C1EA9725758805005E409E /* alert.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = alert.html; sourceTree = "<group>"; }; 1994 1999 46C3AEB223D0E50F001B0680 /* beforeunload.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = beforeunload.html; sourceTree = "<group>"; }; 1995 2000 46C519D81D355A7300DAA51A /* LocalStorageNullEntries.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalStorageNullEntries.mm; sourceTree = "<group>"; }; … … 3386 3391 51EB12931FDF050500A5A1BD /* ServiceWorkerBasic.mm */, 3387 3392 5C683471235ACC7C0041E6B1 /* ServiceWorkerTCPServer.h */, 3393 46A46A192575645600A1B118 /* SessionStorage.mm */, 3388 3394 5CCB10DF2134579D00AC5AF0 /* ShouldGoToBackForwardListItem.mm */, 3389 3395 37BCA61B1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm */, … … 3718 3724 55A817FD218101DF0004A39A /* 400x400-green.png */, 3719 3725 F4CFCDD9249FC9D900527482 /* Ahem.ttf */, 3726 46C1EA9725758805005E409E /* alert.html */, 3720 3727 C25CCA0C1E5140E50026CB8A /* AllAhem.svg */, 3721 3728 F4A9202E1FEE34C800F59590 /* apple-data-url.html */, … … 5454 5461 5769C50B1D9B0002000847FB /* SerializedCryptoKeyWrap.mm in Sources */, 5455 5462 51EB12941FDF052500A5A1BD /* ServiceWorkerBasic.mm in Sources */, 5463 46A46A1A2575645600A1B118 /* SessionStorage.mm in Sources */, 5456 5464 7CCE7ECB1A411A7E00447C4C /* SetAndUpdateCacheModel.mm in Sources */, 5457 5465 7CCE7ECC1A411A7E00447C4C /* SetDocumentURI.mm in Sources */, -
trunk/Tools/TestWebKitAPI/cocoa/TestUIDelegate.h
r266654 r270273 28 28 @interface TestUIDelegate : NSObject <WKUIDelegate> 29 29 30 @property (nonatomic, copy) WKWebView* (^createWebViewWithConfiguration)(WKWebViewConfiguration *, WKNavigationAction *, WKWindowFeatures *); 30 31 @property (nonatomic, copy) void (^runJavaScriptAlertPanelWithMessage)(WKWebView *, NSString *, WKFrameInfo *, void (^)(void)); 31 32 #if PLATFORM(MAC) -
trunk/Tools/TestWebKitAPI/cocoa/TestUIDelegate.mm
r266654 r270273 32 32 33 33 @implementation TestUIDelegate 34 35 - (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures 36 { 37 if (_createWebViewWithConfiguration) 38 return _createWebViewWithConfiguration(configuration, navigationAction, windowFeatures); 39 return nil; 40 } 34 41 35 42 - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler
Note: See TracChangeset
for help on using the changeset viewer.