2001-09-25 05:32:19 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2003-03-07 02:59:18 +03:00
|
|
|
#ifndef nsXBLPrototypeBinding_h__
|
|
|
|
#define nsXBLPrototypeBinding_h__
|
|
|
|
|
2013-07-24 11:39:56 +04:00
|
|
|
#include "nsClassHashtable.h"
|
|
|
|
#include "nsCOMArray.h"
|
2000-09-28 00:23:49 +04:00
|
|
|
#include "nsCOMPtr.h"
|
2001-03-10 04:43:09 +03:00
|
|
|
#include "nsICSSLoaderObserver.h"
|
2013-07-24 11:39:56 +04:00
|
|
|
#include "nsInterfaceHashtable.h"
|
2001-09-05 11:36:55 +04:00
|
|
|
#include "nsWeakReference.h"
|
2010-07-15 05:53:11 +04:00
|
|
|
#include "nsXBLDocumentInfo.h"
|
2007-09-28 17:45:01 +04:00
|
|
|
#include "nsXBLProtoImpl.h"
|
2013-07-24 11:39:56 +04:00
|
|
|
#include "nsXBLProtoImplMethod.h"
|
|
|
|
#include "nsXBLPrototypeHandler.h"
|
|
|
|
#include "nsXBLPrototypeResources.h"
|
2000-09-28 00:23:49 +04:00
|
|
|
|
|
|
|
class nsIAtom;
|
2013-03-22 04:05:20 +04:00
|
|
|
class nsIContent;
|
2000-09-28 00:23:49 +04:00
|
|
|
class nsIDocument;
|
2014-02-21 00:55:39 +04:00
|
|
|
class nsXBLAttributeEntry;
|
2014-02-20 02:46:43 +04:00
|
|
|
class nsXBLBinding;
|
2014-02-21 00:55:39 +04:00
|
|
|
class nsXBLProtoImplField;
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2014-06-20 14:32:49 +04:00
|
|
|
namespace mozilla {
|
|
|
|
class CSSStyleSheet;
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2000-09-28 00:23:49 +04:00
|
|
|
// *********************************************************************/
|
|
|
|
// The XBLPrototypeBinding class
|
|
|
|
|
2007-02-24 08:34:07 +03:00
|
|
|
// Instances of this class are owned by the nsXBLDocumentInfo object returned
|
|
|
|
// by XBLDocumentInfo(). Consumers who want to refcount things should refcount
|
|
|
|
// that.
|
2014-03-04 21:49:39 +04:00
|
|
|
class nsXBLPrototypeBinding MOZ_FINAL
|
2003-03-07 02:59:18 +03:00
|
|
|
{
|
|
|
|
public:
|
2013-07-19 08:13:35 +04:00
|
|
|
nsIContent* GetBindingElement() const { return mBinding; }
|
2003-03-07 02:59:18 +03:00
|
|
|
void SetBindingElement(nsIContent* aElement);
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2003-11-18 00:03:32 +03:00
|
|
|
nsIURI* BindingURI() const { return mBindingURI; }
|
2009-11-04 00:45:10 +03:00
|
|
|
nsIURI* AlternateBindingURI() const { return mAlternateBindingURI; }
|
2004-02-15 22:24:42 +03:00
|
|
|
nsIURI* DocURI() const { return mXBLDocInfoWeak->DocumentURI(); }
|
2011-11-04 00:39:07 +04:00
|
|
|
nsIURI* GetBaseBindingURI() const { return mBaseBindingURI; }
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2009-11-04 00:45:10 +03:00
|
|
|
// Checks if aURI refers to this binding by comparing to both possible
|
|
|
|
// binding URIs.
|
2011-09-29 10:19:26 +04:00
|
|
|
bool CompareBindingURI(nsIURI* aURI) const;
|
2009-11-04 00:45:10 +03:00
|
|
|
|
2013-12-13 20:54:04 +04:00
|
|
|
bool GetAllowScripts() const;
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2004-09-10 19:29:19 +04:00
|
|
|
nsresult BindingAttached(nsIContent* aBoundElement);
|
|
|
|
nsresult BindingDetached(nsIContent* aBoundElement);
|
2000-10-04 04:41:53 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool LoadResources();
|
2003-03-07 02:59:18 +03:00
|
|
|
nsresult AddResource(nsIAtom* aResourceType, const nsAString& aSrc);
|
2001-02-23 02:47:30 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool InheritsStyle() const { return mInheritStyle; }
|
2013-12-02 14:26:12 +04:00
|
|
|
void SetInheritsStyle(bool aInheritStyle) { mInheritStyle = aInheritStyle; }
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2003-03-07 02:59:18 +03:00
|
|
|
nsXBLPrototypeHandler* GetPrototypeHandlers() { return mPrototypeHandler; }
|
|
|
|
void SetPrototypeHandlers(nsXBLPrototypeHandler* aHandler) { mPrototypeHandler = aHandler; }
|
2001-11-13 07:09:56 +03:00
|
|
|
|
2004-09-10 19:29:19 +04:00
|
|
|
nsXBLProtoImplAnonymousMethod* GetConstructor();
|
|
|
|
nsresult SetConstructor(nsXBLProtoImplAnonymousMethod* aConstructor);
|
|
|
|
nsXBLProtoImplAnonymousMethod* GetDestructor();
|
|
|
|
nsresult SetDestructor(nsXBLProtoImplAnonymousMethod* aDestructor);
|
2001-11-13 07:09:56 +03:00
|
|
|
|
2007-09-28 17:45:01 +04:00
|
|
|
nsXBLProtoImplField* FindField(const nsString& aFieldName) const
|
|
|
|
{
|
2012-07-30 18:20:58 +04:00
|
|
|
return mImplementation ? mImplementation->FindField(aFieldName) : nullptr;
|
2007-09-28 17:45:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Resolve all the fields for this binding on the object |obj|.
|
|
|
|
// False return means a JS exception was set.
|
2013-04-05 17:21:03 +04:00
|
|
|
bool ResolveAllFields(JSContext* cx, JS::Handle<JSObject*> obj) const
|
2007-09-28 17:45:01 +04:00
|
|
|
{
|
|
|
|
return !mImplementation || mImplementation->ResolveAllFields(cx, obj);
|
|
|
|
}
|
|
|
|
|
2007-10-20 08:22:43 +04:00
|
|
|
// Undefine all our fields from object |obj| (which should be a
|
|
|
|
// JSObject for a bound element).
|
2013-04-05 17:21:03 +04:00
|
|
|
void UndefineFields(JSContext* cx, JS::Handle<JSObject*> obj) const {
|
2007-10-20 08:22:43 +04:00
|
|
|
if (mImplementation) {
|
|
|
|
mImplementation->UndefineFields(cx, obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-09-28 17:45:01 +04:00
|
|
|
const nsCString& ClassName() const {
|
|
|
|
return mImplementation ? mImplementation->mClassName : EmptyCString();
|
|
|
|
}
|
|
|
|
|
2005-08-12 08:11:00 +04:00
|
|
|
nsresult InitClass(const nsCString& aClassName, JSContext * aContext,
|
2013-04-05 17:21:01 +04:00
|
|
|
JS::Handle<JSObject*> aScriptObject,
|
|
|
|
JS::MutableHandle<JSObject*> aClassObject,
|
|
|
|
bool* aNew);
|
2005-08-12 08:11:00 +04:00
|
|
|
|
2003-03-07 02:59:18 +03:00
|
|
|
nsresult ConstructInterfaceTable(const nsAString& aImpls);
|
2014-02-20 01:27:14 +04:00
|
|
|
|
2003-03-07 02:59:18 +03:00
|
|
|
void SetImplementation(nsXBLProtoImpl* aImpl) { mImplementation = aImpl; }
|
2013-02-08 18:24:21 +04:00
|
|
|
nsXBLProtoImpl* GetImplementation() { return mImplementation; }
|
2013-02-08 18:24:20 +04:00
|
|
|
nsresult InstallImplementation(nsXBLBinding* aBinding);
|
2012-07-30 18:20:58 +04:00
|
|
|
bool HasImplementation() const { return mImplementation != nullptr; }
|
2001-11-13 07:09:56 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
void AttributeChanged(nsIAtom* aAttribute, int32_t aNameSpaceID,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aRemoveFlag, nsIContent* aChangedElement,
|
|
|
|
nsIContent* aAnonymousContent, bool aNotify);
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2003-03-07 02:59:18 +03:00
|
|
|
void SetBasePrototype(nsXBLPrototypeBinding* aBinding);
|
|
|
|
nsXBLPrototypeBinding* GetBasePrototype() { return mBaseBinding; }
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2010-07-15 05:53:11 +04:00
|
|
|
nsXBLDocumentInfo* XBLDocumentInfo() const { return mXBLDocInfoWeak; }
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsChrome() { return mXBLDocInfoWeak->IsChrome(); }
|
2014-02-20 01:27:14 +04:00
|
|
|
|
2003-03-07 02:59:18 +03:00
|
|
|
void SetInitialAttributes(nsIContent* aBoundElement, nsIContent* aAnonymousContent);
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2014-06-20 14:32:49 +04:00
|
|
|
void AppendStyleSheet(mozilla::CSSStyleSheet* aSheet);
|
|
|
|
void RemoveStyleSheet(mozilla::CSSStyleSheet* aSheet);
|
|
|
|
void InsertStyleSheetAt(size_t aIndex, mozilla::CSSStyleSheet* aSheet);
|
|
|
|
mozilla::CSSStyleSheet* StyleSheetAt(size_t aIndex) const;
|
2014-06-19 11:02:56 +04:00
|
|
|
size_t SheetCount() const;
|
|
|
|
bool HasStyleSheets() const;
|
2014-06-20 14:32:49 +04:00
|
|
|
void AppendStyleSheetsTo(nsTArray<mozilla::CSSStyleSheet*>& aResult) const;
|
2014-02-20 01:27:14 +04:00
|
|
|
|
2014-06-19 11:02:56 +04:00
|
|
|
nsIStyleRuleProcessor* GetRuleProcessor();
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2003-03-07 02:59:18 +03:00
|
|
|
nsresult FlushSkinSheets();
|
2001-12-18 01:51:39 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
nsIAtom* GetBaseTag(int32_t* aNamespaceID);
|
|
|
|
void SetBaseTag(int32_t aNamespaceID, nsIAtom* aTag);
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool ImplementsInterface(REFNSIID aIID) const;
|
2000-12-07 13:11:21 +03:00
|
|
|
|
2003-03-07 02:59:18 +03:00
|
|
|
nsresult AddResourceListener(nsIContent* aBoundElement);
|
2001-03-10 04:43:09 +03:00
|
|
|
|
2003-03-07 02:59:18 +03:00
|
|
|
void Initialize();
|
2001-11-02 04:53:13 +03:00
|
|
|
|
2011-11-04 00:39:07 +04:00
|
|
|
nsresult ResolveBaseBinding();
|
|
|
|
|
2003-09-11 16:25:06 +04:00
|
|
|
const nsCOMArray<nsXBLKeyEventHandler>* GetKeyEventHandlers()
|
|
|
|
{
|
|
|
|
if (!mKeyHandlersRegistered) {
|
|
|
|
CreateKeyHandlers();
|
2011-10-17 18:59:28 +04:00
|
|
|
mKeyHandlersRegistered = true;
|
2003-09-11 16:25:06 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return &mKeyHandlers;
|
|
|
|
}
|
|
|
|
|
2014-02-27 22:04:10 +04:00
|
|
|
private:
|
|
|
|
nsresult Read(nsIObjectInputStream* aStream,
|
|
|
|
nsXBLDocumentInfo* aDocInfo,
|
|
|
|
nsIDocument* aDocument,
|
|
|
|
uint8_t aFlags);
|
|
|
|
|
2011-11-04 00:39:08 +04:00
|
|
|
/**
|
2014-02-27 22:04:10 +04:00
|
|
|
* Read a new binding from the stream aStream into the xbl document aDocument.
|
2011-11-04 00:39:08 +04:00
|
|
|
* aDocInfo should be the xbl document info for the binding document.
|
|
|
|
* aFlags can contain XBLBinding_Serialize_InheritStyle to indicate that
|
|
|
|
* mInheritStyle flag should be set, and XBLBinding_Serialize_IsFirstBinding
|
|
|
|
* to indicate the first binding in a document.
|
2012-10-10 23:04:42 +04:00
|
|
|
* XBLBinding_Serialize_ChromeOnlyContent indicates that
|
|
|
|
* nsXBLPrototypeBinding::mChromeOnlyContent should be true.
|
2014-08-14 02:45:36 +04:00
|
|
|
* XBLBinding_Serialize_BindToUntrustedContent indicates that
|
|
|
|
* nsXBLPrototypeBinding::mBindToUntrustedContent should be true.
|
2011-11-04 00:39:08 +04:00
|
|
|
*/
|
2014-02-27 22:04:10 +04:00
|
|
|
public:
|
|
|
|
static nsresult ReadNewBinding(nsIObjectInputStream* aStream,
|
|
|
|
nsXBLDocumentInfo* aDocInfo,
|
|
|
|
nsIDocument* aDocument,
|
|
|
|
uint8_t aFlags);
|
2011-11-04 00:39:08 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Write this binding to the stream.
|
|
|
|
*/
|
|
|
|
nsresult Write(nsIObjectOutputStream* aStream);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Read a content node from aStream and return it in aChild.
|
|
|
|
* aDocument and aNim are the document and node info manager for the document
|
|
|
|
* the child will be inserted into.
|
|
|
|
*/
|
|
|
|
nsresult ReadContentNode(nsIObjectInputStream* aStream,
|
|
|
|
nsIDocument* aDocument,
|
|
|
|
nsNodeInfoManager* aNim,
|
|
|
|
nsIContent** aChild);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write the content node aNode to aStream.
|
|
|
|
*
|
|
|
|
* This method is called recursively for each child descendant. For the topmost
|
|
|
|
* call, aNode must be an element.
|
|
|
|
*
|
|
|
|
* Text, CDATA and comment nodes are serialized as:
|
|
|
|
* the constant XBLBinding_Serialize_TextNode, XBLBinding_Serialize_CDATANode
|
|
|
|
* or XBLBinding_Serialize_CommentNode
|
|
|
|
* the text for the node
|
|
|
|
* Elements are serialized in the following format:
|
|
|
|
* node's namespace, written with WriteNamespace
|
|
|
|
* node's namespace prefix
|
|
|
|
* node's tag
|
|
|
|
* 32-bit attribute count
|
|
|
|
* table of attributes:
|
|
|
|
* attribute's namespace, written with WriteNamespace
|
|
|
|
* attribute's namespace prefix
|
|
|
|
* attribute's tag
|
|
|
|
* attribute's value
|
|
|
|
* attribute forwarding table:
|
|
|
|
* source namespace
|
|
|
|
* source attribute
|
|
|
|
* destination namespace
|
|
|
|
* destination attribute
|
|
|
|
* the constant XBLBinding_Serialize_NoMoreAttributes
|
|
|
|
* 32-bit count of the number of child nodes
|
|
|
|
* each child node is serialized in the same manner in sequence
|
|
|
|
* the constant XBLBinding_Serialize_NoContent
|
|
|
|
*/
|
2013-05-02 02:50:08 +04:00
|
|
|
nsresult WriteContentNode(nsIObjectOutputStream* aStream, nsIContent* aNode);
|
2011-11-04 00:39:08 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Read or write a namespace id from or to aStream. If the namespace matches
|
2014-02-28 03:04:46 +04:00
|
|
|
* one of the built-in ones defined in nsNameSpaceManager.h, it will be written as
|
2011-11-04 00:39:08 +04:00
|
|
|
* a single byte with that value. Otherwise, XBLBinding_Serialize_CustomNamespace is
|
|
|
|
* written out, followed by a string written with writeWStringZ.
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult ReadNamespace(nsIObjectInputStream* aStream, int32_t& aNameSpaceID);
|
|
|
|
nsresult WriteNamespace(nsIObjectOutputStream* aStream, int32_t aNameSpaceID);
|
2011-11-04 00:39:08 +04:00
|
|
|
|
2000-09-28 00:23:49 +04:00
|
|
|
public:
|
2003-11-18 00:03:32 +03:00
|
|
|
nsXBLPrototypeBinding();
|
2003-03-07 02:59:18 +03:00
|
|
|
~nsXBLPrototypeBinding();
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2003-11-18 00:03:32 +03:00
|
|
|
// Init must be called after construction to initialize the prototype
|
|
|
|
// binding. It may well throw errors (eg on out-of-memory). Do not confuse
|
|
|
|
// this with the Initialize() method, which must be called after the
|
|
|
|
// binding's handlers, properties, etc are all set.
|
|
|
|
nsresult Init(const nsACString& aRef,
|
2010-07-15 05:53:11 +04:00
|
|
|
nsXBLDocumentInfo* aInfo,
|
2009-11-04 00:45:10 +03:00
|
|
|
nsIContent* aElement,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aFirstBinding = false);
|
2007-03-08 14:17:16 +03:00
|
|
|
|
|
|
|
void Traverse(nsCycleCollectionTraversalCallback &cb) const;
|
2014-06-24 06:09:36 +04:00
|
|
|
void Unlink();
|
2013-05-27 15:50:49 +04:00
|
|
|
void Trace(const TraceCallbacks& aCallbacks, void *aClosure) const;
|
2007-03-08 14:17:16 +03:00
|
|
|
|
2005-03-02 06:20:00 +03:00
|
|
|
// Internal member functions.
|
2000-09-28 00:23:49 +04:00
|
|
|
public:
|
2005-03-02 06:20:00 +03:00
|
|
|
/**
|
|
|
|
* GetImmediateChild locates the immediate child of our binding element which
|
|
|
|
* has the localname given by aTag and is in the XBL namespace.
|
|
|
|
*/
|
|
|
|
nsIContent* GetImmediateChild(nsIAtom* aTag);
|
2005-02-26 01:07:01 +03:00
|
|
|
nsIContent* LocateInstance(nsIContent* aBoundElt,
|
|
|
|
nsIContent* aTemplRoot,
|
|
|
|
nsIContent* aCopyRoot,
|
|
|
|
nsIContent* aTemplChild);
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2012-10-10 23:04:42 +04:00
|
|
|
bool ChromeOnlyContent() { return mChromeOnlyContent; }
|
2014-08-12 07:06:55 +04:00
|
|
|
bool BindToUntrustedContent() { return mBindToUntrustedContent; }
|
2014-02-21 00:55:39 +04:00
|
|
|
|
|
|
|
typedef nsClassHashtable<nsISupportsHashKey, nsXBLAttributeEntry> InnerAttributeTable;
|
|
|
|
|
2011-11-04 00:39:08 +04:00
|
|
|
protected:
|
|
|
|
// Ensure that mAttributeTable has been created.
|
|
|
|
void EnsureAttributeTable();
|
|
|
|
// Ad an entry to the attribute table
|
2012-08-22 19:56:38 +04:00
|
|
|
void AddToAttributeTable(int32_t aSourceNamespaceID, nsIAtom* aSourceTag,
|
|
|
|
int32_t aDestNamespaceID, nsIAtom* aDestTag,
|
2011-11-04 00:39:08 +04:00
|
|
|
nsIContent* aContent);
|
2000-09-28 00:23:49 +04:00
|
|
|
void ConstructAttributeTable(nsIContent* aElement);
|
2003-09-11 16:25:06 +04:00
|
|
|
void CreateKeyHandlers();
|
2003-03-12 08:03:35 +03:00
|
|
|
|
2014-06-19 11:02:56 +04:00
|
|
|
private:
|
|
|
|
void EnsureResources();
|
|
|
|
|
2000-09-28 00:23:49 +04:00
|
|
|
// MEMBER VARIABLES
|
|
|
|
protected:
|
2007-02-24 19:27:51 +03:00
|
|
|
nsCOMPtr<nsIURI> mBindingURI;
|
2009-11-04 00:45:10 +03:00
|
|
|
nsCOMPtr<nsIURI> mAlternateBindingURI; // Alternate id-less URI that is only non-null on the first binding.
|
2000-09-28 00:23:49 +04:00
|
|
|
nsCOMPtr<nsIContent> mBinding; // Strong. We own a ref to our content element in the binding doc.
|
2003-09-11 16:25:06 +04:00
|
|
|
nsAutoPtr<nsXBLPrototypeHandler> mPrototypeHandler; // Strong. DocInfo owns us, and we own the handlers.
|
2011-11-04 00:39:07 +04:00
|
|
|
|
|
|
|
// the url of the base binding
|
|
|
|
nsCOMPtr<nsIURI> mBaseBindingURI;
|
|
|
|
|
2001-11-13 07:09:56 +03:00
|
|
|
nsXBLProtoImpl* mImplementation; // Our prototype implementation (includes methods, properties, fields,
|
|
|
|
// the constructor, and the destructor).
|
2001-09-05 11:36:55 +04:00
|
|
|
|
2003-03-07 02:59:18 +03:00
|
|
|
nsXBLPrototypeBinding* mBaseBinding; // Weak. The docinfo will own our base binding.
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mInheritStyle;
|
2011-11-04 00:39:07 +04:00
|
|
|
bool mCheckedBaseProto;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mKeyHandlersRegistered;
|
2012-10-10 23:04:42 +04:00
|
|
|
bool mChromeOnlyContent;
|
2014-08-12 07:06:55 +04:00
|
|
|
bool mBindToUntrustedContent;
|
2014-02-20 01:27:14 +04:00
|
|
|
|
2014-04-10 18:05:21 +04:00
|
|
|
nsAutoPtr<nsXBLPrototypeResources> mResources; // If we have any resources, this will be non-null.
|
2014-02-20 01:27:14 +04:00
|
|
|
|
2010-07-15 05:53:11 +04:00
|
|
|
nsXBLDocumentInfo* mXBLDocInfoWeak; // A pointer back to our doc info. Weak, since it owns us.
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2014-02-21 00:55:39 +04:00
|
|
|
// A table for attribute containers. Namespace IDs are used as
|
|
|
|
// keys in the table. Containers are InnerAttributeTables.
|
|
|
|
// This table is used to efficiently handle attribute changes.
|
|
|
|
nsAutoPtr<nsClassHashtable<nsUint32HashKey, InnerAttributeTable>> mAttributeTable;
|
2000-09-28 00:23:49 +04:00
|
|
|
|
2013-07-24 11:39:56 +04:00
|
|
|
class IIDHashKey : public PLDHashEntryHdr
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef const nsIID& KeyType;
|
|
|
|
typedef const nsIID* KeyTypePointer;
|
|
|
|
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit IIDHashKey(const nsIID* aKey)
|
2013-07-24 11:39:56 +04:00
|
|
|
: mKey(*aKey)
|
|
|
|
{}
|
|
|
|
IIDHashKey(const IIDHashKey& aOther)
|
|
|
|
: mKey(aOther.GetKey())
|
|
|
|
{}
|
|
|
|
~IIDHashKey()
|
|
|
|
{}
|
|
|
|
|
|
|
|
KeyType GetKey() const
|
|
|
|
{
|
|
|
|
return mKey;
|
|
|
|
}
|
|
|
|
bool KeyEquals(const KeyTypePointer aKey) const
|
|
|
|
{
|
|
|
|
return mKey.Equals(*aKey);
|
|
|
|
}
|
|
|
|
|
|
|
|
static KeyTypePointer KeyToPointer(KeyType aKey)
|
|
|
|
{
|
|
|
|
return &aKey;
|
|
|
|
}
|
|
|
|
static PLDHashNumber HashKey(const KeyTypePointer aKey)
|
|
|
|
{
|
|
|
|
// Just use the 32-bit m0 field.
|
|
|
|
return aKey->m0;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum { ALLOW_MEMMOVE = true };
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsIID mKey;
|
|
|
|
};
|
|
|
|
nsInterfaceHashtable<IIDHashKey, nsIContent> mInterfaceTable; // A table of cached interfaces that we support.
|
2000-12-07 13:11:21 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mBaseNameSpaceID; // If we extend a tagname/namespace, then that information will
|
2000-09-28 00:23:49 +04:00
|
|
|
nsCOMPtr<nsIAtom> mBaseTag; // be stored in here.
|
2003-03-12 03:42:52 +03:00
|
|
|
|
2003-09-11 16:25:06 +04:00
|
|
|
nsCOMArray<nsXBLKeyEventHandler> mKeyHandlers;
|
2000-09-28 00:23:49 +04:00
|
|
|
};
|
2003-03-07 02:59:18 +03:00
|
|
|
|
|
|
|
#endif
|