TestCoverage/5-Document-Structure
This page is an archive of the previous Group's wiki from http://www.w3.org/Graphics/SVG/Group/wiki.
Test Coverage for SVG Tiny 1.2 Chapter 5: Document Structure
Legend:
- is a comment or note
✓ is an assertion or feature that is fully covered in the test suite
# is an assertion or feature that is partially or not covered in the test suite
5.1 SVG Document Fragments
✓ "An SVG document fragment can only contain one single 'svg' element, this means that 'svg' elements cannot appear in the middle of SVG content."
- Testable, but need to be careful with pass criteria since 1.1 viewers may display something.
# "In all cases, for compliance with either the "Namespaces in XML 1.0" or the "Namespaces in XML 1.1" Recommendations [XML-NS10][XML-NS], an SVG namespace declaration must be in scope for the 'svg' element, so that all SVG elements are identified as belonging to the SVG namespace."
- Make a test file with non-svg file-extension and without specifying namespace, perhaps *.xml.
- Partially covered by struct-frag-05-t.svg
5.1.2 The 'svg' element
✓ <width> "A negative value for width/height on 'svg' is an error."
✓ "Note that 'animateMotion' and 'animateTransform' are legal as children to 'svg' but don't apply to 'svg' parents (since the 'svg' element doesn't have a 'transform' attribute)."
5.3 The 'defs' element
# "The actual value of the 'display' property on the 'defs' element or any of its descendants does not change the rendering of these elements or prevent these elements from being referenced."
5.4 The 'discard' element
✓ Test that the 'begin' attribute on <discard> doesn't allow repeat-value or wallclock-sync-value (as all the other 'begin' attributes do).
✓ "The removal operation acts as if the method removeChild were called on the parent of the target element with the target element as parameter."
✓ "The SVG User Agent must remove the target node as well as all of its attributes and descendants."
- Partially tested by struct-discard-01-t.svg.
# Need to test xlink:href on <discard> is not animatable.
✓ "After removal of the target element, the 'discard' element is no longer useful. It must also be discarded following the target element removal. If the target element did not exist, the 'discard' element must still be removed following activation."
# "Seeking backwards in the timeline must not re-insert the discarded elements."
✓ "The 'discard' element itself can be discarded prior to its activation, in which case it will never trigger the removal of its own target element. UA's must allow the 'discard' element to be the target of another 'discard' element."
# Test all the reference restrictions from: http://www.w3.org/Graphics/SVG/Group/repository/spec/mobile/1.2/1.2NG/master/linking.html#ReferenceRestrictions
# Test data IRI:s (RFC 2397).
5.5 The 'desc' and 'title' elements
# "If SVG User Agents need to choose among multiple 'desc' or 'title' elements for processing (e.g., to decide which string to use for a (tooltip), the user agent shall choose the first one the test attributes of which resolve to true."
5.6 The 'use' element
# "Unlike 'animation', the 'use' element cannot reference entire files."
# Test all the reference restrictions from: http://www.w3.org/Graphics/SVG/Group/repository/spec/mobile/1.2/1.2NG/master/linking.html#ReferenceRestrictions
- See struct-use-06-t.svg,struct-use-04-t.svg.
✓ "The deeply-cloned tree, also referred to as the shadow tree, is then kept in synchronization with the contents of the referenced element, so that any animation, DOM manipulation, or non-DOM interactive state occurring on the referenced element are also applied to the 'use' element's deeply-cloned tree."
✓' "Animations on a referenced element will cause the instances to also be animated."
✓ "Relative IRIs on nodes in shadow trees are resolved relative to any 'xml:base' on the node itself, then recursively on any 'xml:base' on their parentNode, and finally any 'xml:base' on the ownerDocument if there is no parentNode."
# "If the 'use' element has a computed value of visibility='hidden' and the element it references specifies visibility='hidden' or visibility='inherit', then that element will be hidden. However, if the referenced element instead specifies visibility='visible', then that element will be visible even if the 'use' element specifies visibility='hidden'."
#"If an event listener is registered on a referenced element, then the actual target for the event will be the SVGElementInstance object within the "instance tree" corresponding to the given referenced element."
# "An event propagates through the exposed and non-exposed portions of the tree in the same manner as it would in the regular document tree: first going to the target of the event, then bubbling back through non-exposed tree to the 'use' element and then back through regular tree to the rootmost svg element in the bubbling phase."
- Applies in part to struct-use-07-b.svg, which of course needs to be restructured to become tiny 1.2 content.
# "Note also that any changes to the used element are immediately reflected in the generated content."
# Test data IRI:s (RFC 2397).
5.7 The 'image' element
✓ "The 'image' element supports the 'opacity' property for controlling the image opacity."
# "The 'fill-opacity' property does not affect the rendering of an image."
# Negative values for width/height on <image> is an error.
# Test all the reference restrictions from: http://www.w3.org/Graphics/SVG/Group/repository/spec/mobile/1.2/1.2NG/master/linking.html#ReferenceRestrictions
- The struct-image-05-t.svg is invalid for 1.2T, it references an svg. But it is valid 1.1 Basic, meaning the pass criteria and spec wording is a bit unclear.
5.8 Conditional processing
✓ "The 'switch' renders the first of its direct children for which all of these attributes test true. If the given attribute is not specified, then a true value is assumed."
# "Similar to the 'display' property, conditional processing attributes only affect the direct rendering of elements and do not prevent elements from being successfully referenced by other elements (such as via a 'use')."
# "Conditional properties do not effect evaluation of 'script' elements, whose logic is run independently of conditional properties of any ancestor 'switch' elements."
# "'requiredFeatures', 'requiredExtensions', 'systemLanguage', 'requiredFormats' and 'requiredFonts' attributes do not apply to elements that are not part of the rendering tree such as 'defs' or 'linearGradient' elements but do apply to the 'audio' element."
# "'requiredFeatures', 'requiredExtensions', 'systemLanguage', 'requiredFormats' and 'requiredFonts' attributes affect 'animate', 'animateColor', 'animateMotion', 'animateTransform', and 'set' elements. If the conditional statement on these animation elements fails, the animation will never be triggered."
# "'requiredFeatures', 'requiredExtensions', 'systemLanguage', 'requiredFormats' and 'requiredFonts' attributes affect the 'discard' element. If the conditional statement on 'discard' fails, the element referred to will not be discarded."
5.8.2 The 'switch' element
# "The 'switch' element evaluates the 'requiredFeatures', 'requiredExtensions', 'systemLanguage', 'requiredFormats' and 'requiredFonts' attributes on its direct child elements in document order, and then renders the first child for which all of these attributes evaluate to true."
- Very simplistic test here: struct-cond-01-t.svg, not enough to cover the text above.
# "Note that the values of properties 'display' and 'visibility' have no effect on 'switch' element processing. In particular, setting 'display' to none on a child of a 'switch' element has no effect on the testing associated with 'switch' element processing."
# "Additionally, elements which would not otherwise be rendered due to conditional processing can still be referenced by 'id' (e.g. in the 'use' element or as the <XMLRI> of a paint server), and will be rendered in that instantiation."
5.8.3 to 5.8.6 (required* and systemLanguage)
# requiredFeatures/requiredExtensions/systemLanguage/requiredFormats are not animatable
# "If a null string or empty string value is given to attribute {requiredFeatures/requiredExtensions/systemLanguage/requiredFormats}, the attribute returns "false". "
5.8.7 The 'requiredFonts' attribute
# "The SVG User Agent must have access to all of the fonts, either installed on the system or as an SVG font defined or embedded within the document, for the attribute to evaluate to "true"."
- Could make a testcase with an svgfont.
5.9 External Resources
eRR=true: "Indicates that resources external to the current document are required. If an external resource is not available (for example the request for the required resource times out), progressive rendering is suspended, ...(continued)"
- Since progressive rendering may be done at any interval this is impossible to test.
# "...the load event is not fired for the element," This is possible to test. Also it would be nice if there was a way to load a URL with a known latency that you specify in the URL itself. This would require a serverside script.
# Test that animating eRR isn't possible. This depends on the known latency url script to be reliably testable.
5.9.2 Progressive Rendering
"SVG User Agents must implement progressive rendering although there is no minimum rendering update frequency required for conformance."
- Therefore even if progressive rendering can be tested (and I suppose it is tested by all testcases already), no particular requirements on pass criteria can be made.
5.9.3 The 'prefetch' element
"As it is a hint, user-agents may ignore 'prefetch' elements,"
- Therefore even if prefetch can be tested, no particular requirements on pass criteria can be made.
5.10.1 Attributes common to all elements: 'class', 'id', 'xml:id' and 'xml:base'
# Test that 'class' is animatable.
# Class: "This attribute indicates membership in one or more sets. Multiple set names must be separated by white space characters." Test this with script.
# Test that 'id' and 'xml:id' are not animatable.
# Test that 'xml:base' is properly used for paintservers for example.
# Test what happens when 'xml:base' has a fragment identifier.
# "when both 'id' and 'xml:id' are specified on the same element but with different values, the SVGElement::id field must return either of the values but should give precedence to the 'xml:id' attribute."
# "consequently, since SVGElement::id is updated when one of the attribute values is modified (e.g. using the setAttributeNS(), setTraitNS(), or setTrait() methods), the other attribute must be set to the same value;"
# "there remains only one single id field on the SVGElement interface, therefore when it is updated both attributes must be updated too as a consequence;"
5.10.2 The 'xml:lang' and 'xml:space' attributes
# Test that xml:lang and xml:space are not animatable.
- Invalid values for xml:space and xml:lang