Make getElementsByAttribute be an nsContentList so that it's got that live

DOMNodeList goodness that all nodelists should have.  Change some JS to not
break, and some other JS to be a little more efficient with the new world of
lazy listness.  Bug 240186, r=neil on the JS changes, r=jst on the content
changes, sr=jst
This commit is contained in:
bzbarsky%mit.edu 2006-04-08 00:57:52 +00:00
Родитель 36d4ee6fa7
Коммит 713878dc73
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -41,18 +41,18 @@
var regionName = contentList.getAttribute("prefvalue");
var regionElements = contentList.getElementsByAttribute("value", regionName);
if (regionElements.length) {
contentList.selectItem(regionElements[0]);
if (regionElements.item(0)) {
contentList.selectItem(regionElements.item(0));
} else {
contentList.selectedIndex = 0;
}
var languageList = document.getElementById( "languagePackList" );
var languageName = languageList.getAttribute("prefvalue");
var languageElements =languageList.getElementsByAttribute("value", languageName);
var languageElements = languageList.getElementsByAttribute("value", languageName);
if (languageElements.length) {
languageList.selectItem(languageElements[0]);
if (languageElements.item(0)) {
languageList.selectItem(languageElements.item(0));
} else {
languageList.selectedIndex = 0;
}
@ -105,7 +105,7 @@
faslFile.remove(false);
} catch(e) {}
}
return true;
return true;
}
function SelectPack(listbox, button)
@ -150,8 +150,8 @@
var listSelection = list.getElementsByAttribute("value", list.getAttribute("prefvalue"));
//find and select the list item corresponding to the current chrome provider
if (listSelection.length)
list.selectedItem = listSelection[0];
if (listSelection.item(0))
list.selectedItem = listSelection.item(0);
else
list.selectedIndex = 0;
}