levand/domina — pull request #9 by bobby (2012-02-01 17:01:19+00:00)
Title: String as DOM

Hi Luke,

I have made some improvements to how strings are parsed to DOM nodes.

- HTML strings now act consistently with other content types
- Includes support for table fragments -- fixes #7
- Improvement in performance and consistency of apply-with-cloning
- Uses DocumentFragments only as an implementation detail, no DocumentFragments are ever returned from API functions -- closes #8

For the last two points, see http://ejohn.org/blog/dom-documentfragments/. I used DocumentFragments as an implementation detail within apply-with-cloning, to get some speed improvements, and I removed their use everywhere else. No functions now return DocumentFragments, so we shouldn't need to extend DOMContent to DocumentFragment. I used the algorithm from goog.dom.htmlToDocumentFragment for parsing HTML to nodes, but enhanced it to support table fragments and to return the nodes themselves instead of in a containing fragment.