From c6d81521949155b2e5e95cc48ec758e09cebd7a0 Mon Sep 17 00:00:00 2001 From: Erik Arvidsson Date: Thu, 26 Jun 2014 11:36:17 -0400 Subject: [PATCH] Add test for #460 --- test/js/reprojection.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/test/js/reprojection.js b/test/js/reprojection.js index a343807..a674af2 100644 --- a/test/js/reprojection.js +++ b/test/js/reprojection.js @@ -223,4 +223,43 @@ suite('Shadow DOM reprojection', function() { assert.equal(getVisualInnerHtml(xFoo), '
Hello
'); }); + + test('Issue 460', function() { + // div + // - shadow-root + // -- a + // --- b + // ---- shadow-root + // ----- content + // ---- content (content2) + // - d + + var div = document.createElement('div'); + var sr = div.createShadowRoot(); + var a = sr.appendChild(document.createElement('a')); + var b = a.appendChild(document.createElement('b')); + var sr2 = b.createShadowRoot(); + var content = sr2.appendChild(document.createElement('content')); + var content2 = b.appendChild(document.createElement('content')); + var d = div.appendChild(document.createElement('d')); + + assert.equal(getVisualInnerHtml(div), ''); + + var sr3 = a.createShadowRoot(); + assert.equal(getVisualInnerHtml(div), ''); + + // div + // - shadow-root + // -- a + // --- shadow-root (sr3) + // ---- content (content3) + // --- b + // ---- shadow-root + // ----- content + // ---- content (content2) + // - d + + var content3 = sr3.appendChild(document.createElement('content')); + assert.equal(getVisualInnerHtml(div), ''); + }); }); \ No newline at end of file