bug 833579 - Use insertBefore instead of appendChild
Merge pull request #7762 from crh0716/833579

bug 833579 - Use insertBefore instead of appendChild r=Etienne