Skip to content

Commit

Permalink
Do not include a, area, or frameset in the window's named properties
Browse files Browse the repository at this point in the history
Aligns the tests with the spec as of whatwg/html#1869. See discussion in whatwg/html#1810.
  • Loading branch information
domenic authored and Ms2ger committed Oct 6, 2016
1 parent c7fbe2d commit 1341204
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,28 @@
}, "Check if the first nested browsing context is returned by window['c']");

test(function() {
assert_equals(window['a'].length, 7, "The length should be 7.");
assert_equals(window['a'].length, 5, "The length should be 5.");
assert_true(window['a'] instanceof HTMLCollection);
assert_array_equals(window['a'],
[ document.getElementById('a1'), document.getElementById('app1'),
document.getElementById('area1'), document.getElementById('embed1'),
[ document.getElementById('app1'), document.getElementById('embed1'),
document.getElementById('form1'), document.getElementById('img1'),
document.getElementById('obj1') ],
"The elements are not in tree order.");

document.getElementById('a1').setAttribute("name", "");
document.getElementById('area1').setAttribute("name", "");
document.getElementById('form1').setAttribute("name", "");
document.getElementById('embed1').setAttribute("name", "");
assert_array_equals(window['a'],
[ document.getElementById('app1'), document.getElementById('embed1'),
document.getElementById('form1'), document.getElementById('img1'),
[ document.getElementById('app1'), document.getElementById('img1'),
document.getElementById('obj1') ],
"Window['a'] should not contain the elements with empty name attribute.");
}, "Check if window['a'] contains all a, applet, area, embed, form, img, and object elements, and their order");
}, "Check if window['a'] contains all applet, embed, form, img, and object elements, and their order");

var t = async_test("Check if window['fs'] return the frameset element with name='fs'");
var t = async_test("Check that window['fs'] does not return the frameset element with name='fs' (historical)");
function on_load () {
t.step(function () {
assert_equals(document.getElementById('fm2').contentWindow['fs'],
document.getElementById('fm2').contentDocument.getElementById('fs1'),
"The frameset element should be returned.");
undefined,
"The frameset element should not be returned.");
});
t.done();
}
Expand Down

0 comments on commit 1341204

Please sign in to comment.