/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */
/* * Implementation of the |attributes| property of DOM Core's Element object.
*/
namespace dom { class Attr; class DocGroup; class Document; class Element; class NodeInfo;
} // namespace dom
} // namespace mozilla
/** * Structure used as a key for caching Attrs in nsDOMAttributeMap's * mAttributeCache.
*/ class nsAttrKey { public: /** * The namespace of the attribute
*/
int32_t mNamespaceID;
/** * The atom for attribute, stored as void*, to make sure that we only use it * for the hashcode, and we can never dereference it.
*/ void* mLocalName;
nsAttrKey(int32_t aNs, nsAtom* aName)
: mNamespaceID(aNs), mLocalName(aName) {}
nsAttrKey(const nsAttrKey& aAttr) = default;
};
/** * PLDHashEntryHdr implementation for nsAttrKey.
*/ class nsAttrHashKey : public PLDHashEntryHdr { public: using KeyType = const nsAttrKey&; using KeyTypePointer = const nsAttrKey*;
class nsDOMAttributeMap final : public nsISupports, public nsWrapperCache { public: using Attr = mozilla::dom::Attr; using DocGroup = mozilla::dom::DocGroup; using Document = mozilla::dom::Document; using Element = mozilla::dom::Element; using ErrorResult = mozilla::ErrorResult;
/** * Called when mContent is moved into a new document. * Updates the nodeinfos of all owned nodes.
*/
nsresult SetOwnerDocument(Document* aDocument);
/** * Drop an attribute from the map's cache (does not remove the attribute * from the node!)
*/ void DropAttribute(int32_t aNamespaceID, nsAtom* aLocalName);
/** * Returns the number of attribute nodes currently in the map. * Note: this is just the number of cached attribute nodes, not the number of * attributes in mContent. * * @return The number of attribute nodes in the map.
*/
uint32_t Count() const;
using AttrCache = nsRefPtrHashtable<nsAttrHashKey, Attr>;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.