mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-24 11:21:34 +00:00
LibWeb: Make Node::parent_element return GC::Ptr
This is useful for people like myself who run with debug mode to more reliably get stacktraces without spinning up a debugger.
This commit is contained in:
parent
a14481ee05
commit
3e17b1c9ae
Notes:
github-actions[bot]
2025-04-18 09:08:36 +00:00
Author: https://github.com/shannonbooth
Commit: 3e17b1c9ae
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4393
18 changed files with 48 additions and 54 deletions
|
@ -582,20 +582,14 @@ private:
|
|||
template<>
|
||||
inline bool Node::fast_is<Element>() const { return is_element(); }
|
||||
|
||||
inline Element* Node::parent_element()
|
||||
inline GC::Ptr<Element> Node::parent_element()
|
||||
{
|
||||
auto* parent = this->parent();
|
||||
if (!parent || !is<Element>(parent))
|
||||
return nullptr;
|
||||
return static_cast<Element*>(parent);
|
||||
return as_if<Element>(this->parent());
|
||||
}
|
||||
|
||||
inline Element const* Node::parent_element() const
|
||||
inline GC::Ptr<Element const> Node::parent_element() const
|
||||
{
|
||||
auto const* parent = this->parent();
|
||||
if (!parent || !is<Element>(parent))
|
||||
return nullptr;
|
||||
return static_cast<Element const*>(parent);
|
||||
return as_if<Element>(this->parent());
|
||||
}
|
||||
|
||||
inline bool Element::has_class(FlyString const& class_name, CaseSensitivity case_sensitivity) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue