Skip to content

Commit

Permalink
Restore 100,000 limit in HTMLOptionsCollection.length setter
Browse files Browse the repository at this point in the history
Update the const kMaxListItems to be 100,000 in HTMLOptionsCollections
to reflect updated spec. Also, this max should only be used when new
length is greater than current length.

[1] https://html.spec.whatwg.org/#dom-htmloptionscollection-length
[2] whatwg/html#8337
[3] whatwg/html#8347

Change-Id: I7ff54e9cfdcb2eb014ad508485eda6908308314b
Fixed: 1370370
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4015681
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Di Zhang <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1070388}
  • Loading branch information
dizhang168 authored and chromium-wpt-export-bot committed Nov 11, 2022
1 parent 48f7f5a commit 893a5f3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion html/select/options-length-too-large.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@
assert_equals(mySelect.options.length, 3, "Length of <select> should remain unchanged");
});

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

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

test(function() {
Expand Down

0 comments on commit 893a5f3

Please sign in to comment.