From a53fa20b1f3d8d5356ab0d9cf8acf3a1d288cd7e Mon Sep 17 00:00:00 2001 From: Shane Stephens Date: Mon, 2 Sep 2013 10:07:46 +1000 Subject: [PATCH] Add support for shadow DOM. --- layoutAnimationShim/src/layout-animation.js | 7 +++ .../workbench/shadow-interaction.html | 59 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 layoutAnimationShim/workbench/shadow-interaction.html diff --git a/layoutAnimationShim/src/layout-animation.js b/layoutAnimationShim/src/layout-animation.js index e4ff212..64d7694 100644 --- a/layoutAnimationShim/src/layout-animation.js +++ b/layoutAnimationShim/src/layout-animation.js @@ -938,6 +938,13 @@ function cloneElementToSize(node, rect) { div.style.height = rect.height + 'px'; div.innerHTML = node.innerHTML; + if (node.shadowRoot) { + var root = div.createShadowRoot(); + for (var i = 0; i < node.shadowRoot.childNodes.length; i++) { + root.appendChild(node.shadowRoot.childNodes[i].cloneNode(true)); + } + } + var transitionChildren = node.querySelectorAll("[isTransitionable]"); var transitionMirrors = div.querySelectorAll("[isTransitionable]"); for (var i = 0; i < transitionChildren.length; i++) { diff --git a/layoutAnimationShim/workbench/shadow-interaction.html b/layoutAnimationShim/workbench/shadow-interaction.html new file mode 100644 index 0000000..e8e7a7e --- /dev/null +++ b/layoutAnimationShim/workbench/shadow-interaction.html @@ -0,0 +1,59 @@ + + + + + + + + +
+
light
+
light
+
light
+
light
+
light
+
+ + +