mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Make PolicyContainer GC allocated
This is required to store Content Security Policies, as their Directives are implemented as subclasses with overridden virtual functions. Thus, they cannot be stored as generic Directive classes, as it'll lose the ability to call overridden functions when they are copied.
This commit is contained in:
Notes:
github-actions[bot]
2025-02-21 12:55:13 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/cae0ab2139a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3627 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -251,7 +251,7 @@ WebIDL::ExceptionOr<BrowsingContext::BrowsingContextAndDocument> BrowsingContext
|
||||
document->set_referrer(creator->url().serialize());
|
||||
|
||||
// 2. Set document's policy container to a clone of creator's policy container.
|
||||
document->set_policy_container(creator->policy_container());
|
||||
document->set_policy_container(creator->policy_container()->clone(document->realm()));
|
||||
|
||||
// 3. If creator's origin is same origin with creator's relevant settings object's top-level origin,
|
||||
if (creator->origin().is_same_origin(creator->relevant_settings_object().top_level_origin)) {
|
||||
|
||||
Reference in New Issue
Block a user