Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
  2.  
  3. <!--
  4.  
  5. Copyright (c) 2001 World Wide Web Consortium,
  6. (Massachusetts Institute of Technology, Institut National de
  7. Recherche en Informatique et en Automatique, Keio University).  All
  8. Rights Reserved.  This program is distributed under the W3C's Software
  9. Intellectual Property License.  This program is distributed in the
  10. hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  11. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  12. PURPOSE.  
  13.  
  14. See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  15.  
  16. -->
  17.  
  18. <!DOCTYPE test SYSTEM "dom2.dtd">
  19. <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="domimplementationhasfeature01">
  20. <metadata>
  21. <title>domimplementationhasfeature01</title>
  22. <creator>IBM</creator>
  23. <description>
  24.         The method "hasFeature(feature,version)" tests if the DOMImplementation implements
  25.         a specific feature and if so returns true.
  26.        
  27.         Call the hasFeature method on this DOMImplementation with a combination of features
  28.         versions as below.  Valid feature names are case insensitive and versions "2.0",
  29.         "1.0" and if the version is not specified, supporting any version of the feature
  30.         should return true.  Check if the value returned value was true.
  31. </description>
  32. <contributor>Neil Delima</contributor>
  33. <date qualifier="created">2002-04-24</date>
  34. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7"/>
  35. </metadata>
  36. <var name="doc" type="Document"/>              
  37. <var name="domImpl" type="DOMImplementation"/>
  38. <var name="version" type="DOMString" value="&quot;&quot;"/>            
  39. <var name="version1" type="DOMString" value="&quot;1.0&quot;"/>        
  40. <var name="version2" type="DOMString" value="&quot;2.0&quot;"/>        
  41. <var name="featureCore" type="DOMString"/>
  42. <var name="featureXML" type="DOMString"/>
  43. <var name="success" type="boolean"/>           
  44. <var name="featuresXML" type="List">
  45. <member>&quot;XML&quot;</member>
  46. <member>&quot;xmL&quot;</member>
  47. </var>
  48. <var name="featuresCore" type="List">
  49. <member>&quot;Core&quot;</member>
  50. <member>&quot;CORE&quot;</member>
  51. </var>
  52. <load var="doc" href="staffNS" willBeModified="false"/>
  53. <implementation obj="doc" var="domImpl"/>
  54. <for-each collection="featuresXML" member="featureXML">
  55. <hasFeature obj="domImpl" var="success" feature="featureXML" version="version"/>
  56. <assertTrue actual="success" id="domimplementationhasfeature01_XML_1"/>
  57. <hasFeature obj="domImpl" var="success" feature="featureXML" version="version1"/>
  58. <assertTrue actual="success" id="domimplementationhasfeature01_XML_2"/>
  59. </for-each>
  60. <for-each collection="featuresCore" member="featureCore">
  61. <hasFeature obj="domImpl" var="success" feature="featureCore" version="version"/>
  62. <assertTrue actual="success" id="domimplementationhasfeature01_Core_1"/>
  63.  
  64. <!--  result is indeterminant since Core was not defined in DOM L1   -->
  65. <hasFeature obj="domImpl" var="success" feature="featureCore" version="version1"/>
  66.  
  67. <hasFeature obj="domImpl" var="success" feature="featureCore" version="version2"/>
  68. <assertTrue actual="success" id="domimplementationhasfeature01_Core_3"/>
  69. </for-each>
  70. </test>
  71.