test_unforgeablesonexpando.html (855B)
1 <!DOCTYPE html> 2 <meta charset=utf-8> 3 <title>Test for making sure named getters don't override the unforgeable location on HTMLDocument</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <div id="log"></div> 7 <img name="location"> 8 <script> 9 /* global test, assert_equals */ 10 test(function() { 11 assert_equals(document.location, window.location, 12 'The <img name="location"> should not override the location getter'); 13 }, "document.location is the right thing"); 14 test(function() { 15 var doc = new DOMParser().parseFromString("<img name='location'>", "text/html"); 16 assert_equals(doc.location, null, 17 'The <img name="location"> should not override the location getter on a data document'); 18 }, "document.location is the right thing on non-rendered document"); 19 </script>