2001-09-25 01:32:19 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-03-23 07:39:31 +00:00
|
|
|
|
|
|
|
#include "nsContentSupportMap.h"
|
2005-01-19 20:05:02 +00:00
|
|
|
#include "nsXULElement.h"
|
2001-03-23 07:39:31 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
nsContentSupportMap::Init()
|
|
|
|
{
|
2014-08-06 13:31:21 +00:00
|
|
|
PL_DHashTableInit(&mMap, PL_DHashGetStubOps(), nullptr, sizeof(Entry));
|
2001-03-23 07:39:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsContentSupportMap::Finish()
|
|
|
|
{
|
2003-08-05 11:41:14 +00:00
|
|
|
if (mMap.ops)
|
|
|
|
PL_DHashTableFinish(&mMap);
|
2001-03-23 07:39:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsContentSupportMap::Remove(nsIContent* aElement)
|
|
|
|
{
|
2003-08-05 11:41:14 +00:00
|
|
|
if (!mMap.ops)
|
|
|
|
return NS_ERROR_NOT_INITIALIZED;
|
2014-02-27 18:04:09 +00:00
|
|
|
|
2014-08-06 13:31:21 +00:00
|
|
|
nsIContent* child = aElement;
|
2011-09-27 07:54:58 +00:00
|
|
|
do {
|
|
|
|
PL_DHashTableOperate(&mMap, child, PL_DHASH_REMOVE);
|
|
|
|
child = child->GetNextNode(aElement);
|
|
|
|
} while(child);
|
2001-03-23 07:39:31 +00:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|