summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--content/handlers/html/box.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/content/handlers/html/box.h b/content/handlers/html/box.h
index f096b6714..0952b841b 100644
--- a/content/handlers/html/box.h
+++ b/content/handlers/html/box.h
@@ -366,4 +366,15 @@ bool box_normalise_block(
const struct box *root,
struct html_content *c);
+/**
+ * Check if layout box is a first child.
+ *
+ * \param[in] b Box to check.
+ * \return true iff box is first child.
+ */
+static inline bool box_is_first_child(struct box *b)
+{
+ return (b->parent == NULL || b == b->parent->children);
+}
+
#endif