I wonder how real DOM implementations handle this.