OLD | NEW |
(Empty) | |
| 1 <head> |
| 2 <title>Test of named properties in Document</title> |
| 3 <script src="../../../resources/testharness.js"></script> |
| 4 <script src="../../../resources/testharnessreport.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <img id="title"/> |
| 8 <iframe id="f" srcdoc='<img id="title"/>'></iframe> |
| 9 <script> |
| 10 'use strict'; |
| 11 |
| 12 test(() => { |
| 13 assert_equals(document.title, "Test of named properties in Document", "<img> w
ith 'id' and empty 'name' must not be found as a named property. Should fallbac
k to the built-in property."); |
| 14 |
| 15 // Use a child frame's document. Otherwise, breaking the document results |
| 16 // breaking the test harness. |
| 17 let d = f.contentDocument; |
| 18 d.__proto__ = null; |
| 19 assert_equals(d.title, undefined, "Should fallback to the built-in property, a
nd then should get undefined because of no prototype object."); |
| 20 }, "document.title falls back to the built-in property."); |
| 21 </script> |
| 22 </body> |
OLD | NEW |