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_attrinsertbefore3">
  15. <metadata>
  16. <title>hc_attrinsertbefore3</title>
  17. <creator>Curt Arnold</creator>
  18. <description>
  19. Appends a document fragment to an attribute and checks if the value of
  20. the attribute is changed.
  21. </description>
  22.  
  23. <date qualifier="created">2004-01-01</date>
  24. <!--  Attr interface  -->
  25. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024"/>
  26. <!--  Node.insertBefore   -->
  27. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727"/>
  28. </metadata>
  29.  
  30. <var name="doc" type="Document"/>
  31. <var name="acronymList" type="NodeList"/>
  32. <var name="testNode" type="Node"/>
  33. <var name="attributes" type="NamedNodeMap"/>
  34. <var name="titleAttr" type="Attr"/>
  35. <var name="value" type="DOMString"/>
  36. <var name="terNode" type="Text"/>
  37. <var name="dayNode" type="Text"/>
  38. <var name="docFrag" type="DocumentFragment"/>
  39. <var name="retval" type="Node"/>
  40. <var name="firstChild" type="Node"/>
  41. <var name="lastChild" type="Node"/>
  42. <var name="refChild" type="Node" isNull="true"/>
  43. <load var="doc" href="hc_staff" willBeModified="true"/>
  44. <getElementsByTagName interface="Document" obj="doc" var="acronymList" tagname='"acronym"'/>
  45. <item interface="NodeList" obj="acronymList" var="testNode" index="3"/>
  46. <attributes obj="testNode" var="attributes"/>
  47. <getNamedItem obj="attributes" var="titleAttr" name='"title"'/>
  48.  
  49. <createTextNode var="terNode" obj="doc" data='"ter"'/>
  50. <createTextNode var="dayNode" obj="doc" data='"day"'/>
  51. <createDocumentFragment var="docFrag" obj="doc"/>
  52. <appendChild var="retval" obj="docFrag" newChild="terNode"/>
  53. <appendChild var="retval" obj="docFrag" newChild="dayNode"/>
  54.  
  55. <insertBefore var="retval" obj="titleAttr" newChild="docFrag" refChild="refChild"/>
  56.  
  57. <!--  check that Attr.value gives expected result   -->
  58. <value interface="Attr" obj="titleAttr" var="value"/>
  59. <assertEquals actual="value" expected='"Yesterday"' id="attrValue" ignoreCase="false"/>
  60.  
  61. <!--  check that Node.value gives expected result   -->
  62. <nodeValue obj="titleAttr" var="value"/>
  63. <assertEquals actual="value" expected='"Yesterday"' id="attrNodeValue" ignoreCase="false"/>
  64.  
  65. <!--  check that retval is the appended node  -->
  66. <nodeValue obj="retval" var="value"/>
  67. <assertNull actual="value" id="retvalValue"/>
  68.  
  69. <!--  check that firstChild is the existing node   -->
  70. <firstChild var="firstChild" obj="titleAttr" interface="Node"/>
  71. <nodeValue obj="firstChild" var="value"/>
  72. <assertEquals actual="value" expected='"Yes"' id="firstChildValue" ignoreCase="false"/>
  73.  
  74.  
  75. <!--  check that lastChild is the last child of the doc fragment   -->
  76. <lastChild var="lastChild" obj="titleAttr" interface="Node"/>
  77. <nodeValue obj="lastChild" var="value"/>
  78. <assertEquals actual="value" expected='"day"' id="lastChildValue" ignoreCase="false"/>
  79. </test>
  80.