tildeio/htmlbars — pull request #65 by mixonic (2014-07-05 00:11:36+00:00)
Title: Basic IE support

Behold, and be afraid.

With this patch, tests pass in IE11. Further version testing to come, but this makes us work in new versions of all major browsers (sorry Opera, I will test you eventually).

* I removed a test for `camelCasing` being preserved. I think the test is at fault and not the code, but regardless the camel case features are only required for svg. Will bring back a test with a proper DOM element when SVG comes back.
* IE11's deep `cloneNode` has two bad behaviors. #1, it destroys blank text nodes. HTMLBars uses blank text nodes pretty liberally to provide morph context. In this PR, I have written a custom walker that re-adds them after cloning. This can possibly be made faster using `createTreeWalker`. `createTreeWalker` has some bugs of its own regarding text nodes, but I'm not walking the DOM in a way that those bugs will be an issue.
* IE11's second bad behavior in `cloneNode` is that sequential text nodes will be merged. I have done *nothing* in this PR to address that. I welcome further test cases that make IE fail so we can correct it.

I would appreciate quick thumbs up/down on the strategy of fixing the cloned fragment instead of just writing own own clone logic.