mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
46 lines
1.0 KiB
JavaScript
46 lines
1.0 KiB
JavaScript
var VNode = require('./VNode');
|
|
var inherit = require('raptor-util/inherit');
|
|
var extend = require('raptor-util/extend');
|
|
|
|
function VDocumentFragmentClone(other) {
|
|
extend(this, other);
|
|
this.$__parentNode = undefined;
|
|
this.$__nextSibling = undefined;
|
|
}
|
|
|
|
function VDocumentFragment(documentFragment) {
|
|
this.$__VNode(null /* childCount */);
|
|
this.namespaceURI = undefined;
|
|
}
|
|
|
|
VDocumentFragment.prototype = {
|
|
nodeType: 11,
|
|
|
|
$__DocumentFragment: true,
|
|
|
|
$__nsAware: true,
|
|
|
|
$__cloneNode: function() {
|
|
return new VDocumentFragmentClone(this);
|
|
},
|
|
|
|
actualize: function(doc) {
|
|
var docFragment = doc.createDocumentFragment();
|
|
|
|
var curChild = this.firstChild;
|
|
|
|
while(curChild) {
|
|
docFragment.appendChild(curChild.actualize(doc));
|
|
curChild = curChild.nextSibling;
|
|
}
|
|
|
|
return docFragment;
|
|
}
|
|
};
|
|
|
|
inherit(VDocumentFragment, VNode);
|
|
|
|
VDocumentFragmentClone.prototype = VDocumentFragment.prototype;
|
|
|
|
module.exports = VDocumentFragment;
|