mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
LibWeb/HTML: Use DOM's post-connection steps for iframe elements
See: c8ec987d1
This commit is contained in:
parent
0a90143420
commit
18dddaa742
Notes:
github-actions[bot]
2024-12-14 20:07:33 +00:00
Author: https://github.com/shannonbooth
Commit: 18dddaa742
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2916
4 changed files with 105 additions and 13 deletions
|
@ -62,28 +62,22 @@ void HTMLIFrameElement::attribute_changed(FlyString const& name, Optional<String
|
|||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element:the-iframe-element-6
|
||||
void HTMLIFrameElement::inserted()
|
||||
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element:html-element-post-connection-steps
|
||||
void HTMLIFrameElement::post_connection()
|
||||
{
|
||||
HTMLElement::inserted();
|
||||
|
||||
// The iframe HTML element insertion steps, given insertedNode, are:
|
||||
// 1. If insertedNode's shadow-including root's browsing context is null, then return.
|
||||
if (!is<DOM::Document>(shadow_including_root()))
|
||||
return;
|
||||
|
||||
DOM::Document& document = verify_cast<DOM::Document>(shadow_including_root());
|
||||
|
||||
// NOTE: The check for "not fully active" is to prevent a crash on the dom/nodes/node-appendchild-crash.html WPT test.
|
||||
if (!document.browsing_context() || !document.is_fully_active())
|
||||
return;
|
||||
|
||||
// 2. Create a new child navigable for insertedNode.
|
||||
// The iframe HTML element post-connection steps, given insertedNode, are:
|
||||
// 1. Create a new child navigable for insertedNode.
|
||||
MUST(create_new_child_navigable(GC::create_function(realm().heap(), [this] {
|
||||
// FIXME: 3. If insertedNode has a sandbox attribute, then parse the sandboxing directive given the attribute's
|
||||
// FIXME: 2. If insertedNode has a sandbox attribute, then parse the sandboxing directive given the attribute's
|
||||
// value and insertedNode's iframe sandboxing flag set.
|
||||
|
||||
// 4. Process the iframe attributes for insertedNode, with initialInsertion set to true.
|
||||
// 3. Process the iframe attributes for insertedNode, with initialInsertion set to true.
|
||||
process_the_iframe_attributes(true);
|
||||
set_content_navigable_initialized();
|
||||
})));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue