1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 00:37:34 +00:00

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
parent b861de0a13
commit 34d0141da3
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;
}