[DOM Mock] Fix insertBefore when the reference node follows the moving child in a nodeList
This commit is contained in:
parent
c6693aa361
commit
9136585fe4
2 changed files with 23 additions and 0 deletions
|
|
@ -101,6 +101,7 @@ module.exports = function(options) {
|
|||
if (index > -1) this.childNodes.splice(index, 1)
|
||||
if (reference === null) this.appendChild(child)
|
||||
else {
|
||||
if (index !== -1 && refIndex > index) refIndex--
|
||||
if (child.nodeType === 11) {
|
||||
this.childNodes.splice.apply(this.childNodes, [refIndex, 0].concat(child.childNodes))
|
||||
while (child.firstChild) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue