Closed Bug 1371174 Opened 6 years ago Closed 6 years ago

stylo: interpolating from stroke-dasharray "none" to "20" should fail (or fallback to 50% switch)


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






(Reporter: birtles, Unassigned)


(Blocks 1 open bug)



(1 file)

Attached image Test case
In dom/smil/test/test_smilCSSFromTo.xhtml we have the following failure:

  stroke-dasharray: checking value halfway through animation - got "none", expected "20"

I've reduced this in the attached test case to something like the following:

  <rect x="20" y="20" width="200" height="200" fill="purple"
    stroke="black" stroke-width="5">
    <animate attributeName="stroke-dasharray" from="inherit" to="20" dur="4s"
      fill="freeze" />
    <set attributeName="fill" to="green" begin="2s" />

In Gecko, the dash array changes after 2s (50% of the way through), i.e. at the same time the fill changes.

In Stylo, however, the dash array changes after 4s.

Debugging Stylo I see the following example output:

  Parsed stroke-dasharray property value '20' => 20
  Parsed stroke-dasharray property value 'inherit' => none

  (i.e. parsing is correct)

  Interpolating StrokeDasharray(T([])) with StrokeDasharray(T([20])) at 96.45% gives StrokeDasharray(T([]))

That is, when we go to interpolate an empty dash array list with a non-empty one, we just end up returning the empty one, even after the 50% mark. Until we introduce infallible interpolation, we should just fail in this case so SMIL can trigger the 50% switch behavior.
Priority: -- → P2
Priority: P2 → --
Priority: -- → P3
I want to make this P2 since it blocks an important test test_smilCSSFromTo.xhtml but it's probably not critical.
I working on similar phenomenon which stylo can't interpolate between percentage and length.(bug 1369614)

But the current stylo looks like support this types. (i.e. Current stylo can interpolate stroke-dasharray between "none" and "20"). I think that stylo interpolate this type as RepetableListAnimatable. (i.e. If either one of from/to values is None, stylo will animate stroke-dasharray as discrete type.)

Could you please confirm that you can reproduce this bug on current stylo?
Flags: needinfo?(bbirtles)
Yes, it works for me now. Perhaps fixed by bug 1338764?
Closed: 6 years ago
Flags: needinfo?(bbirtles)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.