Index: third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/named-item-not-found.html |
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/named-item-not-found.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/named-item-not-found.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dfb545949b58d67b46b09b9591e3f76b0864e20c |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/named-item-not-found.html |
@@ -0,0 +1,22 @@ |
+<head> |
+<title>Test of named properties in Document</title> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+</head> |
+<body> |
+<img id="title"/> |
+<iframe id="f" srcdoc='<img id="title"/>'></iframe> |
+<script> |
+'use strict'; |
+ |
+test(() => { |
+ assert_equals(document.title, "Test of named properties in Document", "<img> with 'id' and empty 'name' must not be found as a named property. Should fallback to the built-in property."); |
+ |
+ // Use a child frame's document. Otherwise, breaking the document results |
+ // breaking the test harness. |
+ let d = f.contentDocument; |
+ d.__proto__ = null; |
+ assert_equals(d.title, undefined, "Should fallback to the built-in property, and then should get undefined because of no prototype object."); |
+}, "document.title falls back to the built-in property."); |
+</script> |
+</body> |