stylo: Interpolated result of CSSRect is different from gecko.

RESOLVED FIXED in Firefox 55

Status

()

Core
CSS Parsing and Computation
P2
normal
RESOLVED FIXED
3 months ago
2 months ago

People

(Reporter: mantaroh, Assigned: mbrubeck)

Tracking

(Blocks: 1 bug)

unspecified
mozilla55
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox55 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

3 months ago
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)

Updated

2 months ago
Assignee: nobody → mbrubeck
Status: NEW → ASSIGNED
(Assignee)

Comment 1

2 months ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=e0db0c93f2f29d0bd44e50d2f9490e158ca4c8f9
(Assignee)

Comment 2

2 months ago
Amended to fix `compute_distance` too, and remove some redundant checks:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=278a490ec4a55766aef1fe9d96b40c8eed2baeb7
(Assignee)

Comment 3

2 months ago
Added a test:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=1c67fc038ed3dfa81f478cad0ce70f1533eb11b4
Comment hidden (mozreview-request)

Comment 5

2 months ago
mozreview-review
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+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Comment 8

2 months ago
https://github.com/servo/servo/pull/17013

Comment 9

2 months ago
Pushed by mbrubeck@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/101fb6274f8c
stylo: Make interpolation of rect() match Gecko. r=emilio

Comment 10

2 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/101fb6274f8c
Status: ASSIGNED → RESOLVED
Last Resolved: 2 months ago
status-firefox55: --- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.