From 769f915eb120b28adf71d0defa292230663fe3c5 Mon Sep 17 00:00:00 2001 From: Vladimir Levin Date: Fri, 18 Oct 2024 13:00:08 -0400 Subject: [PATCH 1/2] Add pseudoElement --- web-animations-1/Overview.bs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index a2cc9352e441..9310372c9080 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -6652,6 +6652,7 @@ The Animatable interface mixin {#the-animatable-interface-mixin} dictionary GetAnimationsOptions { boolean subtree = false; + DOMString? pseudoElement = null; }; @@ -6733,12 +6734,21 @@ The Animatable interface mixin {#the-animatable-interface-mixin} : sequence getAnimations(|options|) :: - Returns the set of [=relevant animations=] for this object, - or, if an {{Animatable/getAnimations(options)/options}} parameter - is passed with {{GetAnimationsOptions/subtree}} set to true, - returns the set of [=relevant animations for a subtree=] for this object. + 1. Let |object| be the object on which this method was called. - The returned list is sorted using + 1. If {{Animatable/getAnimations(options)/options}} is passed + with a non-null {{GetAnimationsOptions/pseudoElement}}, + then let |target| be the [=pseudo-element=] + identified by {{GetAnimationsOptions/pseudoElement}} pseudo-selector (e.g. `::before`) + with |object| as the originating element. + Otherwise, let |target| be |object|. + + 1. If {{Animatable/getAnimations(options)/options}} is passed + with {{GetAnimationsOptions/subtree}} set to true, + then return the set of [=relevant animations for a subtree=] of |target|. + Otherwise, return the set of [=relevant animations=] for |target|. + + The list returned by the above algorithm is sorted using the composite order described for the associated [=animations=] of effects in [[#the-effect-stack]]. @@ -6782,6 +6792,12 @@ The Animatable interface mixin {#the-animatable-interface-mixin} on which {{Animatable/getAnimations()}} is called should also be included in the result. + : pseudoElement + :: + If set, indicates that the target of the operation is the [=pseudo-element=] + identified by this pseudo selector (e.g. `::before`) + with the originating element being the object on which the function is called. + Extensions to the {{Document}} interface {#extensions-to-the-document-interface} @@ -7268,4 +7284,4 @@ Animation of 'box-shadow' and 'text-shadow' {#animating-shadow-lists} follows the matching rules for interpolation above, performing addition on each component according to its type, or falling back to [=discrete=] animation - if the ''shadow/inset'' values do not match. \ No newline at end of file + if the ''shadow/inset'' values do not match. From dfbbead2e036d990f1fad5bacb1ad3d602ca40ae Mon Sep 17 00:00:00 2001 From: Vladimir Levin Date: Fri, 18 Oct 2024 16:19:38 -0400 Subject: [PATCH 2/2] Parsing error --- web-animations-1/Overview.bs | 59 +++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index 9310372c9080..6539775cf955 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -5631,27 +5631,33 @@ The {{KeyframeEffect}} interface {#the-keyframeeffect-interface} On setting, sets the [=target pseudo-selector=] of the [=animation effect=] - to the provided value - after applying the following exceptions: - - * If the provided value is not `null` - and is an [=invalid selector|invalid=] <>, - the user agent must [=throw=] a {{DOMException}} - with error name "{{SyntaxError}}" and leave the - [=target pseudo-selector=] of this [=animation effect=] unchanged. - - Note: Invalid in this context follows the definition of - an [=invalid selector=] defined in [[!SELECTORS-4]] - such that syntactically invalid pseudo-elements - as well as pseudo-elements for which the user agent - has no usable level of support - are both deemed invalid. - - * If one of the legacy Selectors Level 2 single-colon selectors - (':before', ':after', ':first-letter', or ':first-line') - is specified, - the [=target pseudo-selector=] must be set - to the equivalent two-colon selector (e.g. '::before'). + to the result of pseudo-element parsing on the provided value, + defined as the following: + + 1. Given the value |value|, perform the following steps: + 1. If |value| is not `null` + and is an [=invalid selector|invalid=] <>, + + 1. [=Throw=] a {{DOMException}} + with error name "{{SyntaxError}}". + + 1. Abort. + + Note: In effect, this means that if the result of this algorithm is + used to set a variable, then that variable remains unchanged. + + Note: Invalid in this context follows the definition of + an [=invalid selector=] defined in [[!SELECTORS-4]] + such that syntactically invalid pseudo-elements + as well as pseudo-elements for which the user agent + has no usable level of support + are both deemed invalid. + + 1. If |value| is one of the legacy Selectors Level 2 single-colon selectors + (':before', ':after', ':first-letter', or ':first-line'), then + return the equivalent two-colon selector (e.g. '::before'). + + 1. Otherwise, return |value|. : composite :: @@ -6652,7 +6658,7 @@ The Animatable interface mixin {#the-animatable-interface-mixin} dictionary GetAnimationsOptions { boolean subtree = false; - DOMString? pseudoElement = null; + CSSOMString? pseudoElement = null; }; @@ -6736,10 +6742,13 @@ The Animatable interface mixin {#the-animatable-interface-mixin} :: 1. Let |object| be the object on which this method was called. - 1. If {{Animatable/getAnimations(options)/options}} is passed - with a non-null {{GetAnimationsOptions/pseudoElement}}, + 1. Let |pseudoElement| be the result of {{KeyframeEffect/pseudo-element parsing}} + applied to {{GetAnimationsOptions/pseudoElement}} of {{Animatable/getAnimations(options)/options}}, + or `null` if {{Animatable/getAnimations(options)/options}} is not passed. + + 1. If |pseudoElement| is not `null`, then let |target| be the [=pseudo-element=] - identified by {{GetAnimationsOptions/pseudoElement}} pseudo-selector (e.g. `::before`) + identified by |pseudoElement| with |object| as the originating element. Otherwise, let |target| be |object|.