treshugart/Smallblock — Issue #1: Insert replacement element exactly where it's first corresponding element was.
Author: treshugart
Created: 2011-11-18 06:57:54+00:00
State: open

Currently, the replacement element is appended to the parent of the first corresponding element. It should be inserted as close to the original location of the first corresponding element as possible.

1. Check for `previousSibling`. If so, put after it.
2. Check for `parentNode`, if so, prepend.
3. If all else fails, prepend it to the `documentElement`.