1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

LibWeb: Add Painting::HitTestResult::dom_node()

This is a convenience accessor to avoid having to say this everywhere:

    result.paintable->layout_node().dom_node()

Instead, you can now do:

    result.dom_node()
This commit is contained in:
Andreas Kling 2022-03-21 11:16:02 +01:00
parent 0ba785894c
commit b64b5fa8bd
2 changed files with 17 additions and 4 deletions

View file

@ -32,6 +32,9 @@ struct HitTestResult {
After,
};
InternalPosition internal_position { None };
DOM::Node* dom_node();
DOM::Node const* dom_node() const;
};
enum class HitTestType {
@ -96,4 +99,14 @@ private:
Optional<Layout::BlockContainer*> mutable m_containing_block;
};
inline DOM::Node* HitTestResult::dom_node()
{
return paintable->layout_node().dom_node();
}
inline DOM::Node const* HitTestResult::dom_node() const
{
return paintable->layout_node().dom_node();
}
}