mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibWeb: Make "top-level browsing context" concept more spec-compliant
Any browsing context that doesn't have a parent browsing context is now considered a top-level browsing context. This matches the HTML spec. This means we no longer keep a pointer to the top-level context, since we can simply walk the parent chain until we find the topmost ancestor.
This commit is contained in:
@@ -27,7 +27,8 @@ void BrowsingContextContainer::inserted()
|
||||
if (!is_connected())
|
||||
return;
|
||||
if (auto* frame = document().browsing_context()) {
|
||||
m_nested_browsing_context = BrowsingContext::create_nested(*this, frame->top_level_browsing_context());
|
||||
VERIFY(frame->page());
|
||||
m_nested_browsing_context = BrowsingContext::create_nested(*frame->page(), *this);
|
||||
m_nested_browsing_context->set_frame_nesting_levels(frame->frame_nesting_levels());
|
||||
m_nested_browsing_context->register_frame_nesting(document().url());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user