Skip to content

Conversation

@george-steel
Copy link
Contributor

@george-steel george-steel commented Dec 19, 2019

Fixup of #4437 addressing #4301.

@george-steel
Copy link
Contributor Author

@stephenmcgruer @birtles

@stephenmcgruer stephenmcgruer changed the title add pseudoElement option to constructor body [web-animations-1] add pseudoElement option to constructor body Dec 21, 2019
@birtles
Copy link
Contributor

birtles commented Jan 22, 2020

@george-steel Anything I can do to help get this landed?

@george-steel
Copy link
Contributor Author

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
@george-steel george-steel changed the title [web-animations-1] add pseudoElement option to constructor body [web-animations-1] Resolve remaining issues missed in pseudo-element change. Jan 24, 2020
@george-steel
Copy link
Contributor Author

@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.

Copy link
Contributor

@birtles birtles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

properties

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point

<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>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"otherwise case"? s/calculated, as otherwise case all/calculated. Otherwise all/ ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

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>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed


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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephenmcgruer requested this change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

{{KeyframeEffectOptions/pseudoElement}} property,
:: Set the [=target pseudo-selector=] to the value of that property,
following the validation procedure from the
{{KeyframeEffect/pseudoElement}} setter.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@birtles birtles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@stephenmcgruer stephenmcgruer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo Brian's nits

@stephenmcgruer stephenmcgruer merged commit c03272e into w3c:master Jan 30, 2020
pull bot pushed a commit to FreddyZeng/chromium that referenced this pull request Feb 12, 2020
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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants