Closed
Bug 473904
Opened 16 years ago
Closed 16 years ago
Add an about:config option for toggling SVG Animation (SMIL) support
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
People
(Reporter: dholbert, Assigned: dholbert)
References
()
Details
(Keywords: dev-doc-complete)
Attachments
(2 files, 1 obsolete file)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
I'm filing this bug on adding an about:config flag to let users toggle SMIL support on/off.
(Then, we can hopefully default-disable SMIL via this about:config flag and turn on the "--enable-smil" build-time flag in nightly builds. That would allow interested users to experiment with SMIL without needing to generate custom builds.)
Assignee | ||
Updated•16 years ago
|
Summary: Add an about:config option for toggling SMIL support → Add an about:config option for toggling SVG Animation (SMIL) support
Assignee | ||
Updated•16 years ago
|
Hardware: x86 → All
Comment 1•16 years ago
|
||
Might want to think about moving from --enable-smil to --disable-smil either as part of this patch or a follow-up.
Assignee | ||
Comment 2•16 years ago
|
||
(In reply to comment #1)
> Might want to think about moving from --enable-smil to --disable-smil either as
> part of this patch or a follow-up.
I've posted a patch that does this in bug 473705.
Assignee | ||
Comment 3•16 years ago
|
||
Here's a simple WIP patch for this. So far, it does the following:
- Adds a pref called 'svg.smil.enabled', which defaults to false
- When a Document is initialized, it takes a snapshot of this pref's current value
- If this snapshotted value is false, the Document will refuse to create a nsSMILAnimationController (and will return 'null' to any GetAnimationController() calls)
This disables the main SMIL animation / sampling code (for any documents initialized while the pref is disabled). It also disables all nsSMILValue-parsing code, because currently all nsSMILValue parsing is done at sample-time.
For thoroughness, we should probably disable initialization of nsSVGSVGElement::mTimedDocumentRoot, too, though I'm not yet sure of the best way to do that. (I want to think a bit more about cases with dynamic SVG element creation / transfer between documents, particularly when one document is created while SMIL is on and the other is created when SMIL is off)
Assignee | ||
Updated•16 years ago
|
Assignee: nobody → dholbert
Assignee | ||
Updated•16 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•16 years ago
|
||
(In reply to comment #3)
> For thoroughness, we should probably disable initialization of
> nsSVGSVGElement::mTimedDocumentRoot, too, though I'm not yet sure of the best
> way to do that.
This is now taken care of via Bug 481562.
If SMIL is turned off via 'svg.smil.enabled' in patch v1 here, then nsDocument::GetAnimationController() will return null (via this bug's patch), and that'll make Bug 481562's patch disable initialization of mTimedDocumentRoot. Yay!
Assignee | ||
Updated•16 years ago
|
Attachment #365395 -
Flags: superreview?(roc)
Attachment #365395 -
Flags: review?(roc)
This stops animation from working but the DOM APIs are still present and detectable. That might be bad if people use them to do feature detection. Can we also dynamically disable creation of SMIL element types at least, like we do for SVG in general?
Assignee | ||
Comment 6•16 years ago
|
||
Ok, this new patch maintains a single global smil-enabled boolean (like we do with SVG enabled-ness). This boolean controls...
(a) whether we allow ourselves to create animation-related SVG nodes in nsSVGElementFactory.cpp
(b) whether we return NS_ERROR_NOT_IMPLEMENTED in animation-related API functions on <svg> elements
(c) whether we recognize "TimeControl" in nsGenericElement::InternalIsSupported()
(d) whether we allow nsDocument to create an animation controller
Part (d) is basically the same as in my previous patch, but parts a/b/c are new and should block any feature detection when SMIL is disabled.
Attachment #365395 -
Attachment is obsolete: true
Attachment #365395 -
Flags: superreview?(roc)
Attachment #365395 -
Flags: review?(roc)
Assignee | ||
Comment 7•16 years ago
|
||
Here's a version of patch v2 with whitespace-changes excluded. (since a number of the changes are simply adding "if (NS_SMILEnabled()) {" above a block of code)
Attachment #366444 -
Flags: superreview?(roc)
Attachment #366444 -
Flags: review?(roc)
Assignee | ||
Comment 8•16 years ago
|
||
BTW, I've confirmed that we pass all SMIL reftests with this patch applied (and with the svg.smil.enabled pref turned on).
Attachment #366444 -
Flags: superreview?(roc)
Attachment #366444 -
Flags: superreview+
Attachment #366444 -
Flags: review?(roc)
Attachment #366444 -
Flags: review+
Assignee | ||
Comment 9•16 years ago
|
||
Pushed attachment 366441 [details] [diff] [review]: http://hg.mozilla.org/mozilla-central/rev/ba3ad61aa365
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•16 years ago
|
Blocks: enablesmil
Updated•15 years ago
|
Keywords: dev-doc-needed
Comment 10•15 years ago
|
||
This is mentioned in several places in the SVG documentation, as well as in this new article that's under construction:
https://developer.mozilla.org/en/SVG_animation_%28SMIL%29_in_Firefox
Keywords: dev-doc-needed → dev-doc-complete
Comment 11•15 years ago
|
||
We've just turned off support in 3.6 (bug 512594) Animation is now 1.9.3 only.
You need to log in
before you can comment on or make changes to this bug.
Description
•