Skip to content

Problems with incorrectly formed documents in IE #20

@shauryamal

Description

@shauryamal

This issue has been observed in IE8. It may or may not be present in later versions of IE.

Improperly nested and/or un-closed tags in HTML markup can corrupt the DOM tree in Internet Explorer 8. While trying to parse and fix the markup, IE messes it up by creating duplicate nodes at multiple locations in the document. This leads to incorrect parent references with the parentNode property.

The current implementation of findAndReplaceDOMText uses the parentNode property to traverse up a document tree, and the results in IE can be unpredictable with improperly formed HTML documents.

The Fiddle http://fiddle.jshell.net/2fxRF/show/ demonstrates the issue. The box with a red border contains an un-closed DIV, while the box with a blue border contains well formed HTML. In the red box, the first replacement of the text "the" is correct but the replacement after the un-closed DIV is not correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions