зеркало из https://github.com/mozilla/gecko-dev.git
Bug 296450: Make the hashtable holding attribute nodes work properly on all platforms.
r=beaufour sr=peterv a=caillon
This commit is contained in:
Родитель
d884d8eec9
Коммит
b8ff8c18c7
|
@ -64,7 +64,7 @@ nsDOMAttributeMap::Init()
|
|||
* Clear map pointer for attributes.
|
||||
*/
|
||||
PLDHashOperator
|
||||
RemoveMapRef(nsAttrKey aKey, nsCOMPtr<nsIDOMNode>& aData, void* aUserArg)
|
||||
RemoveMapRef(nsAttrHashKey::KeyType aKey, nsCOMPtr<nsIDOMNode>& aData, void* aUserArg)
|
||||
{
|
||||
nsCOMPtr<nsIAttribute> attr(do_QueryInterface(aData));
|
||||
NS_ASSERTION(attr, "non-nsIAttribute somehow made it into the hashmap?!");
|
||||
|
@ -100,7 +100,7 @@ NS_IMPL_RELEASE(nsDOMAttributeMap)
|
|||
void
|
||||
nsDOMAttributeMap::DropAttribute(PRInt32 aNamespaceID, nsIAtom* aLocalName)
|
||||
{
|
||||
nsAttrHashKey::KeyType attr(aNamespaceID, aLocalName);
|
||||
nsAttrKey attr(aNamespaceID, aLocalName);
|
||||
nsIDOMNode *node = mAttributeCache.GetWeak(attr);
|
||||
if (node) {
|
||||
nsCOMPtr<nsIAttribute> iAttr(do_QueryInterface(node));
|
||||
|
@ -124,7 +124,7 @@ nsDOMAttributeMap::GetAttribute(nsINodeInfo* aNodeInfo,
|
|||
|
||||
*aReturn = nsnull;
|
||||
|
||||
nsAttrHashKey::KeyType attr(aNodeInfo->NamespaceID(), aNodeInfo->NameAtom());
|
||||
nsAttrKey attr(aNodeInfo->NamespaceID(), aNodeInfo->NameAtom());
|
||||
|
||||
if (!mAttributeCache.Get(attr, aReturn)) {
|
||||
nsAutoString value;
|
||||
|
@ -281,7 +281,7 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
|
|||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsAttrHashKey::KeyType attrkey(ni->NamespaceID(), ni->NameAtom());
|
||||
nsAttrKey attrkey(ni->NamespaceID(), ni->NameAtom());
|
||||
rv = mAttributeCache.Put(attrkey, attribute);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
class nsAttrHashKey : public PLDHashEntryHdr
|
||||
{
|
||||
public:
|
||||
typedef nsAttrKey KeyType;
|
||||
typedef const nsAttrKey& KeyType;
|
||||
typedef const nsAttrKey* KeyTypePointer;
|
||||
|
||||
nsAttrHashKey(KeyTypePointer aKey) : mKey(*aKey) {}
|
||||
|
@ -107,7 +107,7 @@ public:
|
|||
enum { ALLOW_MEMMOVE = PR_TRUE };
|
||||
|
||||
private:
|
||||
KeyType mKey;
|
||||
nsAttrKey mKey;
|
||||
};
|
||||
|
||||
// Helper class that implements the nsIDOMNamedNodeMap interface.
|
||||
|
|
Загрузка…
Ссылка в новой задаче