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 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_nodechildnodesappendchild">
  15. <metadata>
  16. <title>hc_nodeChildNodesAppendChild</title>
  17. <creator>Curt Arnold</creator>
  18. <description>
  19.    The NodeList returned by the "getChildNodes()" method
  20.    is live.   Changes on the node's children are immediately
  21.     reflected on the nodes returned in the NodeList.
  22.    
  23.     Create a NodeList of the children of the second employee
  24.     and then add a newly created element that was created
  25.     by the "createElement()" method(Document Interface) to
  26.     the second employee by using the "appendChild()" method.
  27.     The length of the NodeList should reflect this new
  28.     addition to the child list.   It should return the value 14.
  29. </description>
  30.  
  31. <date qualifier="created">2002-06-09</date>
  32. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987"/>
  33. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107"/>
  34. <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246"/>
  35. <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247"/>
  36. </metadata>
  37. <var name="doc" type="Document"/>
  38. <var name="elementList" type="NodeList"/>
  39. <var name="employeeNode" type="Node"/>
  40. <var name="childList" type="NodeList"/>
  41. <var name="createdNode" type="Node"/>
  42. <var name="childNode" type="Node"/>
  43. <var name="childName" type="DOMString"/>
  44. <var name="childType" type="int"/>
  45. <var name="textNode" type="Node"/>
  46. <var name="actual" type="List"/>
  47. <var name="expected" type="List">
  48. <member>"em"</member>
  49. <member>"strong"</member>
  50. <member>"code"</member>
  51. <member>"sup"</member>
  52. <member>"var"</member>
  53. <member>"acronym"</member>
  54. <member>"br"</member>
  55. </var>
  56. <load var="doc" href="hc_staff" willBeModified="true"/>
  57. <getElementsByTagName interface="Document" obj="doc" tagname='"p"' var="elementList"/>
  58. <item interface="NodeList" obj="elementList" index="1" var="employeeNode"/>
  59. <childNodes obj="employeeNode" var="childList"/>
  60. <createElement obj="doc" var="createdNode" tagName='"br"'/>
  61. <appendChild obj="employeeNode" newChild="createdNode" var="employeeNode"/>
  62. <for-each collection="childList" member="childNode">
  63.     <nodeName var="childName" obj="childNode"/>
  64.     <nodeType var="childType" obj="childNode"/>
  65.     <if><equals actual="childType" expected="1"/>
  66.         <append collection="actual" item="childName"/>
  67.         <else>
  68.             <assertEquals id="textNodeType" actual="childType" expected="3" ignoreCase="false"/>
  69.         </else>
  70.     </if>
  71. </for-each>
  72. <assertEquals actual="actual" expected="expected" id="childElements" ignoreCase="auto"/>
  73. </test>
  74.