Howto:Extend the Canvas SVG module: Difference between revisions

Jump to navigation Jump to search
m
Line 231: Line 231:


For now, this is just a proof-of-concept, but it can be easily refined and extended, e.g. to add support for included SVG files, or for animation related tags, or even ECMAScript support via the <script> tag.
For now, this is just a proof-of-concept, but it can be easily refined and extended, e.g. to add support for included SVG files, or for animation related tags, or even ECMAScript support via the <script> tag.
=== <switch> tag ===
Typically you would use the <switch> element to show different contents based on evaluating a runtime attribute.
The switch element evaluates the ''requiredFeatures'', ''requiredExtensions'' and ''systemLanguage'' attributes on its direct child elements in order, and then processes and renders the first child for which these attributes evaluate to true. All others will be bypassed and therefore not rendered. If the child element is a container element such as a <g>, then the entire subtree is either processed/rendered or bypassed/not rendered.




[[Category:Canvas SVG]]
[[Category:Canvas SVG]]

Navigation menu