I was working with jdbarlett on a new version of innerShiv http://jdbartlett.github.com/innershiv/ that is much faster...
https://gist.github.com/7e1c3c76db44e5a249ff is the general idea.
We feature test to see if the shiv is necessary, and we also regex against the input to see if we should even bother shiv'ing it. If it is, then we innerHTML it into an on-DOM div and grab the new childNodes which we'll use in a docFragment.
Currently it supports two signatures:
innerShiv(htmlstring) // documentFragment
innerShiv(htmlstring, false) // array of nodes
But that clearly could be simplified for its purposes within jQuery.
From a perf standpoints the questions I have are:
- does the --- 1) add a node to the dom 2) innnerHTML inside of it 3) pull it off --- trick have a significant hit?
- is the regex against the incoming string worth it?
I'm gonna be quite busy, but I'll try to take a stab at this within jQuery and get some perf numbers, sometime, if no one else beats me to it. Help requested :)