>>12
It's got some bloody
gotos in it! Not reasonable uses of them (error handling, breaking out of deep loops, etc.) either! They could've written it a lot clearer with a regular loop, and been a lot less verbose too; what is easier to understand, their version or this?
"If the list of active formatting elements (loafe) is empty, nothing more need be done. Scan the loafe backwards until either [1] the head entry is reached, [2] the entry preceding the current entry is a marker, or [3] the entry preceding the current entry is an element in the stack of open elements (soee). Beginning at this entry and continuing for each entry until the end of the loafe, duplicate these elements in the order they are in the loafe, and chain them such that each successive element is the child of the element before it in the loafe, and append the top of this resulting chain to the current element. Push this chain onto the soee."
To me their description looks either like they tried to emulate Knuth and failed, or decompiled browser code and wrote what it does, without going beyond the goto-level. The algorithm is really just two loops, but nothing about their description suggests that.
>>13
No, this part of the spec is definitely for browser writers.