/src/serenity/Userland/Libraries/LibWeb/HTML/DocumentState.cpp
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2022, Andreas Kling <kling@serenityos.org> |
3 | | * Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com> |
4 | | * |
5 | | * SPDX-License-Identifier: BSD-2-Clause |
6 | | */ |
7 | | |
8 | | #include <LibWeb/DOM/Document.h> |
9 | | #include <LibWeb/HTML/DocumentState.h> |
10 | | |
11 | | namespace Web::HTML { |
12 | | |
13 | | JS_DEFINE_ALLOCATOR(DocumentState); |
14 | | |
15 | 0 | DocumentState::DocumentState() = default; |
16 | | |
17 | 0 | DocumentState::~DocumentState() = default; |
18 | | |
19 | | JS::NonnullGCPtr<DocumentState> DocumentState::clone() const |
20 | 0 | { |
21 | 0 | JS::NonnullGCPtr<DocumentState> cloned = *heap().allocate_without_realm<DocumentState>(); |
22 | 0 | cloned->m_document = m_document; |
23 | 0 | cloned->m_history_policy_container = m_history_policy_container; |
24 | 0 | cloned->m_request_referrer = m_request_referrer; |
25 | 0 | cloned->m_request_referrer_policy = m_request_referrer_policy; |
26 | 0 | cloned->m_initiator_origin = m_initiator_origin; |
27 | 0 | cloned->m_origin = m_origin; |
28 | 0 | cloned->m_about_base_url = m_about_base_url; |
29 | 0 | cloned->m_nested_histories = m_nested_histories; |
30 | 0 | cloned->m_resource = m_resource; |
31 | 0 | cloned->m_reload_pending = m_reload_pending; |
32 | 0 | cloned->m_ever_populated = m_ever_populated; |
33 | 0 | cloned->m_navigable_target_name = m_navigable_target_name; |
34 | 0 | return cloned; |
35 | 0 | } |
36 | | |
37 | | void DocumentState::visit_edges(Cell::Visitor& visitor) |
38 | 0 | { |
39 | 0 | Base::visit_edges(visitor); |
40 | 0 | visitor.visit(m_document); |
41 | 0 | for (auto& nested_history : m_nested_histories) { |
42 | 0 | visitor.visit(nested_history.entries); |
43 | 0 | } |
44 | 0 | } |
45 | | |
46 | | } |