1 module.exports = DOMText
3 function DOMText(value, owner) {
4 if (!(this instanceof DOMText)) {
5 return new DOMText(value)
8 this.data = value || ""
9 this.length = this.data.length
10 this.ownerDocument = owner || null
13 DOMText.prototype.type = "DOMTextNode"
14 DOMText.prototype.nodeType = 3
15 DOMText.prototype.nodeName = "#text"
17 DOMText.prototype.toString = function _Text_toString() {
21 DOMText.prototype.replaceData = function replaceData(index, length, value) {
22 var current = this.data
23 var left = current.substring(0, index)
24 var right = current.substring(index + length, current.length)
25 this.data = left + value + right
26 this.length = this.data.length