Bug 1499571 - HTMLOptionsCollection::Remove shouldn't remove the first element of the collection if out of bounds. r=bzbarsky
Make it just forward to HTMLSelectElement::Remove like other browsers. Differential Revision: https://phabricator.services.mozilla.com/D8934
This commit is contained in:
@@ -600,6 +600,10 @@ HTMLSelectElement::Add(nsGenericHTMLElement& aElement,
|
||||
void
|
||||
HTMLSelectElement::Remove(int32_t aIndex)
|
||||
{
|
||||
if (aIndex < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINode> option = Item(static_cast<uint32_t>(aIndex));
|
||||
if (!option) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user