https://html.spec.whatwg.org/multipage/syntax.html#noah
The way this specification is written, the list of active formatting elements always consists of elements in chronological order with the least recently added element first and the most recently added element last (except for while steps 8 to 10 of the above algorithm are being executed, of course).
I think that "steps 8 to 10" should be replaced with "steps 7 to 10", because step 10 can jump to step 7, possibly multiple times during an execution of the algorithm, and during the subsequent executions of step 7, the constraint will not be satisfied.