Closed Bug 1363639 Opened 7 years ago Closed 7 years ago

stylo: Interpolated result of CSSRect is different from gecko.

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: mantaroh, Assigned: mbrubeck)

References

Details

Attachments

(1 file)

As mentioned bug 1353918 comment 9, current stylo's intepolation of CSSRect differ from gecko's implementation.

The gecko treat whole rect as discrete when each offset's unit type differ.

For example:
  // The result is 'rect(100px, 100px, auto, 100px)' not 'rect(50px, 50px, auto, 50px)'
  var anim = elem.animate({ clip: ['rect(0px, 0px, 0px, 0px)', 'rect(100px, 100px, auto, 100px)']}, 1000);
  anim.currentTime = 500;

If each offset's unit type is same, the gecko interpolate each offset except auto value.

For example:
  // The result is 'rect(50px, 50px, auto, 50px)'
  var anim = elem.animate({ clip: ['rect(0px, 0px, auto, 0px)', 'rect(100px, 100px, auto, 100px)']}, 1000);
  anim.currentTime = 500;

We should modify the following implementation in order to be behavior same to gecko.
 - Return None when interpolating Option<> if self or other value is None
 - Check the offset of self and other when interpolating ClipRect.
   If this offset differ, throw the error.
Priority: -- → P2
Assignee: nobody → mbrubeck
Status: NEW → ASSIGNED
Amended to fix `compute_distance` too, and remove some redundant checks:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=278a490ec4a55766aef1fe9d96b40c8eed2baeb7
Comment on attachment 8870613 [details]
Bug 1363639 - stylo: Make interpolation of rect() match Gecko.

https://reviewboard.mozilla.org/r/142064/#review145732

::: layout/reftests/web-animations/1363639-1.html:26
(Diff revision 1)
> +          {clip: 'rect(0px, auto, 200px, 0px)'}
> +      ], 2000);
> +      anim.pause();
> +      anim.currentTime = 1000;
> +      document.documentElement.removeAttribute("class");
> +      console.log("done");

nit: remove `console.log`.
Attachment #8870613 - Flags: review?(emilio+bugs) → review+
Pushed by mbrubeck@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/101fb6274f8c
stylo: Make interpolation of rect() match Gecko. r=emilio
https://hg.mozilla.org/mozilla-central/rev/101fb6274f8c
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: