From 98d825e10d3bf76f47e69abba857a8933c8cb7d9 Mon Sep 17 00:00:00 2001 From: Caitlin Potter Date: Mon, 10 Mar 2014 19:32:09 -0400 Subject: 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 --- test/jqLiteSpec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/jqLiteSpec.js') 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('
'), + 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); + }); }); -- cgit v1.2.3