Changeset 292229 in webkit
- Timestamp:
- Apr 1, 2022 12:26:41 PM (4 months ago)
- Location:
- trunk
- Files:
-
- 5 added
- 8 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/allow-wasm-after-window-open-expected.txt (added)
-
LayoutTests/http/tests/security/contentSecurityPolicy/allow-wasm-after-window-open.html (added)
-
LayoutTests/http/tests/security/contentSecurityPolicy/resources/load_wasm.js (added)
-
LayoutTests/http/tests/security/contentSecurityPolicy/resources/run-web-assembly.html (added)
-
LayoutTests/http/tests/security/contentSecurityPolicy/resources/wasm-builder.js (added)
-
LayoutTests/platform/win/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/bindings/js/ScriptController.cpp (modified) (1 diff)
-
Source/WebCore/bindings/js/ScriptController.h (modified) (1 diff)
-
Source/WebCore/dom/Document.cpp (modified) (2 diffs)
-
Source/WebCore/loader/FrameLoader.cpp (modified) (1 diff)
-
Source/WebCore/page/csp/ContentSecurityPolicy.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r292226 r292229 1 2022-04-01 Kate Cheney <katherine_cheney@apple.com> 2 3 CSP: WASM fails to execute after window.open 4 https://bugs.webkit.org/show_bug.cgi?id=238562 5 <rdar://problem/90778752> 6 7 Reviewed by Brent Fulgham. 8 9 Layout test coverage. Copy some wasm helper scripts into the http directory. 10 11 * platform/win/TestExpectations: 12 We don't support wasm on win. 13 14 * http/tests/security/contentSecurityPolicy/allow-wasm-after-window-open-expected.txt: Added. 15 * http/tests/security/contentSecurityPolicy/allow-wasm-after-window-open.html: Added. 16 * http/tests/security/contentSecurityPolicy/resources/load_wasm.js: Added. 17 (createWasmModule): 18 * http/tests/security/contentSecurityPolicy/resources/run-web-assembly.html: Added. 19 * http/tests/security/contentSecurityPolicy/resources/wasm-builder.js: Added. 20 (const._fail): 21 (const.isNotA.assert.isNotA): 22 (const): 23 (switch.typeof): 24 (Builder): 25 (Builder.prototype.setChecked): 26 (Builder.prototype.setPreamble): 27 (Builder.prototype._functionIndexSpaceKeyHash): 28 (Builder.prototype._registerFunctionToIndexSpace): 29 (Builder.prototype._getFunctionFromIndexSpace): 30 (Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.case.string_appeared_here.this.section): 31 (Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.const.codeBuilder.End.switch.case.string_appeared_here.e): 32 (Builder.prototype._registerSectionBuilders.this.Unknown): 33 1 34 2022-04-01 Alan Bujtas <zalan@apple.com> 2 35 -
trunk/LayoutTests/platform/win/TestExpectations
r292086 r292229 3902 3902 imported/w3c/web-platform-tests/wasm/wasm_stream_instantiate_test.html [ Skip ] 3903 3903 imported/w3c/web-platform-tests/wasm/wasm_stream_compile_test.html [ Skip ] 3904 http/tests/security/contentSecurityPolicy/allow-wasm-after-window-open.html [ Skip ] 3904 3905 3905 3906 # Animated image throttling behaves differently on WK1. -
trunk/Source/WebCore/ChangeLog
r292228 r292229 1 2022-04-01 Kate Cheney <katherine_cheney@apple.com> 2 3 CSP: WASM fails to execute after window.open 4 https://bugs.webkit.org/show_bug.cgi?id=238562 5 <rdar://problem/90778752> 6 7 Reviewed by Brent Fulgham. 8 9 Test: http/tests/security/contentSecurityPolicy/allow-wasm-after-window-open.html 10 11 Reset WASM enabled value after a window.open() call. This patch simplifies 12 eval and wasm setters by removing the distinct enable/disable functions 13 and using one consistent setter. 14 15 * bindings/js/ScriptController.cpp: 16 (WebCore::ScriptController::setEvalEnabled): 17 (WebCore::ScriptController::setWebAssemblyEnabled): 18 (WebCore::ScriptController::enableEval): Deleted. 19 (WebCore::ScriptController::enableWebAssembly): Deleted. 20 (WebCore::ScriptController::disableEval): Deleted. 21 (WebCore::ScriptController::disableWebAssembly): Deleted. 22 * bindings/js/ScriptController.h: 23 * dom/Document.cpp: 24 (WebCore::Document::disableEval): 25 (WebCore::Document::disableWebAssembly): 26 * loader/FrameLoader.cpp: 27 (WebCore::FrameLoader::clear): 28 * page/csp/ContentSecurityPolicy.h: 29 (WebCore::ContentSecurityPolicy::webAssemblyErrorMessage const): 30 1 31 2022-04-01 Alan Bujtas <zalan@apple.com> 2 32 -
trunk/Source/WebCore/bindings/js/ScriptController.cpp
r291863 r292229 407 407 } 408 408 409 void ScriptController:: enableEval(bool enable, const String& errorMessage)409 void ScriptController::setEvalEnabled(bool value, const String& errorMessage) 410 410 { 411 411 auto* jsWindowProxy = windowProxy().existingJSWindowProxy(mainThreadNormalWorld()); 412 412 if (!jsWindowProxy) 413 413 return; 414 jsWindowProxy->window()->setEvalEnabled( enable, errorMessage);415 } 416 417 void ScriptController:: enableWebAssembly()414 jsWindowProxy->window()->setEvalEnabled(value, errorMessage); 415 } 416 417 void ScriptController::setWebAssemblyEnabled(bool value, const String& errorMessage) 418 418 { 419 419 auto* jsWindowProxy = windowProxy().existingJSWindowProxy(mainThreadNormalWorld()); 420 420 if (!jsWindowProxy) 421 421 return; 422 jsWindowProxy->window()->setWebAssemblyEnabled(true); 423 } 424 425 void ScriptController::disableEval(const String& errorMessage) 426 { 427 auto* jsWindowProxy = windowProxy().existingJSWindowProxy(mainThreadNormalWorld()); 428 if (!jsWindowProxy) 429 return; 430 jsWindowProxy->window()->setEvalEnabled(false, errorMessage); 431 } 432 433 void ScriptController::disableWebAssembly(const String& errorMessage) 434 { 435 auto* jsWindowProxy = windowProxy().existingJSWindowProxy(mainThreadNormalWorld()); 436 if (!jsWindowProxy) 437 return; 438 jsWindowProxy->window()->setWebAssemblyEnabled(false, errorMessage); 422 jsWindowProxy->window()->setWebAssemblyEnabled(value, errorMessage); 439 423 } 440 424 -
trunk/Source/WebCore/bindings/js/ScriptController.h
r290853 r292229 125 125 TextPosition eventHandlerPosition() const; 126 126 127 void enableEval(bool, const String& errorMessage = String()); 128 void enableWebAssembly(); 129 void disableEval(const String& errorMessage); 130 void disableWebAssembly(const String& errorMessage); 127 void setEvalEnabled(bool, const String& errorMessage = String()); 128 void setWebAssemblyEnabled(bool, const String& errorMessage = String()); 131 129 132 130 static bool canAccessFromCurrentOrigin(Frame*, Document& accessingDocument); -
trunk/Source/WebCore/dom/Document.cpp
r292057 r292229 3568 3568 return; 3569 3569 3570 frame()->script(). disableEval(errorMessage);3570 frame()->script().setEvalEnabled(false, errorMessage); 3571 3571 } 3572 3572 … … 3576 3576 return; 3577 3577 3578 frame()->script(). disableWebAssembly(errorMessage);3578 frame()->script().setWebAssemblyEnabled(false, errorMessage); 3579 3579 } 3580 3580 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r292002 r292229 668 668 m_frame.script().clearScriptObjects(); 669 669 670 if (newDocument->contentSecurityPolicy() && !newDocument->contentSecurityPolicy()->evalErrorMessage().isNull()) 671 m_frame.script().enableEval(false, newDocument->contentSecurityPolicy()->evalErrorMessage()); 672 else 673 m_frame.script().enableEval(true); 670 if (newDocument->contentSecurityPolicy()) { 671 bool enableEvalValue = newDocument->contentSecurityPolicy()->evalErrorMessage().isNull(); 672 bool enableWASMValue = newDocument->contentSecurityPolicy()->webAssemblyErrorMessage().isNull(); 673 m_frame.script().setEvalEnabled(enableEvalValue, newDocument->contentSecurityPolicy()->evalErrorMessage()); 674 m_frame.script().setWebAssemblyEnabled(enableWASMValue, newDocument->contentSecurityPolicy()->webAssemblyErrorMessage()); 675 } 674 676 675 677 m_frame.navigationScheduler().clear(); -
trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h
r292134 r292229 199 199 200 200 const String& evalErrorMessage() const { return m_lastPolicyEvalDisabledErrorMessage; } 201 const String& webAssemblyErrorMessage() const { return m_lastPolicyWebAssemblyDisabledErrorMessage; } 201 202 202 203 ContentSecurityPolicyModeForExtension contentSecurityPolicyModeForExtension() const { return m_contentSecurityPolicyModeForExtension; }
Note: See TracChangeset
for help on using the changeset viewer.