OLD | NEW |
1 /* | 1 /* |
2 Copyright © 2001-2004 World Wide Web Consortium, | 2 Copyright © 2001-2004 World Wide Web Consortium, |
3 (Massachusetts Institute of Technology, European Research Consortium | 3 (Massachusetts Institute of Technology, European Research Consortium |
4 for Informatics and Mathematics, Keio University). All | 4 for Informatics and Mathematics, Keio University). All |
5 Rights Reserved. This work is distributed under the W3C® Software License [1] i
n the | 5 Rights Reserved. This work is distributed under the W3C® Software License [1] i
n the |
6 hope that it will be useful, but WITHOUT ANY WARRANTY; without even | 6 hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
7 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 7 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
8 | 8 |
9 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 | 9 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 |
10 */ | 10 */ |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 */ | 77 */ |
78 function hc_attrclonenode1() { | 78 function hc_attrclonenode1() { |
79 var success; | 79 var success; |
80 if(checkInitialization(builder, "hc_attrclonenode1") != null) return; | 80 if(checkInitialization(builder, "hc_attrclonenode1") != null) return; |
81 var doc; | 81 var doc; |
82 var acronymList; | 82 var acronymList; |
83 var testNode; | 83 var testNode; |
84 var attributes; | 84 var attributes; |
85 var titleAttr; | 85 var titleAttr; |
86 var value; | 86 var value; |
87 var textNode; | |
88 var retval; | |
89 var lastChild; | |
90 var clonedTitle; | 87 var clonedTitle; |
91 | 88 |
92 var docRef = null; | 89 var docRef = null; |
93 if (typeof(this.doc) != 'undefined') { | 90 if (typeof(this.doc) != 'undefined') { |
94 docRef = this.doc; | 91 docRef = this.doc; |
95 } | 92 } |
96 doc = load(docRef, "doc", "hc_staff"); | 93 doc = load(docRef, "doc", "hc_staff"); |
97 acronymList = doc.getElementsByTagName("acronym"); | 94 acronymList = doc.getElementsByTagName("acronym"); |
98 testNode = acronymList.item(3); | 95 testNode = acronymList.item(3); |
99 attributes = testNode.attributes; | 96 attributes = testNode.attributes; |
100 | 97 |
101 titleAttr = attributes.getNamedItem("title"); | 98 titleAttr = attributes.getNamedItem("title"); |
102 textNode = doc.createTextNode("terday"); | |
103 retval = titleAttr.appendChild(textNode); | |
104 clonedTitle = titleAttr.cloneNode(false); | 99 clonedTitle = titleAttr.cloneNode(false); |
105 textNode.nodeValue = "text_node_not_cloned"; | |
106 | 100 |
107 value = clonedTitle.value; | 101 value = clonedTitle.value; |
| 102 assertEquals("attrValue","Yes",value); |
108 | 103 |
109 assertEquals("attrValue","Yesterday",value); | 104 value = clonedTitle.nodeValue; |
110 value = clonedTitle.nodeValue; | 105 assertEquals("attrNodeValue","Yes",value); |
111 | |
112 assertEquals("attrNodeValue","Yesterday",value); | |
113 lastChild = clonedTitle.lastChild; | |
114 | |
115 value = lastChild.nodeValue; | |
116 | |
117 assertEquals("lastChildValue","terday",value); | |
118 | |
119 } | 106 } |
120 | 107 |
121 function runTest() { | 108 function runTest() { |
122 hc_attrclonenode1(); | 109 hc_attrclonenode1(); |
123 } | 110 } |
OLD | NEW |