mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-09 20:52:54 +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:
parent
b861de0a13
commit
34d0141da3
Notes:
sideshowbarker
2024-07-19 00:52:59 +09:00
Author: https://github.com/awesomekling
Commit: 34d0141da3
4 changed files with 7 additions and 25 deletions
Libraries/LibWeb/HTML
|
@ -46,6 +46,8 @@ namespace Web::HTML {
|
|||
HTMLIFrameElement::HTMLIFrameElement(DOM::Document& document, const QualifiedName& qualified_name)
|
||||
: HTMLElement(document, qualified_name)
|
||||
{
|
||||
ASSERT(document.frame());
|
||||
m_content_frame = Frame::create_subframe(*this, document.frame()->main_frame());
|
||||
}
|
||||
|
||||
HTMLIFrameElement::~HTMLIFrameElement()
|
||||
|
@ -58,18 +60,11 @@ RefPtr<Layout::Node> HTMLIFrameElement::create_layout_node(const CSS::StylePrope
|
|||
return adopt(*new Layout::FrameBox(document(), *this, move(style)));
|
||||
}
|
||||
|
||||
void HTMLIFrameElement::document_did_attach_to_frame(Frame& frame)
|
||||
{
|
||||
ASSERT(!m_content_frame);
|
||||
m_content_frame = Frame::create_subframe(*this, frame.main_frame());
|
||||
auto src = attribute(HTML::AttributeNames::src);
|
||||
if (src.is_null())
|
||||
return;
|
||||
load_src(src);
|
||||
}
|
||||
|
||||
void HTMLIFrameElement::document_will_detach_from_frame(Frame&)
|
||||
void HTMLIFrameElement::parse_attribute(const FlyString& name, const String& value)
|
||||
{
|
||||
HTMLElement::parse_attribute(name, value);
|
||||
if (name == HTML::AttributeNames::src)
|
||||
load_src(value);
|
||||
}
|
||||
|
||||
void HTMLIFrameElement::load_src(const String& value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue