Bug 1499567 - Do not append an empty text node when creating options from HTMLOptionCollection::SetLength. r=bzbarsky

Only we do that. Align with other browsers instead.

I removed the max-asserts as well because I cannot make my browser assert when
running this test on a debug build.

Differential Revision: https://phabricator.services.mozilla.com/D8929
This commit is contained in:
Emilio Cobos Álvarez
2018-10-17 00:10:46 +00:00
parent 5ae4b4f1f4
commit a09f3c9bdc
2 changed files with 0 additions and 13 deletions

View File

@@ -642,14 +642,6 @@ HTMLSelectElement::SetLength(uint32_t aLength, ErrorResult& aRv)
getter_AddRefs(nodeInfo));
nsCOMPtr<nsINode> node = NS_NewHTMLOptionElement(nodeInfo.forget());
RefPtr<nsTextNode> text = new nsTextNode(mNodeInfo->NodeInfoManager());
aRv = node->AppendChildTo(text, false);
if (aRv.Failed()) {
return;
}
for (uint32_t i = curlen; i < aLength; i++) {
nsINode::AppendChild(*node, aRv);
if (aRv.Failed()) {