Comparing version 0.14.20 to 0.14.21
'use strict'; | ||
const {ELEMENT_NODE, DOCUMENT_FRAGMENT_NODE} = require('../shared/constants.js'); | ||
const {CUSTOM_ELEMENTS} = require('../shared/symbols.js'); | ||
@@ -25,4 +26,15 @@ const {parseFromString} = require('../shared/parse-from-string.js'); | ||
node.replaceChildren(...childNodes); | ||
node.replaceChildren(...childNodes.map(setOwnerDocument, ownerDocument)); | ||
}; | ||
exports.setInnerHtml = setInnerHtml; | ||
function setOwnerDocument(node) { | ||
node.ownerDocument = this; | ||
switch (node.nodeType) { | ||
case ELEMENT_NODE: | ||
case DOCUMENT_FRAGMENT_NODE: | ||
node.childNodes.forEach(setOwnerDocument, this); | ||
break; | ||
} | ||
return node; | ||
} |
@@ -0,1 +1,2 @@ | ||
import {ELEMENT_NODE, DOCUMENT_FRAGMENT_NODE} from '../shared/constants.js'; | ||
import {CUSTOM_ELEMENTS} from '../shared/symbols.js'; | ||
@@ -23,3 +24,14 @@ import {parseFromString} from '../shared/parse-from-string.js'; | ||
node.replaceChildren(...childNodes); | ||
node.replaceChildren(...childNodes.map(setOwnerDocument, ownerDocument)); | ||
}; | ||
function setOwnerDocument(node) { | ||
node.ownerDocument = this; | ||
switch (node.nodeType) { | ||
case ELEMENT_NODE: | ||
case DOCUMENT_FRAGMENT_NODE: | ||
node.childNodes.forEach(setOwnerDocument, this); | ||
break; | ||
} | ||
return node; | ||
} |
{ | ||
"name": "linkedom", | ||
"version": "0.14.20", | ||
"version": "0.14.21", | ||
"description": "A triple-linked lists based DOM implementation", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
Sorry, the diff of this file is too big to display
905595
25263