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-2003 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_nodeappendchildchildexists">
  15. <metadata>
  16. <title>hc_nodeAppendChildChildExists</title>
  17. <creator>Curt Arnold</creator>
  18. <description>
  19.    If the "newChild" is already in the tree, it is first
  20.    removed before the new one is appended.
  21.    
  22.    Retrieve the "em" second employee and  
  23.    append the first child to the end of the list.   After
  24.    the "appendChild(newChild)" method is invoked the first
  25.    child should be the one that was second and the last
  26.    child should be the one that was first.
  27. </description>
  28.  
  29. <date qualifier="created">2002-06-09</date>
  30. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107"/>
  31. <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246"/>
  32. </metadata>
  33. <var name="doc" type="Document"/>
  34. <var name="elementList" type="NodeList"/>
  35. <var name="childList" type="NodeList"/>
  36. <var name="childNode" type="Node"/>
  37. <var name="newChild" type="Node"/>
  38. <var name="memberNode" type="Node"/>
  39. <var name="memberName" type="DOMString"/>
  40. <var name="refreshedActual" type="List"/>
  41. <var name="actual" type="List"/>
  42. <var name="nodeType" type="int"/>
  43. <var name="expected" type="List">
  44. <member>"strong"</member>
  45. <member>"code"</member>
  46. <member>"sup"</member>
  47. <member>"var"</member>
  48. <member>"acronym"</member>
  49. <member>"em"</member>
  50. </var>
  51. <var name="appendedChild" type="Node"/>
  52. <load var="doc" href="hc_staff" willBeModified="true"/>
  53. <getElementsByTagName interface="Document" obj="doc" tagname='"p"' var="elementList"/>
  54. <item interface="NodeList" obj="elementList" index="1" var="childNode"/>
  55. <getElementsByTagName interface="Element" obj="childNode" var="childList" tagname='"*"'/>
  56. <item interface="NodeList" obj="childList" index="0" var="newChild"/>
  57. <appendChild var="appendedChild" obj="childNode" newChild="newChild"/>
  58. <for-each collection="childList" member="memberNode">
  59.    <nodeName var="memberName" obj="memberNode"/>
  60.    <append collection="actual" item="memberName"/>
  61. </for-each>
  62. <assertEquals id="liveByTagName" actual="actual" expected='expected' ignoreCase="auto"/>
  63. <childNodes var="childList" obj="childNode"/>
  64. <for-each collection="childList" member="memberNode">
  65.    <nodeType var="nodeType" obj="memberNode"/>
  66.    <if><equals actual="nodeType" expected="1"/>
  67.        <nodeName var="memberName" obj="memberNode"/>
  68.        <append collection="refreshedActual" item="memberName"/>
  69.    </if>
  70. </for-each>
  71. <assertEquals id="refreshedChildNodes" actual="refreshedActual" expected='expected' ignoreCase="auto"/>
  72. </test>
  73.