2020-06-17 17:31:42 +02:00
|
|
|
/*
|
2023-02-20 19:03:06 +01:00
|
|
|
* Copyright (c) 2020-2023, Andreas Kling <kling@serenityos.org>
|
2022-10-12 23:49:23 +02:00
|
|
|
* Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
|
2023-11-29 09:34:38 -07:00
|
|
|
* Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org>
|
2020-06-17 17:31:42 +02:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-06-17 17:31:42 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "PageHost.h"
|
2022-02-25 12:18:30 +02:00
|
|
|
#include "ConnectionFromClient.h"
|
2023-11-29 09:34:38 -07:00
|
|
|
#include "PageClient.h"
|
2021-09-22 21:36:18 +02:00
|
|
|
#include <LibGfx/ShareableBitmap.h>
|
2020-06-17 17:31:42 +02:00
|
|
|
#include <LibGfx/SystemTheme.h>
|
2023-08-23 17:18:33 +01:00
|
|
|
#include <LibWeb/CSS/SystemColor.h>
|
2021-04-15 10:36:20 -04:00
|
|
|
#include <LibWeb/Cookie/ParsedCookie.h>
|
2021-11-18 15:01:28 +01:00
|
|
|
#include <LibWeb/HTML/BrowsingContext.h>
|
2023-08-22 16:00:42 +02:00
|
|
|
#include <LibWeb/HTML/TraversableNavigable.h>
|
2023-02-25 11:04:29 +01:00
|
|
|
#include <LibWeb/Layout/Viewport.h>
|
2022-03-10 23:13:37 +01:00
|
|
|
#include <LibWeb/Painting/PaintableBox.h>
|
2023-10-26 08:45:25 +02:00
|
|
|
#include <LibWeb/Painting/PaintingCommandExecutorCPU.h>
|
2023-08-19 08:38:51 +02:00
|
|
|
#include <LibWeb/Painting/ViewportPaintable.h>
|
2022-10-05 19:33:30 +02:00
|
|
|
#include <LibWeb/Platform/Timer.h>
|
2020-06-17 18:00:18 +02:00
|
|
|
#include <WebContent/WebContentClientEndpoint.h>
|
2022-11-08 10:03:07 -05:00
|
|
|
#include <WebContent/WebDriverConnection.h>
|
2020-06-17 17:31:42 +02:00
|
|
|
|
2023-11-04 20:44:22 +03:00
|
|
|
#ifdef HAS_ACCELERATED_GRAPHICS
|
2023-10-27 17:28:18 +02:00
|
|
|
# include <LibWeb/Painting/PaintingCommandExecutorGPU.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2020-06-17 17:31:42 +02:00
|
|
|
namespace WebContent {
|
|
|
|
|
|
2022-02-25 12:18:30 +02:00
|
|
|
PageHost::PageHost(ConnectionFromClient& client)
|
2020-06-17 18:00:18 +02:00
|
|
|
: m_client(client)
|
|
|
|
|
{
|
2023-11-29 09:34:38 -07:00
|
|
|
auto& first_page = create_page();
|
|
|
|
|
first_page.page().set_top_level_traversable(Web::HTML::TraversableNavigable::create_a_fresh_top_level_traversable(first_page.page(), AK::URL("about:blank")).release_value_but_fixme_should_propagate_errors());
|
2020-06-17 18:00:18 +02:00
|
|
|
}
|
|
|
|
|
|
2023-11-29 09:34:38 -07:00
|
|
|
PageClient& PageHost::create_page()
|
2020-07-04 20:57:57 +02:00
|
|
|
{
|
2023-11-29 09:34:38 -07:00
|
|
|
m_pages.set(m_next_id, make<PageClient>(*this, m_next_id));
|
|
|
|
|
++m_next_id;
|
|
|
|
|
return *m_pages.get(m_next_id - 1).value();
|
2020-07-04 20:57:57 +02:00
|
|
|
}
|
|
|
|
|
|
2023-11-29 09:34:38 -07:00
|
|
|
PageHost::~PageHost() = default;
|
2023-11-23 12:22:23 -05:00
|
|
|
|
2020-06-17 17:31:42 +02:00
|
|
|
}
|