Financial-Times/polyfill-service — pull request #219 by triblondon (2014-12-10 18:10:31+00:00)
Title: Fix #203, and move the cloneNode polyfill into a new entry with tests.

Problems with previous cloneNode:

* Doesn't actually seem to be needed in IE8, which has a native cloneNode, albeit a buggy one, but the existing impl didn't fix any of IE8's bugs. I kept it though, because I wanted to write some tests and fix the one bug that seems to be an obvious problem - retaining the `checked` state of checkboxes.
* Failed on self-closing nodes like ``, which got mangled by the regex the polyfill used (probably should not use regexes to parse markup)

I've implemented a similar technique to the one used inside jQuery, albeit with fewer edge cases covered. But I have added some tests too.

Works in IE8. Doesn't work in IE7 - but neither does the existing implementation, so I've untargeted IE7.