aboutsummaryrefslogtreecommitdiffstats
path: root/test/jqLiteSpec.js
diff options
context:
space:
mode:
authorCaitlin Potter2014-03-10 19:32:09 -0400
committerCaitlin Potter2014-03-17 16:52:48 -0400
commit8a96f317e594a5096d4fa56ceae4c685eec8ac8b (patch)
tree80dd7a2c8f8df40d954ad07652f21278dd7b598e /test/jqLiteSpec.js
parentd3aa14bc11ef26587f88d3e3abf52fae3bad964a (diff)
downloadangular.js-8a96f317e594a5096d4fa56ceae4c685eec8ac8b.tar.bz2
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
Diffstat (limited to 'test/jqLiteSpec.js')
-rw-r--r--test/jqLiteSpec.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js
index 482c05f4..faf1c98c 100644
--- a/test/jqLiteSpec.js
+++ b/test/jqLiteSpec.js
@@ -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);
+ });
});