[css-animations-1][css-transitions-1] Add .pseudoTarget to AnimationEvent and TransitionEvent#13603
[css-animations-1][css-transitions-1] Add .pseudoTarget to AnimationEvent and TransitionEvent#13603danielsakhapov wants to merge 3 commits intow3c:mainfrom
Conversation
As resolved in w3c#12163, add .pseudoTarget to selected event types and describe the initialization process for it.
|
The spec text is mostly shaped and influenced by w3c/uievents#413 |
dbaron
left a comment
There was a problem hiding this comment.
A few comments below. I commented on the animations spec, but I think the same comments also apply to the transitions spec.
| 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). | ||
| <dt><dfn>pseudoTarget</dfn> |
There was a problem hiding this comment.
It seems like the definitions of pseudoTarget and pseudoElement should probably be equivalent, in that I would expect that pseudoElement and pseudoTarget.type should be the same.
However, the definitions seems sufficiently different right now that I wonder if that's actually the case, for example, if the pseudo-element is in a shadow tree and the retargeting algorithm affects things.
Are they intended to be equivalent as I would expect, or are they intended to be different? (I think it should be clear either way.)
css-animations-1/Overview.bs
Outdated
| 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 <code>null</code>. | ||
| 1. Return {{AnimationEvent/pseudoTarget}}. |
There was a problem hiding this comment.
I'm not sure if this is formally correct. This seems to be treating pseudoTarget as an internal slot in addition to being a property, but it doesn't really describe it as an internal slot. (Someone more familiar with these concepts should probably review.)
There was a problem hiding this comment.
I guess this is similar to CommandEvent.source.
See the red box there
dbaron
left a comment
There was a problem hiding this comment.
This looks good to me, with one comment below. Hopefully @smaug---- can review as well.
|
|
||
| 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 |
There was a problem hiding this comment.
Not sure what the "and encapsulation" means here -- I think the underlying purpose of the retargeting could be described as encapsulation but I don't think there are two separate things happening here (unless I'm missing something).
(same below for TransitionEvent)
As resolved in #12163, add .pseudoTarget to selected event types and describe the initialization process for it.