mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 13:30:31 +00:00
LibWeb: Get Page from principal realm during resource loading
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Fixes a crash for module loading for a shadow realm.
This commit is contained in:
parent
b677844f8d
commit
4913dac745
Notes:
github-actions[bot]
2024-11-24 22:30:46 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/4913dac745d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2556 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/yyny
4 changed files with 13 additions and 1 deletions
|
@ -2240,7 +2240,7 @@ WebIDL::ExceptionOr<GC::Ref<PendingResponse>> nonstandard_resource_loader_file_o
|
|||
|
||||
auto request = fetch_params.request();
|
||||
|
||||
auto& page = Bindings::principal_host_defined_page(realm);
|
||||
auto& page = Bindings::principal_host_defined_page(HTML::principal_realm(realm));
|
||||
|
||||
// NOTE: Using LoadRequest::create_for_url_on_page here will unconditionally add cookies as long as there's a page available.
|
||||
// However, it is up to http_network_or_cache_fetch to determine if cookies should be added to the request.
|
||||
|
|
1
Tests/LibWeb/Text/data/external-module.mjs
Normal file
1
Tests/LibWeb/Text/data/external-module.mjs
Normal file
|
@ -0,0 +1 @@
|
|||
export const foo = "Well hello shadows";
|
|
@ -0,0 +1 @@
|
|||
Well hello shadows
|
10
Tests/LibWeb/Text/input/HTML/ShadowRealm-importValue.html
Normal file
10
Tests/LibWeb/Text/input/HTML/ShadowRealm-importValue.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(async done => {
|
||||
const shadowRealm = new ShadowRealm();
|
||||
const promise = shadowRealm.importValue("../../data/external-module.mjs", "foo");
|
||||
const value = await promise;
|
||||
println(value);
|
||||
done();
|
||||
});
|
||||
</script>
|
Loading…
Reference in a new issue