Suppose I've got a container element, whose line is almost filled with `inline` or `inline-block` elements and can't hold another inline element, without resize.

![enter image description here](https://i.stack.imgur.com/Fi19E.png)

How is the browser supposed to decide whether it can resize the container, extending it and putting the new `inline` element into the same line, or whether it should break the line and put the new `inline` element below the existing elements?

If either `width` or `max-width` attributes are set for the container element or its parents, it's pretty straightforward, but what if neither of those are set? 

Moreover, I'm interested in one special case: if the container element is a direct descendant of `body` or `HTML`, when would container element overflow the `HTML` element's size and cause the browser to draw scrollbar:

![enter image description here](https://i.stack.imgur.com/NRPj6.png)

If I don't take any special measures, overflow beyond browser's viewport usually doesn't take place; instead, the browser inserts line breaks. I wonder why and how to force the browser to increase width of my container element upon addition of inline elements, without explicitly specifying `width`, `min-width`, etc.