[web-animations-1] Resolve remaining issues missed in pseudo-element change. - #4616
Conversation
|
@george-steel Anything I can do to help get this landed? |
|
Sorry, I was delayed by the holidays and fixing a memory leak. I'll have another go at this in the next few days. |
Fixup of w3c#4437 addressing w3c#4301. * Add pseudoElement option to KeyframeEffect constructor body * Fix w3c#4502 adding catch-all pseudo-element case to composite order * Fix w3c#4586 adding error handling to KeyframeEffect.pseudoElement * Fix w3c#4701 making note of case when property values cannot be calculated
9d08a2e to
99b2845
Compare
|
@birtles @stephenmcgruer Next draft is ready. I agree with your advice and decided that the error handling and a couple of other issues needed to be fixed at the same time as the constructor. What I wrote here reflects the tentative decisions we made for blink in the absence of a spec. |
birtles
left a comment
There was a problem hiding this comment.
Thanks for doing this. It's getting close.
Sorry for all the feedback. It takes a while to get used to writing spec text. I'm still really bad at it, but these suggestions should hopefully tighten things up a little.
| Note that this procedure is only performed on a <a>keyframe effect</a> having | ||
| an <a>effect target</a> for which computed property values can be calculated. | ||
| an <a>effect target</a> for which computed property values can be calculated, | ||
| as otherwise all propereties are <a>not animatable</a>. |
There was a problem hiding this comment.
Although, I'm not exactly sure what the purpose of this change is. How is it related to pseudo elements? What is the difference between saying the procedure is not applied and the properties are "not animatable"?
It's also a bit weird to say they are "not animatable" since that's something that is normally defined for the property itself. We should instead say something like they follow the same logic as not animatable properties or something. Once I understand the purpose of the change I can help suggest wording.
| <var>underlying value</var> is calculated as follows. | ||
| Note that this procedure is only performed on a <a>keyframe effect</a> having | ||
| an <a>effect target</a> for which computed property values can be calculated, | ||
| as otherwise case all propereties are <a>not animatable</a>. |
There was a problem hiding this comment.
"otherwise case"? s/calculated, as otherwise case all/calculated. Otherwise all/ ?
There was a problem hiding this comment.
As above, I'd probably avoid invoking the "not animatable" language since that's really an animation type and I think it is confusing to use that concept here. It's probably better just to say this procedure is not run on that case, or, better still, add a step that early returns if the the effect target is in a context where we can't calculate property values.
| property</a> is applied using the following process. | ||
| Note that this procedure is only performed on a <a>keyframe effect</a> having | ||
| an <a>effect target</a> for which computed property values can be calculated, | ||
| as otherwise case all propereties are <a>not animatable</a>. |
|
|
||
| 1. Set the [=target pseudo-selector=] to the result corresponding to the first | ||
| matching condition from below. | ||
| 1. Set the <a>target pseudo-selector</a> of <var>effect</var> to the result |
There was a problem hiding this comment.
(Totally unrelated but is there any reason to change [=target pseudo-selector=] to <a>target pseudo-selector</a>? I've been trying to switch to more modern bikeshed syntax bit by bit, including using [= =] instead of <a></a> where possible.)
There was a problem hiding this comment.
Sorry, I had seen the use of <a> in the line above and asked George to match it. Didn't realize [= =] was a more modern syntax and we were trying to switch to it.
Apologies for wasting your time George, but can you switch it back to [= =] then?
| {{KeyframeEffectOptions/pseudoElement}} property, | ||
| :: Set the [=target pseudo-selector=] to the value of that property, | ||
| following the validation procedure from the | ||
| {{KeyframeEffect/pseudoElement}} setter. |
There was a problem hiding this comment.
Nit: For consistency, could we follow the same format we use for composite?
e.g.
Set the [=target pseudo-selector=] to the value of the {{KeyframeEffectOptions/pseudoElement}} property.
When assigning this property, the error-handling defined for the corresponding setter on the
{{KeyframeEffect}} interface is applied. If the setter requires an exception to be thrown, this procedure
must throw the same exception and abort all further steps.
birtles
left a comment
There was a problem hiding this comment.
r=me with nits addressed
| to specify that particular [=pseudo-element=]. | ||
|
|
||
| Note that not all [=effect targets=] specified in this manner (such as ''::part()'' | ||
| pseudo-elements, unsupported/invalid pseudo-elements, and `null`) have |
There was a problem hiding this comment.
I'm not sure invalid pseudo-elements can exist, right? They're rejected at the API boundary?
What does null refer to here? The lack of a target element? (Represented by null in the programming interface) Or the lack of a target pseudo-selector?
| 1. If <a>animation type</a> of the <var>target property</var> is | ||
| <a>not animatable</a> abort this procedure | ||
| since the effect cannot be applied. | ||
| 1. If the [=effect target=] is `null` or cannot have computed property values |
There was a problem hiding this comment.
Nit: Technically I guess this should say, "The [=keyframe effect=] does not have an [=effect target=]...since we're talking about the model here. They fact that the lack of an associated effect target is represented bynull` in the programming interface is specific to the programming interface.
stephenmcgruer
left a comment
There was a problem hiding this comment.
LGTM modulo Brian's nits
Update animation composite order on pseudo-element. Implement change found in w3c/csswg-drafts#4616 making the sort order on pseudo-elements include all selectors. Add missing const declaration to KeyframeEffect::pseudoElement(). Remove empty-string case from KeyframeEffect::setPseudoElement(). Bug: 993365, 981894 Change-Id: I32ff6917b74fb490695299d0fde0c12393755437 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2031986 Commit-Queue: George Steel <gtsteel@chromium.org> Reviewed-by: Stephen McGruer <smcgruer@chromium.org> Cr-Commit-Position: refs/heads/master@{#740490}
Fixup of #4437 addressing #4301.