fix(jqLite): traverse host property for DocumentFragment in inheritedData()

If dealing with a document fragment node with a host element, and no parent, use the host
element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM
to lookup parent controllers.

Closes #6637
This commit is contained in:
Caitlin Potter
2014-03-10 19:32:09 -04:00
parent d3aa14bc11
commit 8a96f317e5
2 changed files with 19 additions and 2 deletions

View File

@@ -168,6 +168,19 @@ describe('jqLite', function() {
dealoc(ul);
});
it('should pass through DocumentFragment boundaries via host', function() {
var host = jqLite('<div></div>'),
frag = document.createDocumentFragment(),
$frag = jqLite(frag);
frag.host = host[0];
host.data("foo", 123);
host.append($frag);
expect($frag.inheritedData("foo")).toBe(123);
dealoc(host);
dealoc($frag);
});
});