test_bug780199.xhtml (1517B)
1 <?xml version="1.0"?> 2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?> 3 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?> 4 <!-- 5 https://bugzilla.mozilla.org/show_bug.cgi?id=780199 6 --> 7 <window title="Mozilla Bug 780199" 8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 9 onload="test()"> 10 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> 11 12 <!-- test results are displayed in the html:body --> 13 <body xmlns="http://www.w3.org/1999/xhtml"> 14 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=780199" 15 target="_blank">Mozilla Bug 780199</a> 16 </body> 17 18 <!-- test code goes here --> 19 <script type="application/javascript"> 20 <![CDATA[ 21 22 /** Test for Bug 780199 */ 23 24 SimpleTest.waitForExplicitFinish(); 25 26 var b; 27 28 function callback(r) { 29 is(r[0].type, "attributes"); 30 is(r[0].oldValue, b.getAttribute("src")); 31 setTimeout(continueTest, 500); 32 } 33 34 function continueTest() { 35 // Check that a new page wasn't loaded. 36 is(b.contentDocument.documentElement.textContent, "testvalue"); 37 SimpleTest.finish(); 38 } 39 40 function test() { 41 b = document.getElementById("b"); 42 var m = new MutationObserver(callback); 43 m.observe(b, { attributes: true, attributeOldValue: true }); 44 b.contentDocument.documentElement.textContent = "testvalue"; 45 b.setAttribute("src", b.getAttribute("src")); 46 } 47 48 ]]> 49 </script> 50 <browser id="b" src="data:text/plain,initial"/> 51 </window>