From 9fb0b280bbbd88714f241f739dee07029d988fcc Mon Sep 17 00:00:00 2001 From: jeripeierSBB Date: Fri, 9 Apr 2021 15:28:35 +0200 Subject: [PATCH] fixup! fix(animations): allow animations on elements in the shadow DOM When determining whether to run an animation, the `TransitionAnimationPlayer` checks to see if a DOM element is attached to the document. This is done by checking to see if the element is "contained" by the document body node. Previously, if the element was inside a shadow DOM, the engine would determine that the element was not attached, even if the shadow DOM's host was attached to the document. This commit updates the `containsElement()` method on `AnimationDriver` implementations to also include shadow DOM elements as being contained if their shadow host element is contained. Further, when using CSS keyframes to trigger animations, the styling was always added to the `head` element of the document, even for animations on elements within a shadow DOM. This meant that those elements never receive those styles and the animation would not run. This commit updates the insertion of these styles so that they are added, to the element's "root node", which is the nearest shadow DOM host, or the `head` of the document if the element is not in a shadow DOM. Closes #25672 --- goldens/size-tracking/aio-payloads.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/goldens/size-tracking/aio-payloads.json b/goldens/size-tracking/aio-payloads.json index 1fe556f329e492..976401efcb4247 100755 --- a/goldens/size-tracking/aio-payloads.json +++ b/goldens/size-tracking/aio-payloads.json @@ -12,7 +12,7 @@ "master": { "uncompressed": { "runtime-es2015": 3033, - "main-es2015": 452289, + "main-es2015": 452203, "polyfills-es2015": 52215 } } @@ -21,7 +21,7 @@ "master": { "uncompressed": { "runtime-es2015": 3153, - "main-es2015": 437924, + "main-es2015": 437844, "polyfills-es2015": 52493 } }