mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 01:26:22 +00:00
LibWeb: Allow Element.insertAdjacentHTML on the document element
This fixes wpt/domparsing/insert_adjacent_html.html
This commit is contained in:
parent
f12dae7ea4
commit
802af5ad9d
Notes:
sideshowbarker
2024-07-17 10:54:57 +09:00
Author: https://github.com/awesomekling
Commit: 802af5ad9d
Pull-request: https://github.com/SerenityOS/serenity/pull/24461
3 changed files with 9 additions and 2 deletions
|
@ -0,0 +1 @@
|
||||||
|
PASS (didn't crash)
|
|
@ -0,0 +1,7 @@
|
||||||
|
<script src="../include.js"></script>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
document.documentElement.insertAdjacentHTML("afterbegin", "hello");
|
||||||
|
println("PASS (didn't crash)");
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -1489,8 +1489,7 @@ WebIDL::ExceptionOr<void> Element::insert_adjacent_html(String const& position,
|
||||||
|| (context->document().document_type() == Document::Type::HTML
|
|| (context->document().document_type() == Document::Type::HTML
|
||||||
&& static_cast<Element const&>(*context).local_name() == "html"sv
|
&& static_cast<Element const&>(*context).local_name() == "html"sv
|
||||||
&& static_cast<Element const&>(*context).namespace_uri() == Namespace::HTML)) {
|
&& static_cast<Element const&>(*context).namespace_uri() == Namespace::HTML)) {
|
||||||
// FIXME: set context to the result of creating an element given this's node document, body, and the HTML namespace.
|
context = TRY(create_element(document(), HTML::TagNames::body, Namespace::HTML));
|
||||||
TODO();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Let fragment be the result of invoking the fragment parsing algorithm steps with context and string.
|
// 4. Let fragment be the result of invoking the fragment parsing algorithm steps with context and string.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue