diff --git a/css-animations-1/Overview.bs b/css-animations-1/Overview.bs index 273b00e5ca89..c69dc02081b8 100644 --- a/css-animations-1/Overview.bs +++ b/css-animations-1/Overview.bs @@ -38,6 +38,7 @@ urlPrefix: https://html.spec.whatwg.org/multipage/infrastructure.html; type: dfn

@@ -879,11 +880,13 @@ IDL Definition

readonly attribute CSSOMString animationName; readonly attribute double elapsedTime; readonly attribute CSSOMString pseudoElement; + readonly attribute CSSPseudoElement? pseudoTarget; }; dictionary AnimationEventInit : EventInit { CSSOMString animationName = ""; double elapsedTime = 0.0; CSSOMString pseudoElement = ""; + CSSPseudoElement? pseudoTarget = null; }; @@ -905,10 +908,52 @@ Attributes runs (in which case the target of the event is that pseudo-element's corresponding element), or the empty string if the animation runs on an element (which means the target of the event is that element). +
pseudoTarget +
+ The [=pseudo-element=] that was the target of the animation, + if any. When the event target is an element rather than a + [=pseudo-element=], this attribute is null. + + Each {{AnimationEvent}} has an associated pseudoTargetOrigin + internal slot (an {{Element}} or null), initialized to + null, and an associated pseudoTarget + internal slot (a {{CSSPseudoElement}} or null), initialized to + null. + + To get this attribute, run these steps: + + 1. If the [=AnimationEvent/pseudoTargetOrigin=] internal slot is null, then return null. + 1. Let |currentTarget| be {{Event/currentTarget}}. + 1. If |currentTarget| is null, then return null. + 1. Let |origin| be the [=AnimationEvent/pseudoTargetOrigin=] internal slot. + 1. Let |retargeted| be the result of [=retarget=]ing |origin| against |currentTarget|. + 1. If |retargeted| is not |origin|, then return null. + 1. Return the [=AnimationEvent/pseudoTarget=] internal slot. + + The un-initialized value of this attribute MUST be + null. + + Note: {{AnimationEvent/pseudoTarget}} and {{AnimationEvent/pseudoElement}} are intentionally + not equivalent. Because {{AnimationEvent/pseudoTarget}} returns a {{CSSPseudoElement}} + object, it is subject to retargeting and encapsulation. Therefore, if the event's target + is a pseudo-element inside a shadow tree, {{AnimationEvent/pseudoTarget}} will + return null when observed from outside the shadow tree, while + {{AnimationEvent/pseudoElement}} will still contain the pseudo-element's name. AnimationEvent(type, animationEventInitDict) is an event constructor. + If |animationEventInitDict|'s {{AnimationEventInit/pseudoTarget}} is not null: + + 1. Set |event|'s [=AnimationEvent/pseudoTarget=] internal slot = |animationEventInitDict|'s {{AnimationEventInit/pseudoTarget}} + 1. Set |event|'s [=AnimationEvent/pseudoTargetOrigin=] = |animationEventInitDict|'s {{AnimationEventInit/pseudoTarget}}'s {{CSSPseudoElement/element}} + + When the UA dispatches an {{AnimationEvent}} for an animation running on a + [=pseudo-element=], it must set the event's [=AnimationEvent/pseudoTarget=] internal slot + to the {{CSSPseudoElement}} representing that pseudo-element, and set the + [=AnimationEvent/pseudoTargetOrigin=] internal slot to that + {{CSSPseudoElement}}'s {{CSSPseudoElement/element}}. +

Types of AnimationEvent

@@ -931,7 +976,7 @@ Types of AnimationEvent
animationend @@ -942,7 +987,7 @@ Types of AnimationEvent
animationiteration @@ -961,7 +1006,7 @@ Types of AnimationEvent
animationcancel @@ -985,7 +1030,7 @@ Types of AnimationEvent diff --git a/css-transitions-1/Overview.bs b/css-transitions-1/Overview.bs index 8f7dbddd9552..ec83bdab7c56 100644 --- a/css-transitions-1/Overview.bs +++ b/css-transitions-1/Overview.bs @@ -96,6 +96,8 @@ spec:css-color-4; text:blue text:transparent spec:css-values-3; type:type; text: