mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
LibWeb: Bring browsing context creation closer to spec
This patch implements the "create a new browsing context" function from the HTML spec and replaces our existing logic with it. The big difference is that browsing contexts now initially navigate to "about:blank" instead of starting out in a strange "empty" state. This makes it possible for websites to create a new iframe and start scripting inside it right away, without having to load an URL into it.
This commit is contained in:
@@ -334,6 +334,12 @@ EnvironmentSettingsObject& relevant_settings_object(JS::Object const& object)
|
||||
return verify_cast<EnvironmentSettingsObject>(*relevant_realm(object).host_defined());
|
||||
}
|
||||
|
||||
EnvironmentSettingsObject& relevant_settings_object(DOM::Node const& node)
|
||||
{
|
||||
// Then, the relevant settings object for a platform object o is the environment settings object of the relevant Realm for o.
|
||||
return const_cast<DOM::Document&>(node.document()).relevant_settings_object();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global
|
||||
JS::GlobalObject& relevant_global_object(JS::Object const& object)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user