Skip to content

Commit

Permalink
Tweak HTMLOptionsCollection.length limit.
Browse files Browse the repository at this point in the history
As per the discussion in whatwg/html#8347

Differential Revision: https://phabricator.services.mozilla.com/D160544

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1797792
gecko-commit: bdd3a81d328efa4627647bcc54e8b09878014c92
gecko-reviewers: smaug
  • Loading branch information
emilio authored and moz-wptsync-bot committed Oct 28, 2022
1 parent be3a186 commit c19c72f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions html/select/options-length-too-large.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@
});

test(function() {
mySelect.options.length = 10001;
mySelect.options.length = 100001;
assert_equals(mySelect.options.length, 3, "Length of <select> should remain unchanged");
});

test(function() {
mySelect.options.length = 10000;
assert_equals(mySelect.options.length, 10000, "Length of <select> should be 10,000");
mySelect.options.length = 100000;
assert_equals(mySelect.options.length, 100000, "Length of <select> should be 10,0000");
});

test(function() {
mySelect.appendChild(new Option());
mySelect.appendChild(new Option());
assert_equals(mySelect.options.length, 100002, "Manual expansion still works");
mySelect.options.length = 100001;
assert_equals(mySelect.options.length, 100001, "Truncation works if over the limit");
});
</script>
</body>
Expand Down

0 comments on commit c19c72f

Please sign in to comment.