madrobby/zepto — pull request #1036 by ohnnyj (2014-11-11 04:39:22+00:00)
Title: Fixes #1034: DocumentFragment / Shadow DOM as $ Context

Some slight modifications to the $ function to account for document fragments, including Shadow DOM fragments.

Added tests to test/zepto.html:

testDollarWithDocumentFragmentContext
testDollarWithShadowRootContext

Some findings:

- document fragments and shadow roots both act as fragments but the latter has a more robust api, both return nodeType === 11 (DOCUMENT_FRAGMENT_NODE)
- Safari DocumentFragment does not have getElementById, others do.

Tested on:

Mac OS X:
Chrome 38
Firefox 33.1 (w/Shadow DOM enabled, 'dom.webcomponents.enabled')
Safari 8
Opera 25

Windows 7:
IE 11
Chrome 38
Firefox 33.1 (w/Shadow DOM enabled, 'dom.webcomponents.enabled')
Opera 25

Android 4.4.2:
Chrome 38

iPhone Simulator (note, not actual device, don't have one)
iOS Safari 8