Bug 637214. Restore our nice asserts. r=bzbarsky, a=blocker

This commit is contained in:
Jonas Sicking 2011-03-02 09:36:19 -05:00
Родитель 4678018160
Коммит 5af81d4af2
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -346,6 +346,9 @@ nsIdentifierMapEntry::FireChangeCallbacks(Element* aOldElement,
Element* aNewElement,
PRBool aImageOnly)
{
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
"Missing script blockers around code that modifies id-hash");
if (!mChangeCallbacks)
return;
@ -2622,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));
@ -2634,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) {