+ children: function() {
+ var toret = [];
+ if(this instanceof DocumentTextElement)
+ return toret;
+
+
+ var elementContent = this.dom().contents();
+ var element = this;
+ elementContent.each(function(idx) {
+ var childElement = documentElementFromHTMLElement(this, element.canvas);
+ if(idx === 0 && elementContent.length > 1 && elementContent[1].nodeType === Node.ELEMENT_NODE && (childElement instanceof DocumentTextElement) && $.trim($(this).text()) === '')
+ return true;
+ if(idx > 0 && childElement instanceof DocumentTextElement) {
+ if(toret[toret.length-1] instanceof DocumentNodeElement && $.trim($(this).text()) === '')
+ return true;
+ }
+ toret.push(childElement);
+ });
+ return toret;
+ },
+ childIndex: function(child) {
+ var children = this.children(),
+ toret = null;
+ children.forEach(function(c, idx) {
+ if(c.sameNode(child)) {
+ toret = idx;
+ return false;
+ }
+ });
+ return toret;
+ },