mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-22 18:22:07 +00:00
LibWeb: Defer creation of subframes until host element is connected
This allows parsing of document fragments with "<iframe>" to construct the iframe element without requiring that the fragment have a frame.
This commit is contained in:
parent
57ead17d54
commit
5c67b2cb8f
Notes:
sideshowbarker
2024-07-18 20:51:47 +09:00
Author: https://github.com/awesomekling
Commit: 5c67b2cb8f
4 changed files with 22 additions and 2 deletions
|
@ -41,6 +41,15 @@ FrameHostElement::~FrameHostElement()
|
|||
{
|
||||
}
|
||||
|
||||
void FrameHostElement::inserted_into(Node& parent)
|
||||
{
|
||||
HTMLElement::inserted_into(parent);
|
||||
if (!is_connected())
|
||||
return;
|
||||
if (auto* frame = document().frame())
|
||||
m_content_frame = Frame::create_subframe(*this, frame->main_frame());
|
||||
}
|
||||
|
||||
Origin FrameHostElement::content_origin() const
|
||||
{
|
||||
if (!m_content_frame || !m_content_frame->document())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue