mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibWeb: Add m_page
in TraversableNavigable
This commit is contained in:
parent
5a704453af
commit
343c709566
Notes:
sideshowbarker
2024-07-16 20:31:50 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/343c709566 Pull-request: https://github.com/SerenityOS/serenity/pull/20711
@ -16,7 +16,10 @@
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
TraversableNavigable::TraversableNavigable() = default;
|
||||
TraversableNavigable::TraversableNavigable(Page& page)
|
||||
: m_page(page)
|
||||
{
|
||||
}
|
||||
|
||||
TraversableNavigable::~TraversableNavigable() = default;
|
||||
|
||||
@ -76,7 +79,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<TraversableNavigable>> TraversableNavigable
|
||||
document_state->set_navigable_target_name(target_name);
|
||||
|
||||
// 5. Let traversable be a new traversable navigable.
|
||||
auto traversable = vm.heap().allocate_without_realm<TraversableNavigable>();
|
||||
auto traversable = vm.heap().allocate_without_realm<TraversableNavigable>(page);
|
||||
|
||||
// 6. Initialize the navigable traversable given documentState.
|
||||
TRY_OR_THROW_OOM(vm, traversable->initialize_navigable(document_state, nullptr));
|
||||
|
@ -54,8 +54,11 @@ public:
|
||||
m_session_history_traversal_queue.append(move(steps));
|
||||
}
|
||||
|
||||
Page* page() { return m_page; }
|
||||
Page const* page() const { return m_page; }
|
||||
|
||||
private:
|
||||
TraversableNavigable();
|
||||
TraversableNavigable(Page&);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
@ -74,6 +77,8 @@ private:
|
||||
VisibilityState m_system_visibility_state { VisibilityState::Visible };
|
||||
|
||||
SessionHistoryTraversalQueue m_session_history_traversal_queue;
|
||||
|
||||
WeakPtr<Page> m_page;
|
||||
};
|
||||
|
||||
void finalize_a_same_document_navigation(JS::NonnullGCPtr<TraversableNavigable> traversable, JS::NonnullGCPtr<Navigable> target_navigable, JS::NonnullGCPtr<SessionHistoryEntry> target_entry, JS::GCPtr<SessionHistoryEntry> entry_to_replace);
|
||||
|
Loading…
Reference in New Issue
Block a user