stylo: test_smilKeyTimes.xhtml fails due to failing to fall back to calcMode=discrete

RESOLVED FIXED in Firefox 57

Status

()

enhancement
P2
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: birtles, Assigned: birtles)

Tracking

(Blocks 2 bugs)

Trunk
mozilla57
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
test_smilKeyTimes.xhtml fails with the following errors:

TEST-UNEXPECTED-FAIL | dom/smil/test/test_smilKeyTimes.xhtml | Test case [non-interpolatable fallback] (keyTimes: '0;.2;1' calcMode: linear), t=1.9: Unexpected sample value: - got "round", expected "butt"
TEST-UNEXPECTED-FAIL | dom/smil/test/test_smilKeyTimes.xhtml | Test case [non-interpolatable fallback] (keyTimes: '0;.2;1' calcMode: linear), t=9.9: Unexpected sample value: - got "square", expected "round"

From my initial analysis, in nsSMILAnimationFunction::InterpolateResult we should get an error result when we call `from->Interpolate(*to, intervalProgress, aResult)` (i.e. nsSMILCSSValueType::Interpolate) and that will make us fall back to calcMode=discrete which has special behavior when keyTimes are used.

However, in add_weighted for `AnimationValue` we do the discrete interpolation and then return Ok(). Perhaps in SMIL-land we need to call Servo_Property_IsDiscreteAnimatable is return an error in that case?
(Assignee)

Comment 1

2 years ago
We can easily fix this on the SMIL side, however I wonder if Servo_AnimationValues_IsInterpolable and Servo_AnimationValues_Interpolate should actually return false / fail for discrete properties? The only trouble is that in order to do that we'd either need to:

a) Add an extra method to AnimationValue
b) Pass an extra property parameter to these methods

(a) seems bad from a code size point of view. (b) seems a bit messy and unnecessary for transitions (which check for discretely animatable properties earlier on).

For now I'm just going to fix this on the SMIL side.
Assignee: nobody → bbirtles
Status: NEW → ASSIGNED
Comment hidden (mozreview-request)

Comment 3

2 years ago
mozreview-review
Comment on attachment 8897298 [details]
Bug 1390384 - Apply SMIL's calcMode=discrete handling to discretely animatable properties in Stylo;

https://reviewboard.mozilla.org/r/168600/#review173834

::: dom/smil/nsSMILCSSValueType.cpp:565
(Diff revision 1)
> +    CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aProperty,
> +                                         CSSEnabledState::eForAllContent) {
> +      // If the shorthand has one or more non-discrete components, it should not
> +      // be treated as discrete.
> +      if (!Servo_Property_IsDiscreteAnimatable(*p)) {
> +        result = false;

Nit: This should be resultAccordingToServo?

::: dom/smil/test/mochitest.ini
(Diff revision 1)
>  [test_smilGetStartTime.xhtml]
>  [test_smilHyperlinking.xhtml]
>  [test_smilInvalidValues.html]
>  [test_smilKeySplines.xhtml]
>  [test_smilKeyTimes.xhtml]
> -skip-if = stylo

Yay!
Attachment #8897298 - Flags: review?(hikezoe) → review+
(Assignee)

Comment 4

2 years ago
(In reply to Hiroyuki Ikezoe (:hiro) from comment #3)
> ::: dom/smil/nsSMILCSSValueType.cpp:565
> (Diff revision 1)
> > +    CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aProperty,
> > +                                         CSSEnabledState::eForAllContent) {
> > +      // If the shorthand has one or more non-discrete components, it should not
> > +      // be treated as discrete.
> > +      if (!Servo_Property_IsDiscreteAnimatable(*p)) {
> > +        result = false;
> 
> Nit: This should be resultAccordingToServo?

Oh, good catch!
(Assignee)

Comment 5

2 years ago
After making the review change and running a few more tests I discovered that 'text-decoration' is not discrete (since the underline color can be interpolated) but 'marker' is. I'm less sure about the special shorthand handling after all.

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

Comment 7

2 years ago
Pushed by bbirtles@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6116b4a41649
Apply SMIL's calcMode=discrete handling to discretely animatable properties in Stylo; r=hiro

Comment 8

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/6116b4a41649
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
(Assignee)

Updated

2 years ago
Depends on: 1390766
You need to log in before you can comment on or make changes to this bug.