From 8e76fc76d3af0a56d0ccdd627fe844fd9c5a1554 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 14 Feb 2019 16:40:44 +0100 Subject: [PATCH] HTML: window.name For https://github.com/whatwg/html/pull/4366. --- .../the-window-object/name-attribute.window.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 html/browsers/the-window-object/name-attribute.window.js diff --git a/html/browsers/the-window-object/name-attribute.window.js b/html/browsers/the-window-object/name-attribute.window.js new file mode 100644 index 00000000000000..f266dd7acb96cc --- /dev/null +++ b/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");