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_nodeappendchilddocfragment">
  15. <metadata>
  16. <title>hc_nodeAppendChildDocFragment</title>
  17. <creator>Curt Arnold</creator>
  18. <description>
  19.    If the "newChild" is a DocumentFragment object then
  20.    all its content is added to the child list of this node.
  21.    
  22.    Create and populate a new DocumentFragment object and
  23.    append it to the second employee.   After the
  24.    "appendChild(newChild)" method is invoked retrieve the
  25.    new nodes at the end of the list, they should be the
  26.    two Element nodes from the DocumentFragment.
  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. <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=247"/>
  33. </metadata>
  34. <var name="doc" type="Document"/>
  35. <var name="elementList" type="NodeList"/>
  36. <var name="employeeNode" type="Node"/>
  37. <var name="childList" type="NodeList"/>
  38. <var name="newdocFragment" type="DocumentFragment"/>
  39. <var name="newChild1" type="Node"/>
  40. <var name="newChild2" type="Node"/>
  41. <var name="child" type="Node"/>
  42. <var name="childName" type="DOMString"/>
  43. <var name="result" type="List"/>
  44. <var name="appendedChild" type="Node"/>
  45. <var name="nodeType" type="int"/>
  46. <var name="expected" type="List">
  47. <member>"em"</member>
  48. <member>"strong"</member>
  49. <member>"code"</member>
  50. <member>"sup"</member>
  51. <member>"var"</member>
  52. <member>"acronym"</member>
  53. <member>"br"</member>
  54. <member>"b"</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. <createDocumentFragment obj="doc" var="newdocFragment"/>
  61. <createElement obj="doc" tagName='"br"' var="newChild1"/>
  62. <createElement obj="doc" tagName='"b"' var="newChild2"/>
  63. <appendChild var="appendedChild" obj="newdocFragment" newChild="newChild1"/>
  64. <appendChild var="appendedChild" obj="newdocFragment" newChild="newChild2"/>
  65. <appendChild var="appendedChild" obj="employeeNode" newChild="newdocFragment"/>
  66. <for-each collection="childList" member="child">
  67. <nodeType var="nodeType" obj="child"/>
  68. <if><equals actual="nodeType" expected="1"/>
  69. <nodeName var="childName" obj="child"/>
  70. <append collection="result" item="childName"/>
  71. </if>
  72. </for-each>
  73. <assertEquals actual="result" expected="expected" ignoreCase="auto" id="nodeNames"/>
  74. </test>
  75.