Box: Add helper to check if box is first child.

This commit is contained in:
Michael Drake 2018-06-29 15:03:10 +01:00
parent 948207472a
commit 049695fa07

View File

@ -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