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

NEW
Unassigned

Status

()

Core
CSS Parsing and Computation
P2
normal
2 months ago
a month ago

People

(Reporter: birtles, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 months ago
Created attachment 8875579 [details]
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" />
  </rect>

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
You need to log in before you can comment on or make changes to this bug.