mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibWeb/DOM: Add document getter to AbstractElement
This commit is contained in:
parent
33cf3d7782
commit
9bc5c6fb35
Notes:
github-actions[bot]
2025-07-16 13:50:11 +00:00
Author: https://github.com/AtkinsSJ
Commit: 9bc5c6fb35
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5400
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 7 additions and 0 deletions
|
@ -21,6 +21,11 @@ void AbstractElement::visit(GC::Cell::Visitor& visitor) const
|
|||
visitor.visit(m_element);
|
||||
}
|
||||
|
||||
Document& AbstractElement::document() const
|
||||
{
|
||||
return m_element->document();
|
||||
}
|
||||
|
||||
GC::Ptr<Layout::NodeWithStyle> AbstractElement::layout_node()
|
||||
{
|
||||
if (m_pseudo_element.has_value())
|
||||
|
|
|
@ -17,6 +17,8 @@ class AbstractElement {
|
|||
public:
|
||||
AbstractElement(GC::Ref<Element>, Optional<CSS::PseudoElement> = {});
|
||||
|
||||
Document& document() const;
|
||||
|
||||
Element& element() { return m_element; }
|
||||
Element const& element() const { return m_element; }
|
||||
Optional<CSS::PseudoElement> pseudo_element() const { return m_pseudo_element; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue