Base::Node
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 21 def appendChild(node) if node.kind_of?(TextNode) and childNodes.any? and childNodes.last.kind_of?(TextNode) childNodes.last.hpricot.content = childNodes.last.hpricot.content + node.hpricot.content else childNodes << node hpricot.children << node.hpricot end if (oldparent = node.hpricot.parent) != nil oldparent.children.delete_at(oldparent.children.index(node.hpricot)) end node.hpricot.parent = hpricot node.parent = self end
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 60 def hasContent childNodes.any? end
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 50 def insertBefore(node, refNode) index = childNodes.index(refNode) if node.kind_of?(TextNode) and index > 0 and childNodes[index-1].kind_of?(TextNode) childNodes[index-1].hpricot.content = childNodes[index-1].hpricot.to_s + node.hpricot.to_s else refNode.hpricot.parent.insert_before(node.hpricot,refNode.hpricot) childNodes.insert(index, node) end end
Generated with the Darkfish Rdoc Generator 2.