+ getDocumentElement: function(htmlElement) {
+ /* globals HTMLElement, Text */
+ if(!htmlElement || !(htmlElement instanceof HTMLElement || htmlElement instanceof Text)) {
+ return null;
+ }
+ var $element = $(htmlElement);
+ if(htmlElement.nodeType === Node.ELEMENT_NODE && $element.attr('document-node-element') !== undefined) {
+ return new documentElement.DocumentNodeElement(htmlElement, this);
+ }
+ if($element.attr('document-text-element') !== undefined || (htmlElement.nodeType === Node.TEXT_NODE && $element.parent().attr('document-text-element') !== undefined)) {
+ //return DocumentTextElement.fromHTMLElement(htmlElement, canvas);
+ return new documentElement.DocumentTextElement(htmlElement, this);
+ }
+ },
+