summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js')
-rw-r--r--testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js b/testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js
new file mode 100644
index 0000000000..f266dd7acb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js
@@ -0,0 +1,18 @@
+test(() => {
+ const frame = document.createElement("iframe"),
+ name = "A",
+ name2 = "B";
+ frame.setAttribute("name", name);
+ document.body.append(frame);
+ const frameW = frame.contentWindow;
+ assert_equals(frameW.name, name);
+ frameW.name = name2;
+ assert_equals(frame.getAttribute("name"), name);
+ assert_equals(frameW.name, name2);
+ frame.remove();
+ assert_equals(frame.getAttribute("name"), name);
+ assert_equals(frameW.name, "");
+ frameW.name = name2;
+ assert_equals(frame.getAttribute("name"), name);
+ assert_equals(frameW.name, "");
+}, "Window object's name IDL attribute");