2009-10-11 03:47:01 -07:00
< html xmlns = "http://www.w3.org/1999/xhtml" >
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=519107
-->
< head >
2013-03-15 03:21:52 -07:00
< title > Test for availability of svgElement::hasFeature< / title >
2009-10-11 03:47:01 -07:00
< script type = "application/javascript" src = "/tests/SimpleTest/SimpleTest.js" > < / script >
< link rel = "stylesheet" type = "text/css" href = "/tests/SimpleTest/test.css" / >
< / head >
< body >
< a target = "_blank" href = "https://bugzilla.mozilla.org/show_bug.cgi?id=519107" > Mozilla Bug 519107< / a >
< p id = "display" > < / p >
< div id = "content" style = "display: none;" >
< svg id = "svg" xmlns = "http://www.w3.org/2000/svg" >
< / svg >
< / div >
< pre id = "test" >
< script type = "application/javascript" >
< ![CDATA[
/** Test for Bug 519107 **/
var features = [
// [feature, version, supported feature?]
// DOM Level 1
// http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-5CED94D7
["HTML", "1.0", true],
["XML", "1.0", true],
// DOM Level 2
// http://www.w3.org/TR/DOM-Level-2-Core/introduction.html#ID-Conformance
["Core", "2.0", true],
["XML", "2.0", true],
["HTML", "2.0", true],
["XHTML", "2.0", true], // DOM Level 2 HTML
["Views", "2.0", true],
["StyleSheets", "2.0", true],
["CSS", "2.0", true],
["CSS2", "2.0", true],
["Events", "2.0", true],
["UIEvents", "2.0", true],
["MouseEvents", "2.0", true],
2012-10-15 04:59:38 -07:00
["MutationEvents", "2.0", true],
2009-10-11 03:47:01 -07:00
["HTMLEvents", "2.0", true],
["Range", "2.0", true],
2012-10-15 04:59:38 -07:00
["Traversal", "2.0", true],
2009-10-11 03:47:01 -07:00
// DOM Level 3
// http://www.w3.org/TR/DOM-Level-3-Core/introduction.html#ID-Conformance
2012-10-15 04:59:38 -07:00
["Core", "3.0", true],
["XML", "3.0", true],
["Events", "3.0", true],
["UIEvents", "3.0", true],
["MouseEvents", "3.0", true],
["TextEvents", "3.0", true],
["KeyboardEvents", "3.0", true],
["MutationEvents", "3.0", true],
["MutationNameEvents", "3.0", true],
["HTMLEvents", "3.0", true],
["LS", "3.0", true],
["LS-Async", "3.0", true],
["Validation", "3.0", true],
2009-10-11 03:47:01 -07:00
["XPath", "3.0", "true"],
// current SVG feature string support status:
2014-10-25 10:21:12 -07:00
// dom/svg/nsSVGFeaturesList.h
2009-10-11 03:47:01 -07:00
// SVG 1.1
// Static festures
["http://www.w3.org/TR/SVG11/feature#CoreAttribute", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#Structure", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#ContainerAttribute", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#ConditionalProcessing", "1.1", true],
2010-12-19 16:45:29 -08:00
["http://www.w3.org/TR/SVG11/feature#Image", "1.1", true],
2009-10-11 03:47:01 -07:00
["http://www.w3.org/TR/SVG11/feature#Style", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#ViewportAttribute", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#Shape", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#Text", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#PaintAttribute", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#OpacityAttribute", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#GraphicsAttribute", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#Marker", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#ColorProfile", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#Gradient", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#Pattern", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#Clip", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#Mask", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#Filter", "1.1", false],
// Basic features
["http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#BasicText", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#BasicPaintAttribute", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#BasicGraphicsAttribute", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#BasicClip", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#BasicFilter", "1.1", false],
// Animation feature
2012-05-25 06:45:53 -07:00
["http://www.w3.org/TR/SVG11/feature#Animation", "1.1", true],
2009-10-11 03:47:01 -07:00
// Dynamic features
["http://www.w3.org/TR/SVG11/feature#DocumentEventsAttribute", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#GraphicalEventsAttribute", "1.1", true],
2010-09-11 00:05:31 -07:00
["http://www.w3.org/TR/SVG11/feature#AnimationEventsAttribute", "1.1", true],
2009-10-11 03:47:01 -07:00
["http://www.w3.org/TR/SVG11/feature#Cursor", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#Hyperlinking", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#XlinkAttribute", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#ExternalResourcesRequired", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#View", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#Script", "1.1", true],
["http://www.w3.org/TR/SVG11/feature#Font", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#BasicFont", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#Extensibility", "1.1", true],
// Feature groups (SVG 1.1 style)
["http://www.w3.org/TR/SVG11/feature#SVG", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#SVGDOM", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#SVG-static", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#SVGDOM-static", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#SVG-animation", "1.1", false],
2012-05-25 06:45:53 -07:00
["http://www.w3.org/TR/SVG11/feature#SVGDOM-animation", "1.1", true],
2009-10-11 03:47:01 -07:00
["http://www.w3.org/TR/SVG11/feature#SVG-dynamic", "1.1", false],
["http://www.w3.org/TR/SVG11/feature#SVGDOM-dynamic", "1.1", false],
// Features (SVG 1.0 style)
["org.w3c.svg", "1.0", false],
["org.w3c.svg.all", "1.0", false],
["org.w3c.svg.static", "1.0", false],
["org.w3c.svg.animation", "1.0", false],
["org.w3c.svg.dynamic", "1.0", false],
["org.w3c.dom.svg", "1.0", false],
["org.w3c.dom.svg.all", "1.0", false],
["org.w3c.dom.svg.static", "1.0", false],
2012-05-25 06:45:53 -07:00
["org.w3c.dom.svg.animation", "1.0", true],
2009-10-11 03:47:01 -07:00
["org.w3c.dom.svg.dynamic", "1.0", false]
];
2013-03-15 03:21:52 -07:00
function testHasFeature() {
2012-12-21 03:47:52 -08:00
for (var [feature, version, accepted_result] of features) {
2009-10-11 03:47:01 -07:00
if (accepted_result) {
2013-03-15 03:21:52 -07:00
ok(document.implementation.hasFeature(feature, version), "hasFeature(" + feature + ", " + version + ") returned wrong value, Was it changed to unsupported feature?");
2009-10-11 03:47:01 -07:00
} else {
2013-03-15 03:21:52 -07:00
todo(document.implementation.hasFeature(feature, version), "hasFeature(" + feature + ", " + version + ") is unsupported feature string");
2009-10-11 03:47:01 -07:00
}
}
}
function main() {
2013-03-15 03:21:52 -07:00
testHasFeature();
2009-10-11 03:47:01 -07:00
SimpleTest.finish();
}
window.addEventListener("load", main, false);
SimpleTest.waitForExplicitFinish();
]]>
< / script >
< / pre >
< / body >
< / html >