using `messagesContainer.firstElementChild` should be more efficient: we don't need the exact count, we only need to know if there is one. I expect `childElementCount` to be O(n)  (but maybe Gecko has some optimizations)