1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:44:58 +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:
Andreas Kling 2022-08-05 10:55:47 +02:00
parent 73f77969a6
commit 2a7924f96c
8 changed files with 242 additions and 5 deletions

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Page/Page.h>
@ -12,7 +13,7 @@ namespace Web {
Page::Page(PageClient& client)
: m_client(client)
{
m_top_level_browsing_context = HTML::BrowsingContext::create(*this);
m_top_level_browsing_context = HTML::BrowsingContext::create_a_new_browsing_context(*this, nullptr, nullptr);
}
Page::~Page() = default;