Bug 637214 - Assert that adding/removing elements to/from the ID table is always performed under a script blocker. r=sicking a=blocker

This commit is contained in:
Ehsan Akhgari 2011-03-01 21:35:38 -08:00
Родитель 0f979db564
Коммит 5f491761d5
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -2625,6 +2625,9 @@ nsDocument::RemoveFromNameTable(Element *aElement, nsIAtom* aName)
void
nsDocument::AddToIdTable(Element *aElement, nsIAtom* aId)
{
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
"Scripts should be blocked when manipulating the ID table");
nsIdentifierMapEntry *entry =
mIdentifierMap.PutEntry(nsDependentAtomString(aId));
@ -2637,6 +2640,8 @@ void
nsDocument::RemoveFromIdTable(Element *aElement, nsIAtom* aId)
{
NS_ASSERTION(aId, "huhwhatnow?");
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
"Scripts should be blocked when manipulating the ID table");
// Speed up document teardown
if (mIdentifierMap.Count() == 0) {