@paulirish thanks for pointing out the perf problem.

My original fix had been to test directly for a document fragment with `elem.nodeType === 11`, which would pick up document fragments, but unfortunately would also pick up plain document fragments, not just shadow roots. I suppose this could be changed to `element.nodeType === 11 && element instance of WebKitShadowRoot`. It'd be nice to avoid referencing WebKit-prefixed objects, but the reference to WebKitShadowRoot could be updated when Mozilla (and, someday, others) release their own ShadowRoot implementations.