Skip to content

DomNode: fix insertBefore() not dissolving DocumentFragment#1110

Open
duonglaiquang wants to merge 1 commit intoHtmlUnit:masterfrom
duonglaiquang:duong_DomNode
Open

DomNode: fix insertBefore() not dissolving DocumentFragment#1110
duonglaiquang wants to merge 1 commit intoHtmlUnit:masterfrom
duonglaiquang:duong_DomNode

Conversation

@duonglaiquang
Copy link
Copy Markdown
Contributor

###This PR does the following

Fix DomNode.insertBefore(DomNode) to dissolve DocumentFragment into its children before insertion

Problem

The DomNode.insertBefore(DomNode) did not check for DomDocumentFragment. When a DocumentFragment was passed, the fragment node itself was inserted into the DOM tree instead of being dissolved into its children.
This caused before(), after(), prepend(), and multi-arg replaceWith() to produce incorrect DOM structures.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant