Bug 1225923 - part 5 - fix AppendElement(nsDependentAtomString(...)) calls; r=bz

The intent here is to copy the dependent string.  We can make that
behavior more explicit by using the ToString method of nsIAtom instead.
This commit is contained in:
Nathan Froyd
2015-11-18 12:38:34 -05:00
parent 707b9db2ba
commit e93a746485
4 changed files with 19 additions and 14 deletions

View File

@@ -309,9 +309,10 @@ HTMLOptionsCollection::GetSupportedNames(unsigned aFlags,
}
}
aNames.SetCapacity(atoms.Length());
for (uint32_t i = 0; i < atoms.Length(); ++i) {
aNames.AppendElement(nsDependentAtomString(atoms[i]));
uint32_t atomsLen = atoms.Length();
nsString* names = aNames.AppendElements(atomsLen);
for (uint32_t i = 0; i < atomsLen; ++i) {
atoms[i]->ToString(names[i]);
}
}