Closed Bug 1977908 Opened 24 days ago Closed 23 days ago

An invalid animateMotion keyPoints value prevents future valid values from rendering

Categories

(Core :: SVG, defect)

Firefox 140
defect

Tracking

()

RESOLVED FIXED
142 Branch
Tracking Status
firefox142 --- fixed

People

(Reporter: lawson.kight, Assigned: longsonr)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:140.0) Gecko/20100101 Firefox/140.0

Steps to reproduce:

Use setAttributeNS to set an invalid keyPoints attribute, then set a subsequent valid result.

See https://codepen.io/lawsonkight/pen/ZYbbojL for example

Actual results:

After setting a valid attribute, the animation remains frozen

Expected results:

The animation should render correctly when a new valid attribute replaces an invalid attribute.

Well congratulations you've found bugs in both Firefox and Chrome.

See https://svgwg.org/specs/animations/#ValueAttributes

If 'paced' is specified, any ‘keyTimes’ or ‘keySplines’ will be ignored. For ‘animateMotion’, this is the default ‘calcMode’.

So setting keyPoints to "X" should do nothing. It doesn't mention keyPoints directly but it does say that the number of items must match keyTimes and if keyTimes is ignored then it seems keyPoints must be too.

Assignee: nobody → longsonr
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/53835 for changes under testing/web-platform/tests

(In reply to Robert Longson [:longsonr] from comment #1)

Well congratulations you've found bugs in both Firefox and Chrome.

See https://svgwg.org/specs/animations/#ValueAttributes

If 'paced' is specified, any ‘keyTimes’ or ‘keySplines’ will be ignored. For ‘animateMotion’, this is the default ‘calcMode’.

So setting keyPoints to "X" should do nothing. It doesn't mention keyPoints directly but it does say that the number of items must match keyTimes and if keyTimes is ignored then it seems keyPoints must be too.

Thanks for catching that, I overlooked that "paced" is the default calcMode for animateMotion

It looks like there are two independent bugs:

  1. keyPoints should be ignored if calcMode="paced"
  2. Animations with bad data should render correctly once the bad data is removed

For number 2, I see that the issues also exists for keyTimes="X" on both <animate> and <animateMotion> elements where calcMode="linear", where changing the keyTimes value from "X" to "0;1" does not fix the broken render unless you completely remove and then re-add the attribute.

If keyPoints is ignored then there is no possibility of bad data. You can try this change in the next nightly. If there are any more bugs post that landing then do raise new issues.

That is a workaround on Firefox because removeAttribute clears the cached error state.

and thank you for reporting this.

Status: ASSIGNED → RESOLVED
Closed: 23 days ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-triage-done-c143/b142]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: