mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
LibWeb: Use as_if instead of dynamic_cast in a few places
This commit is contained in:
committed by
Alexander Kalenik
parent
fb56da4144
commit
8dfd382e12
@@ -791,10 +791,7 @@ GC::Ref<DOM::Element> HTMLParser::create_element_for(HTMLToken const& token, Opt
|
||||
// element is either not listed or doesn't have a form attribute, and the intended parent is in the same tree as the element pointed to by the form element pointer,
|
||||
// then associate element with the form element pointed to by the form element pointer and set element's parser inserted flag.
|
||||
// FIXME: Check if the element is not a form-associated custom element.
|
||||
if (is<FormAssociatedElement>(*element)) {
|
||||
auto* form_associated_element = dynamic_cast<FormAssociatedElement*>(element.ptr());
|
||||
VERIFY(form_associated_element);
|
||||
|
||||
if (auto* form_associated_element = as_if<FormAssociatedElement>(*element)) {
|
||||
auto& html_element = form_associated_element->form_associated_element_to_html_element();
|
||||
|
||||
if (m_form_element.ptr()
|
||||
|
||||
Reference in New Issue
Block a user