Closed Bug 1465066 Opened 6 years ago Closed 6 years ago

Cleanup transform animation.

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: emilio, Assigned: emilio)

Details

Attachments

(1 file)

The recent changes we made to it allows for it to be cleaner.
Comment on attachment 8981415 [details]
Bug 1465066: Cleanup transform animation.

https://reviewboard.mozilla.org/r/247540/#review253816

Thanks for doing this!  I did forget to merge the empty list cases into the function in bug 1464647.

::: servo/components/style/properties/helpers/animated_properties.mako.rs:2542
(Diff revision 2)
> +            let already_mismatched = matches!(
> +                longer[0],
> +                TransformOperation::InterpolateMatrix { .. } |
> +                TransformOperation::AccumulateMatrix { .. }
> +            );

At first glance I didn't understand why we need the InterpolationMatrix|AccumulateMatrix check in the function, but yeah it's the case that the length mismatches but the first nth operations matches (nth == the shorter list length).  In such cases, we should bail out before extending the shorter list, I guess?  Extending identity matrices shouldn't cause any issues but..
Attachment #8981415 - Flags: review?(hikezoe) → review+
(In reply to Hiroyuki Ikezoe (:hiro) from comment #3)
> Comment on attachment 8981415 [details]
> Bug 1465066: Cleanup transform animation.
> 
> https://reviewboard.mozilla.org/r/247540/#review253816
> 
> Thanks for doing this!  I did forget to merge the empty list cases into the
> function in bug 1464647.
> 
> :::
> servo/components/style/properties/helpers/animated_properties.mako.rs:2542
> (Diff revision 2)
> > +            let already_mismatched = matches!(
> > +                longer[0],
> > +                TransformOperation::InterpolateMatrix { .. } |
> > +                TransformOperation::AccumulateMatrix { .. }
> > +            );
> 
> At first glance I didn't understand why we need the
> InterpolationMatrix|AccumulateMatrix check in the function, but yeah it's
> the case that the length mismatches but the first nth operations matches
> (nth == the shorter list length).  In such cases, we should bail out before
> extending the shorter list, I guess?  Extending identity matrices shouldn't
> cause any issues but..

I thought it wouldn't be needed either but it is. We cannot really treat InterpolateMatrix { .. } as matched, because then we fail to interpolate it and return an error instead when we interpolate it with, let's say, `none`.

We do need to extend it though, or at least we were doing that already. This was caught by: dom/animation/test/style/test_interpolation-from-interpolatematrix-to-none.html
(In reply to Emilio Cobos Álvarez [:emilio] from comment #4)
> (In reply to Hiroyuki Ikezoe (:hiro) from comment #3)
> > Comment on attachment 8981415 [details]
> > Bug 1465066: Cleanup transform animation.
> > 
> > https://reviewboard.mozilla.org/r/247540/#review253816
> > 
> > Thanks for doing this!  I did forget to merge the empty list cases into the
> > function in bug 1464647.
> > 
> > :::
> > servo/components/style/properties/helpers/animated_properties.mako.rs:2542
> > (Diff revision 2)
> > > +            let already_mismatched = matches!(
> > > +                longer[0],
> > > +                TransformOperation::InterpolateMatrix { .. } |
> > > +                TransformOperation::AccumulateMatrix { .. }
> > > +            );
> > 
> > At first glance I didn't understand why we need the
> > InterpolationMatrix|AccumulateMatrix check in the function, but yeah it's
> > the case that the length mismatches but the first nth operations matches
> > (nth == the shorter list length).  In such cases, we should bail out before
> > extending the shorter list, I guess?  Extending identity matrices shouldn't
> > cause any issues but..
> 
> I thought it wouldn't be needed either but it is. We cannot really treat
> InterpolateMatrix { .. } as matched, because then we fail to interpolate it
> and return an error instead when we interpolate it with, let's say, `none`.
> 
> We do need to extend it though, or at least we were doing that already. This
> was caught by:
> dom/animation/test/style/test_interpolation-from-interpolatematrix-to-none.
> html

Oh I see. emtpry list slips through iter().zip() check, right?  Ok, that's fair.
Priority: -- → P3
https://hg.mozilla.org/mozilla-central/rev/0b2331837a98
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: