Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: LayoutTests/dom/xhtml/level3/core/documentadoptnode02.js

Issue 1158433004: Remove Attr child nodes (making Attr a Node, not a ContainerNode) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address feedback Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 var attr; 88 var attr;
89 var childList; 89 var childList;
90 var adoptedclass; 90 var adoptedclass;
91 var attrsParent; 91 var attrsParent;
92 var nodeName; 92 var nodeName;
93 var nodeType; 93 var nodeType;
94 var nodeValue; 94 var nodeValue;
95 var isSpecified; 95 var isSpecified;
96 var nullDocType = null; 96 var nullDocType = null;
97 97
98 var firstChild;
99 var firstChildValue;
100 var secondChild;
101 var secondChildType;
102 var secondChildName;
103 var docElem; 98 var docElem;
104 var rootNS; 99 var rootNS;
105 var rootName; 100 var rootName;
106 101
107 var docRef = null; 102 var docRef = null;
108 if (typeof(this.doc) != 'undefined') { 103 if (typeof(this.doc) != 'undefined') {
109 docRef = this.doc; 104 docRef = this.doc;
110 } 105 }
111 doc = load(docRef, "doc", "hc_staff"); 106 doc = load(docRef, "doc", "hc_staff");
112 docElem = doc.documentElement; 107 docElem = doc.documentElement;
113 108
114 rootName = docElem.tagName; 109 rootName = docElem.tagName;
115 110
116 rootNS = docElem.namespaceURI; 111 rootNS = docElem.namespaceURI;
117 112
118 domImpl = doc.implementation; 113 domImpl = doc.implementation;
119 newDoc = domImpl.createDocument(rootNS,rootName,nullDocType); 114 newDoc = domImpl.createDocument(rootNS,rootName,nullDocType);
120 childList = doc.getElementsByTagName("acronym"); 115 childList = doc.getElementsByTagName("acronym");
121 element = childList.item(3); 116 element = childList.item(3);
122 attr = element.getAttributeNode("class"); 117 attr = element.getAttributeNode("class");
123 adoptedclass = newDoc.adoptNode(attr); 118 adoptedclass = newDoc.adoptNode(attr);
124 119
125 if(
126
127 (adoptedclass != null)
128
129 ) {
130 nodeName = adoptedclass.nodeName; 120 nodeName = adoptedclass.nodeName;
131 121
132 nodeValue = adoptedclass.nodeValue; 122 nodeValue = adoptedclass.nodeValue;
133 123
134 nodeType = adoptedclass.nodeType; 124 nodeType = adoptedclass.nodeType;
135 125
136 attrOwnerElem = adoptedclass.ownerElement; 126 attrOwnerElem = adoptedclass.ownerElement;
137 127
138 isSpecified = adoptedclass.specified; 128 isSpecified = adoptedclass.specified;
139 129
140 assertEquals("documentadoptnode02_nodeName","class",nodeName); 130 assertEquals("documentadoptnode02_nodeName","class",nodeName);
141 assertEquals("documentadoptnode02_nodeType",2,nodeType); 131 assertEquals("documentadoptnode02_nodeType",2,nodeType);
142 assertNull("documentadoptnode02_ownerDoc",attrOwnerElem); 132 assertNull("documentadoptnode02_ownerDoc",attrOwnerElem);
143 assertTrue("documentadoptnode02_specified",isSpecified); 133 assertTrue("documentadoptnode02_specified",isSpecified);
144 firstChild = adoptedclass.firstChild;
145
146 assertNotNull("firstChildNotNull",firstChild);
147 firstChildValue = firstChild.nodeValue;
148
149 if(
150 ("Y" == firstChildValue)
151 ) {
152 secondChild = firstChild.nextSibling;
153
154 assertNotNull("secondChildNotNull",secondChild);
155 secondChildType = secondChild.nodeType;
156
157 assertEquals("secondChildIsEntityReference",5,secondChildType);
158 secondChildName = secondChild.nodeName;
159
160 assertEquals("secondChildIsEnt1Reference","alpha",secondChildName);
161
162 }
163
164 else {
165 assertEquals("documentadoptnode02_nodeValue","Yα",nodeValue);
166
167 }
168
169 }
170
171 } 134 }
172 135
173 function runTest() { 136 function runTest() {
174 documentadoptnode02(); 137 documentadoptnode02();
175 } 138 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698