Bug 834160 - Part 2/N: fix dom implementations