mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02: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
Notes:
github-actions[bot]
2025-01-31 13:30:46 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/8dfd382e12f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3414 Reviewed-by: https://github.com/gmta ✅
@@ -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