OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../../resources/testharness.js"></script> | |
3 <script src="../../resources/testharnessreport.js"></script> | |
4 <script> | |
5 var SVG_NAMESPACE = "http://www.w3.org/2000/svg"; | |
6 | |
7 function newSVGDocument() { | |
fs
2016/03/03 15:49:44
This is only used once, so just do this directly w
hyunjunekim2
2016/03/04 11:29:32
Done.
| |
8 return document.implementation.createDocument(SVG_NAMESPACE, "svg", null); | |
9 } | |
10 | |
11 test(function() { | |
12 var doc = newSVGDocument(); | |
13 doc.title = 'old'; | |
14 var titleElement = doc.querySelector('title'); | |
15 var observer = new MutationObserver(function(mutations) { | |
16 assert_equals(mutations.length, 1); | |
17 assert_equals(mutations[0].type, 'childList'); | |
18 assert_equals(mutations[0].addedNodes[0].data, 'new'); | |
19 assert_equals(mutations[0].addedNodes.length, 1); | |
20 assert_equals(mutations[0].removedNodes[0].data, 'old'); | |
21 assert_equals(mutations[0].removedNodes.length, 1); | |
22 }); | |
23 | |
24 observer.observe(titleElement, { childList: true }); | |
25 doc.title = 'new'; | |
26 }, "Test for mutations to childList when setting title of svg document."); | |
27 </script> | |
OLD | NEW |