Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1141)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/named-item-not-found.html

Issue 2065523002: binding: Fixes the fallback mechanism of Document's named properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Synced. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698