if (aCollection) { PRUint32 length = 0; aCollection->GetLength(&length); nsIDOMNode* node; for (PRUint32 elemX = 0; elemX < length; elemX++) { nsresult result = aCollection->Item(elemX, &node); if ((NS_OK == result) && node) { nsIDOMHTMLOptionElement* option = nsnull; result = node->QueryInterface(kIDOMHTMLOptionElementIID, (void**)&option); if ((NS_OK == result) && option) { mElements.AppendElement(node); NS_RELEASE(option); } } } }
nsOptionList::nsOptionList() {  mRefCnt = 0;  mScriptObject = nsnull;}