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"?>
  2. <!--
  3. Copyright (c) 2001-2004 World Wide Web Consortium,
  4. (Massachusetts Institute of Technology, Institut National de
  5. Recherche en Informatique et en Automatique, Keio University). All
  6. Rights Reserved. This program is distributed under the W3C's Software
  7. Intellectual Property License. This program is distributed in the
  8. hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  9. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  10. PURPOSE.
  11. See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  12. --><!DOCTYPE test SYSTEM "dom1.dtd">
  13.  
  14. <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="hc_nodecloneattributescopied">
  15. <metadata>
  16. <title>hc_nodecloneattributescopied</title>
  17. <creator>Curt Arnold</creator>
  18. <description>
  19.     Retrieve the second acronym element and invoke
  20.     the cloneNode method.   The
  21.     duplicate node returned by the method should copy the
  22.     attributes associated with this node.
  23. </description>
  24.  
  25. <date qualifier="created">2002-06-09</date>
  26. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096"/>
  27. <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=236"/>
  28. <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=184"/>
  29. </metadata>
  30. <var name="doc" type="Document"/>
  31. <var name="elementList" type="NodeList"/>
  32. <var name="addressNode" type="Node"/>
  33. <var name="clonedNode" type="Node"/>
  34. <var name="attributes" type="NamedNodeMap"/>
  35. <var name="attributeNode" type="Node"/>
  36. <var name="attributeName" type="DOMString"/>
  37. <var name="result" type="Collection"/>
  38. <var name="htmlExpected" type="Collection">
  39. <member>"class"</member>
  40. <member>"title"</member>
  41. </var>
  42. <var name="expected" type="Collection">
  43. <member>"class"</member>
  44. <member>"title"</member>
  45. <member>"dir"</member>
  46. </var>
  47. <load var="doc" href="hc_staff" willBeModified="true"/>
  48. <getElementsByTagName interface="Document" obj="doc" tagname='"acronym"' var="elementList"/>
  49. <item interface="NodeList" obj="elementList" index="1" var="addressNode"/>
  50. <cloneNode obj="addressNode" deep="false" var="clonedNode"/>
  51. <attributes obj="clonedNode" var="attributes"/>
  52. <for-each collection="attributes" member="attributeNode">
  53. <nodeName obj="attributeNode" var="attributeName"/>
  54. <append collection="result" item="attributeName"/>
  55. </for-each>
  56. <if><contentType type="text/html"/>
  57. <assertEquals actual="result" expected="htmlExpected" id="nodeNames_html" ignoreCase="true"/>
  58. <else>
  59. <assertEquals actual="result" expected="expected" id="nodeNames" ignoreCase="false"/>
  60. </else>
  61. </if>
  62. </test>
  63.