mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Replace usages of dynamic_cast with as and as_if
This commit is contained in:
parent
d31aec25e8
commit
aadd563592
Notes:
github-actions[bot]
2025-08-22 18:27:13 +00:00
Author: https://github.com/tcl3
Commit: aadd563592
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5953
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/trflynn89
22 changed files with 72 additions and 91 deletions
|
|
@ -30,9 +30,8 @@ public:
|
|||
// - if the element is defined to support the deprecated ‘xlink:href’ attribute, additionally reflects that
|
||||
// deprecated attribute.
|
||||
if (!m_href_animated_string) {
|
||||
auto* this_svg_element = dynamic_cast<SVGElement*>(this);
|
||||
VERIFY(this_svg_element);
|
||||
m_href_animated_string = SVGAnimatedString::create(this_svg_element->realm(), *this_svg_element, AttributeNames::href, supports_xlink_href == SupportsXLinkHref::Yes ? Optional<FlyString> { AttributeNames::xlink_href } : OptionalNone {});
|
||||
auto& this_svg_element = as<SVGElement>(*this);
|
||||
m_href_animated_string = SVGAnimatedString::create(this_svg_element.realm(), this_svg_element, AttributeNames::href, supports_xlink_href == SupportsXLinkHref::Yes ? Optional<FlyString> { AttributeNames::xlink_href } : OptionalNone {});
|
||||
}
|
||||
return *m_href_animated_string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue