diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/Node.h')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/Node.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/Node.h b/Userland/Libraries/LibWeb/Layout/Node.h index 95910180e4..0c7bccfbab 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.h +++ b/Userland/Libraries/LibWeb/Layout/Node.h @@ -108,6 +108,7 @@ public: const Gfx::Font& font() const; const CSS::ImmutableComputedValues& computed_values() const; + float line_height() const; NodeWithStyle* parent(); const NodeWithStyle* parent() const; @@ -227,6 +228,13 @@ inline const CSS::ImmutableComputedValues& Node::computed_values() const return parent()->computed_values(); } +inline float Node::line_height() const +{ + if (m_has_style) + return static_cast<NodeWithStyle const*>(this)->line_height(); + return parent()->line_height(); +} + inline const NodeWithStyle* Node::parent() const { return static_cast<const NodeWithStyle*>(TreeNode<Node>::parent()); |