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

Side by Side Diff: LayoutTests/fast/dom/Attr/invalidate-nodelist-after-attr-setvalue.html

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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>This tests setting the value of an attribute node after caching childNodes of the attribute node.<br>
5 The cache should be cleared and childNodes[0].data should return the new value.< br>
6 You should see PASS below:</p>
7 <div id="console"></div>
8 <script src="../../../resources/js-test.js"></script>
9 <script>
10
11 var element = document.createElement('div');
12 var nameAttrNode = document.createAttribute('name');
13 var oldValue = document.createTextNode('oldName');
14 nameAttrNode.appendChild(oldValue);
15 element.setAttributeNode(nameAttrNode);
16 document.body.appendChild(element);
17
18 shouldBe("nameAttrNode.childNodes.length", '1');
19 shouldBe('nameAttrNode.childNodes[0]', 'oldValue');
20 shouldBe('nameAttrNode.childNodes[0].data', '"oldName"');
21
22 debug('');
23 shouldBe("nameAttrNode.value = 'newName'; nameAttrNode.value", '"newName"');
24 shouldNotBe("nameAttrNode.childNodes[0]", 'oldValue');
25 shouldBe("nameAttrNode.childNodes[0].data", '"newName"');
26
27 </script>
28 </body>
29 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698