mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 07:18:51 +00:00
LibWeb: Use as_if
instead of dynamic_cast
in a few places
This commit is contained in:
parent
fb56da4144
commit
8dfd382e12
Notes:
github-actions[bot]
2025-01-31 13:30:46 +00:00
Author: https://github.com/tcl3
Commit: 8dfd382e12
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3414
Reviewed-by: https://github.com/gmta ✅
2 changed files with 11 additions and 16 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue