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");