diff --git a/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp b/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp index 33d16cc0f7e..86c1c347111 100644 --- a/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp +++ b/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp @@ -74,9 +74,10 @@ WebIDL::ExceptionOr ShadowRoot::set_inner_html(StringView value) // 2. Let context be this's host. auto context = this->host(); + VERIFY(context); // 3. Let fragment be the result of invoking the fragment parsing algorithm steps with context and compliantString. FIXME: Use compliantString instead of markup. - auto fragment = TRY(verify_cast(*context).parse_fragment(value)); + auto fragment = TRY(context->parse_fragment(value)); // 4. Replace all with fragment within this. this->replace_all(fragment); diff --git a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp index b740aeeab43..f09f6f56920 100644 --- a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp +++ b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp @@ -229,7 +229,7 @@ void TreeBuilder::create_pseudo_element_if_needed(DOM::Element& element, CSS::Se auto text_node = document.heap().allocate_without_realm(document, *text); text_node->set_generated_for(generated_for, element); - push_parent(verify_cast(*pseudo_element_node)); + push_parent(*pseudo_element_node); insert_node_into_inline_or_block_ancestor(*text_node, text_node->display(), AppendOrPrepend::Append); pop_parent(); } else {