Closed Bug 1069931 Opened 11 years ago Closed 1 year ago

Implement 'discard' element from SVG Animations

Categories

(Core :: SVG, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: err, Assigned: longsonr)

References

(Blocks 1 open bug, )

Details

(Keywords: dev-doc-complete)

Attachments

(3 files, 1 obsolete file)

Attached image svgt12_discard.svg
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0 Build ID: 20140918030202 Steps to reproduce: See this test from Erik Dahlström, Opera Software: http://xn--dahlstrm-t4a.net/svg/smil/svgt12_discard.svg (also attached in case the link breaks) Actual results: Test fails: after 10 seconds still says "Loading..." Expected results: At the end of animation <discard> should remove its parent <g> so that the first element (<text>Load complete</text>) should become visible. It already works in old Opera (Presto) and current Chrome, so it would be great to see this feature implemented in Firefox in order to start using it in practice. Spec: http://www.w3.org/TR/SVG2/struct.html#DiscardElement Corresponding Chrome bug: http://code.google.com/p/chromium/issues/detail?id=327339 Test from SVG 1.2 Tiny Test Suite, that works in Opera but doesn't work in Chrome for some reason: http://www.w3.org/Graphics/SVG/Test/20080912/htmlObjectHarness/struct-discard-207-t.html
Severity: normal → enhancement
The <discard> element was moved to the SVG Animations spec. in the meantime. Sebastian
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 7 → All
Hardware: x86_64 → All
Summary: Implement discard tag from SVG 2 → Implement 'discard' element from SVG Animations
Blocks: svg2
Partially implemented in Chromium and marked as fixed, but still incomplete...
Severity: normal → S3
Assignee: nobody → longsonr
Status: NEW → ASSIGNED
Attached patch parser.txt (obsolete) — Splinter Review
Attachment #9325445 - Flags: review?(hsivonen)
Comment on attachment 9325445 [details] [diff] [review] parser.txt Review of attachment 9325445 [details] [diff] [review]: ----------------------------------------------------------------- r+ Thanks.
Attachment #9325445 - Flags: review?(hsivonen) → review+
Attachment #9325443 - Attachment description: Bug 1069931 - Implement the discard element from SVG Animations r=emilio,hsivonen → Bug 1069931 - Implement the discard element from SVG Animations r=dholbert
Attachment #9325443 - Attachment description: Bug 1069931 - Implement the discard element from SVG Animations r=dholbert → Bug 1069931 - Implement 'discard' element from SVG Animations r=dholbert
Pushed by longsonr@gmail.com: https://hg.mozilla.org/integration/autoland/rev/86f62a648ef0 Implement 'discard' element from SVG Animations r=emilio,hsivonen,dholbert,frontend-codestyle-reviewers
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/50028 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
Upstream PR merged by moz-wptsync-bot

:longonr could you consider nominating this for a release note? (Process info)
We could include it in the nightly only release notes.

Flags: needinfo?(longsonr)

Release Note Request (optional, but appreciated)
[Why is this notable]:
[Affects Firefox for Android]: yes
[Suggested wording]: Firefox has an implementation of the SVG discard element. The discard element was originally part of SVG 1.2 tiny and is now part of the SVG 2 animations specification. Currently enabled on nightly only but there will be a pref svg.discard.enabled that you can enable from Firefox 136.
[Links (documentation, blog post, etc)]:
https://svgwg.org/specs/animations/#DiscardElement
https://wpt.fyi/results/svg/animations/reftests?label=experimental&label=master&aligned
https://stackoverflow.com/questions/63411964/svg-animation-discard-element

relnote-firefox: --- → ?
Flags: needinfo?(longsonr)
Attached patch parser.txtSplinter Review

I think this is what you need to update the html parser code.

Attachment #9325445 - Attachment is obsolete: true
Flags: needinfo?(hsivonen)

Thanks. Added to the Fx136 nightly release notes, please allow 30 minutes for the site to update.

FF136 MDN docs for this can be tracked in https://github.com/mdn/content/issues/37939

I've written some test code, and I can verify that <discard> works as you would expect in a stand-alone SVG file that is included into HTML as an image. However when I try declare the same SVG inline with my HTML the discard does not appear to work. Is it expected to? Are there specific conditions that should block it doing so?

Flags: needinfo?(longsonr)

Also, do you know how I might get permission to use a modified version of that image linked above http://xn--dahlstrm-t4a.net/svg/smil/svgt12_discard.svg in the docs?

There are plenty of tests in https://wpt.fyi/results/svg/animations/reftests?label=master&label=experimental&aligned that you can modify.

There aren't any restrictions on discard in HTML e.g. https://wpt.fyi/results/svg/animations/discard-check-removal-order.html?label=experimental&label=master&aligned passes although that creates a discard element dynamically. In HTML discard (like all SVG) does need to be a descendant of an <svg> element. If you attach your testcase to this bug or send it to me directly I can take a look.

Flags: needinfo?(longsonr)

removing nightly+ flag since this will be in the 137 release notes via bug 1945330

Regressions: 1951898
Regressions: 1951895
No longer regressions: 1951898

FYI, MDN work to unship this in 137/138 linked in https://bugzilla.mozilla.org/show_bug.cgi?id=1954608#c14

Regressions: 1964009
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: