LibWeb: Simplify <iframe> content frame construction

Now that documents are attached to their frame *before* parsing, we can
create the content frame of <iframe> elements right away, instead of
waiting for the host frame attachment.

Fixes #4408.
This commit is contained in:
Andreas Kling 2020-12-14 13:41:18 +01:00
commit 34d0141da3
Notes: sideshowbarker 2024-07-19 00:52:59 +09:00
4 changed files with 7 additions and 25 deletions

View file

@ -283,20 +283,11 @@ void Document::set_title(const String& title)
void Document::attach_to_frame(Badge<Frame>, Frame& frame)
{
m_frame = frame;
for_each_in_subtree([&](auto& node) {
node.document_did_attach_to_frame(frame);
return IterationDecision::Continue;
});
update_layout();
}
void Document::detach_from_frame(Badge<Frame>, Frame& frame)
{
for_each_in_subtree([&](auto& node) {
node.document_will_detach_from_frame(frame);
return IterationDecision::Continue;
});
tear_down_layout_tree();
m_frame = nullptr;
}