    def descendants(self, placeholders=False):
        """A flat generator for a box, its children and descendants."""
        yield self
        for child in self.children:
            if placeholders or isinstance(child, Box):
                yield from child.descendants(placeholders)
            else:
                yield child
A flat generator for a box, its children and descendants.
weasyprint/formatting_structure/boxes.py