mirror of
https://github.com/servo/servo.git
synced 2025-06-21 23:59:00 +01:00
style: Make the TElement type arrive to the cascade
function.
Not super-proud of this one, but it's the easiest way I could think of. The changeset looks bigger than what it is, because while at it I've rewrapped a fair amount of functions around to use proper block indentation. Alternatives are parameterizing Stylist by <E>, which is not fun, or moving the concrete element from layout_thread to layout, but that implies layout depending on script, which isn't fun either. Other alternative is implementing an empty enum and making anon boxes work on it. It has the advantage of removing the annoying type parameter, but the disadvantage of instantiating `cascade` twice, which isn't great, and having to maintain all the boilerplate of a `TElement` implementation that just does nothing.
This commit is contained in:
parent
6f543d3de1
commit
5ac12b5df4
10 changed files with 425 additions and 207 deletions
|
@ -460,10 +460,12 @@ trait PrivateMatchMethods: TElement {
|
|||
// See #12171 and the associated PR for an example where this
|
||||
// happened while debugging other release panic.
|
||||
if !running_animation.is_expired() {
|
||||
animation::update_style_for_animation(context,
|
||||
running_animation,
|
||||
style,
|
||||
font_metrics);
|
||||
animation::update_style_for_animation::<Self>(
|
||||
context,
|
||||
running_animation,
|
||||
style,
|
||||
font_metrics,
|
||||
);
|
||||
if let Animation::Transition(_, _, ref frame, _) = *running_animation {
|
||||
possibly_expired_animations.push(frame.property_animation.clone())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue