1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:47:35 +00:00

LibWeb: Start fleshing out Navigable::navigate()

Start implementation of https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate

Co-authored-by: Andreas Kling <kling@serenityos.org>
This commit is contained in:
Aliaksandr Kalenik 2023-01-01 17:46:00 +01:00 committed by Andreas Kling
parent 1ee4a3e310
commit ce9d9a10b8
2 changed files with 185 additions and 0 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -8,6 +9,8 @@
#include <LibJS/Heap/Cell.h>
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/HistoryHandlingBehavior.h>
#include <LibWeb/HTML/POSTResource.h>
namespace Web::HTML {
@ -51,6 +54,20 @@ public:
Variant<Empty, Traversal, String> ongoing_navigation() const { return m_ongoing_navigation; }
WebIDL::ExceptionOr<void> navigate(
AK::URL const&,
JS::NonnullGCPtr<DOM::Document> source_document,
Variant<Empty, String, POSTResource> document_resource = Empty {},
JS::GCPtr<Fetch::Infrastructure::Response> = nullptr,
bool exceptions_enabled = false,
HistoryHandlingBehavior = HistoryHandlingBehavior::Push,
String csp_navigation_type = String::from_utf8_short_string("other"sv),
ReferrerPolicy::ReferrerPolicy = ReferrerPolicy::ReferrerPolicy::EmptyString);
WebIDL::ExceptionOr<void> navigate_to_a_fragment(AK::URL const&, HistoryHandlingBehavior, String navigation_id);
WebIDL::ExceptionOr<void> navigate_to_a_javascript_url(AK::URL const&, HistoryHandlingBehavior, Origin const& initiator_origin, String csp_navigation_type);
protected:
Navigable();