Changeset 273817 in webkit
- Timestamp:
- Mar 3, 2021, 8:55:05 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/bindings/js/JSWindowProxy.cpp (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r273773 r273817 1 2021-03-03 Youenn Fablet <youenn@apple.com> 2 3 WebKitLegacy needs to keep JSDOMWindow even though it is used while its origin is not set 4 https://bugs.webkit.org/show_bug.cgi?id=222589 5 <rdar://problem/74258258> 6 7 Reviewed by Geoffrey Garen. 8 9 * Scripts/Preferences/WebPreferencesInternal.yaml: 10 Introduce a flag, on for WebKit and off for WebKitLegacy. 11 1 12 2021-03-02 Simon Fraser <simon.fraser@apple.com> 2 13 -
trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml
r273773 r273817 886 886 default: true 887 887 888 WindowObjectAlwaysInitializedWithSecurityOriginEnabled: 889 type: bool 890 humanReadableName: "Ensure Window object is initialized with a security origin" 891 humanReadableDescription: "Ensure Window object is initialized with a security origin" 892 defaultValue: 893 WebKitLegacy: 894 default: false 895 WebKit: 896 default: true 897 WebCore: 898 default: true 899 888 900 ZoomOnDoubleTapWhenRoot: 889 901 type: bool -
trunk/Source/WebCore/ChangeLog
r273815 r273817 1 2021-03-03 Youenn Fablet <youenn@apple.com> 2 3 WebKitLegacy needs to keep JSDOMWindow even though it is used while its origin is not set 4 https://bugs.webkit.org/show_bug.cgi?id=222589 5 <rdar://problem/74258258> 6 7 Reviewed by Geoffrey Garen. 8 9 Use the new flag to allow reuse of JSDOMWindow objects even though they are created at a time where its SecurityOrigin is not set yet. 10 This allows keeping WebKitLegacy existing functionality. 11 12 Covered by API test. 13 14 * bindings/js/JSWindowProxy.cpp: 15 (WebCore::JSWindowProxy::setWindow): 16 1 17 2021-03-03 Zalan Bujtas <zalan@apple.com> 2 18 -
trunk/Source/WebCore/bindings/js/JSWindowProxy.cpp
r271642 r273817 107 107 auto& windowStructure = *JSDOMWindow::createStructure(vm, nullptr, prototype); 108 108 window = JSDOMWindow::create(vm, &windowStructure, localWindow, this); 109 if (!localWindow.document()->haveInitializedSecurityOrigin() )109 if (!localWindow.document()->haveInitializedSecurityOrigin() && localWindow.document()->settings().windowObjectAlwaysInitializedWithSecurityOriginEnabled()) 110 110 localWindow.setAsWrappedWithoutInitializedSecurityOrigin(); 111 111 } -
trunk/Tools/ChangeLog
r273814 r273817 1 2021-03-03 Youenn Fablet <youenn@apple.com> 2 3 WebKitLegacy needs to keep JSDOMWindow even though it is used while its origin is not set 4 https://bugs.webkit.org/show_bug.cgi?id=222589 5 <rdar://problem/74258258> 6 7 Reviewed by Geoffrey Garen. 8 9 * TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm: 10 (TestWebKitAPI::TEST): 11 1 12 2021-03-03 Don Olmstead <don.olmstead@sony.com> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm
r236032 r273817 27 27 #import "PlatformUtilities.h" 28 28 #import <WebKit/WebFramePrivate.h> 29 #import <WebKit/WebPreferencesPrivate.h> 29 30 #import <WebKit/WebScriptWorld.h> 30 31 #import <JavaScriptCore/JSContextRef.h> … … 96 97 } 97 98 99 TEST(WebKitLegacy, JSDOMWindowWrapperBeforeOriginInitialization) 100 { 101 auto webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]); 102 auto frameLoadDelegate = adoptNS([[JSWrapperForNodeFrameLoadDelegate alloc] init]); 103 104 webView.get().frameLoadDelegate = frameLoadDelegate.get(); 105 auto *mainFrame = webView.get().mainFrame; 106 [mainFrame loadHTMLString:@"<div id=\"target\"</div>" baseURL:[NSURL URLWithString:@"http://localhost"]]; 107 108 auto *normalWorld = [WebScriptWorld standardWorld]; 109 auto normalCtx = [mainFrame _globalContextForScriptWorld:normalWorld]; 110 111 [mainFrame _stringByEvaluatingJavaScriptFromString:@"window.caches = 1" withGlobalObject:JSContextGetGlobalObject(normalCtx) inScriptWorld:normalWorld]; 112 113 auto result = [mainFrame _stringByEvaluatingJavaScriptFromString:@"window.caches" withGlobalObject:JSContextGetGlobalObject(normalCtx) inScriptWorld:normalWorld]; 114 EXPECT_WK_STREQ(result, @"1"); 115 116 Util::run(&didFinishLoad); 117 118 result = [mainFrame _stringByEvaluatingJavaScriptFromString:@"window.caches" withGlobalObject:JSContextGetGlobalObject(normalCtx) inScriptWorld:normalWorld]; 119 EXPECT_WK_STREQ(result, @"1"); 120 } 121 98 122 } // namespace TestWebKitAPI
Note:
See TracChangeset
for help on using the changeset viewer.