Logo Search packages:      
Sourcecode: xulrunner version File versions  Download package

nsGenericElement Class Reference

#include <nsGenericElement.h>

Inheritance diagram for nsGenericElement:

nsIContent nsINode nsWrapperCache nsISupports nsGenConImageContent nsGenericHTMLElement nsGenericHTMLFormElement nsGenericHTMLFrameElement nsHTMLOptGroupElement nsHTMLOptionElement nsHTMLSelectElement

List of all members.


Detailed Description

A generic base class for DOM elements, implementing many nsIContent, nsIDOMNode and nsIDOMElement methods.

Definition at line 335 of file nsGenericElement.h.


Public Types

enum  { ATTR_MISSING = -1, ATTR_VALUE_NO_MATCH = -2 }
enum  {
  IME_STATUS_NONE = 0x0000, IME_STATUS_ENABLE = 0x0001, IME_STATUS_DISABLE = 0x0002, IME_STATUS_PASSWORD = 0x0004,
  IME_STATUS_PLUGIN = 0x0008, IME_STATUS_OPEN = 0x0010, IME_STATUS_CLOSE = 0x0020
}
enum  { IME_STATUS_MASK_ENABLED, IME_STATUS_MASK_OPENED = IME_STATUS_OPEN | IME_STATUS_CLOSE }
enum  {
  eCONTENT = 1 << 0, eDOCUMENT = 1 << 1, eATTRIBUTE = 1 << 2, eELEMENT = 1 << 3,
  eTEXT = 1 << 4, ePROCESSING_INSTRUCTION = 1 << 5, eCOMMENT = 1 << 6, eHTML = 1 << 7,
  eHTML_FORM_CONTROL = 1 << 8, eXUL = 1 << 9, eSVG = 1 << 10, eDOCUMENT_FRAGMENT = 1 << 11,
  eDATA_NODE = 1 << 12, eMATHML = 1 << 13, eMEDIA = 1 << 14
}
typedef nsIAtom *const *const AttrValuesArray
enum  ETabFocusType { eTabFocus_formElementsMask = (1<<1), eTabFocus_linksMask = (1<<2), eTabFocus_any = 1 + (1<<1) + (1<<2) }

Public Member Functions

virtual nsresult AddEventListenerByIID (nsIDOMEventListener *aListener, const nsIID &aIID)
virtual void AddMutationObserver (nsIMutationObserver *aMutationObserver)
nsresult AddScriptEventListener (nsIAtom *aEventName, const nsAString &aValue, PRBool aDefer=PR_TRUE)
NS_IMETHOD AppendChild (nsIDOMNode *aNewChild, nsIDOMNode **aReturn)
nsresult AppendChildTo (nsIContent *aKid, PRBool aNotify)
virtual nsresult AppendText (const PRUnichar *aBuffer, PRUint32 aLength, PRBool aNotify)
virtual void AppendTextTo (nsAString &aResult)
virtual PRBool AttrValueIs (PRInt32 aNameSpaceID, nsIAtom *aName, nsIAtom *aValue, nsCaseTreatment aCaseSensitive) const
virtual PRBool AttrValueIs (PRInt32 aNameSpaceID, nsIAtom *aName, const nsAString &aValue, nsCaseTreatment aCaseSensitive) const
virtual void BeginAddingChildren ()
virtual nsresult BindToTree (nsIDocument *aDocument, nsIContent *aParent, nsIContent *aBindingParent, PRBool aCompileEventHandlers)
void ClearWrapper ()
virtual nsresult Clone (nsINodeInfo *aNodeInfo, nsINode **aResult) const =0
nsresult CloneNode (PRBool aDeep, nsIDOMNode **aResult)
virtual nsresult DeleteProperty (PRUint16 aCategory, nsIAtom *aPropertyName)
nsresult DeleteProperty (nsIAtom *aPropertyName)
virtual void DestroyContent ()
virtual nsresult DispatchDOMEvent (nsEvent *aEvent, nsIDOMEvent *aDOMEvent, nsPresContext *aPresContext, nsEventStatus *aEventStatus)
virtual const nsAttrValue * DoGetClasses () const
virtual nsresult DoneAddingChildren (PRBool aHaveNotified)
virtual void DoneCreatingElement ()
virtual PRInt32 FindAttrValueIn (PRInt32 aNameSpaceID, nsIAtom *aName, AttrValuesArray *aValues, nsCaseTreatment aCaseSensitive) const
virtual PRInt32 FindAttrValueIn (PRInt32 aNameSpaceID, nsIAtom *aName, AttrValuesArray *aValues, nsCaseTreatment aCaseSensitive) const
virtual nsIContentFindFirstNonNativeAnonymous () const
virtual PRBool GetAttr (PRInt32 aNameSpaceID, nsIAtom *aName, nsAString &aResult) const
virtual PRUint32 GetAttrCount () const
NS_IMETHOD GetAttribute (const nsAString &aName, nsAString &aReturn)
virtual nsChangeHint GetAttributeChangeHint (const nsIAtom *aAttribute, PRInt32 aModType) const
nsDOMAttributeMap * GetAttributeMap ()
NS_IMETHOD GetAttributeNode (const nsAString &aName, nsIDOMAttr **aReturn)
NS_IMETHOD GetAttributeNodeNS (const nsAString &aNamespaceURI, const nsAString &aLocalName, nsIDOMAttr **aReturn)
NS_IMETHOD GetAttributeNS (const nsAString &aNamespaceURI, const nsAString &aLocalName, nsAString &aReturn)
NS_IMETHOD GetAttributes (nsIDOMNamedNodeMap **aAttributes)
virtual const nsAttrName * GetAttrNameAt (PRUint32 aIndex) const
virtual already_AddRefed< nsIURI > GetBaseURI () const
virtual nsIContentGetBindingParent () const
virtual nsIContent *const * GetChildArray (PRUint32 *aChildCount) const
virtual nsIContentGetChildAt (PRUint32 aIndex) const
virtual PRUint32 GetChildCount () const
virtual nsINodeListGetChildNodesList ()
virtual nsIAtom * GetClassAttributeName () const
const nsAttrValue * GetClasses () const
virtual nsIScriptContextGetContextForEventHandlers (nsresult *aRv)
nsIDocument * GetCurrentDoc () const
virtual PRUint32 GetDesiredIMEState ()
nsIDocument * GetDocument () const
NS_IMETHOD GetElementsByTagName (const nsAString &aTagname, nsIDOMNodeList **aReturn)
NS_IMETHOD GetElementsByTagNameNS (const nsAString &aNamespaceURI, const nsAString &aLocalName, nsIDOMNodeList **aReturn)
virtual already_AddRefed
< nsINodeInfo > 
GetExistingAttrNameFromQName (const nsAString &aStr) const
PtrBits GetFlags () const
virtual already_AddRefed< nsIURI > GetHrefURI () const
virtual nsIAtom * GetID () const
virtual nsIAtom * GetIDAttributeName () const
virtual nsICSSStyleRule * GetInlineStyleRule ()
nsIContentGetLastChild () const
virtual nsLinkState GetLinkState () const
virtual nsIEventListenerManager * GetListenerManager (PRBool aCreateIfNotFound)
NS_IMETHOD GetLocalName (nsAString &aLocalName)
PRInt32 GetNameSpaceID () const
NS_IMETHOD GetNamespaceURI (nsAString &aNamespaceURI)
NS_IMETHOD GetNodeName (nsAString &aNodeName)
nsINodeGetNodeParent () const
NS_IMETHOD GetNodeType (PRUint16 *aNodeType)
NS_IMETHOD GetNodeValue (nsAString &aNodeValue)
nsIDocument * GetOwnerDoc () const
nsIDocument * GetOwnerDocument () const
nsIContentGetParent () const
const nsAttrValue * GetParsedAttr (nsIAtom *aAttr) const
NS_IMETHOD GetPrefix (nsAString &aPrefix)
nsIFrameGetPrimaryFrame (mozFlushType aType)
nsIFrameGetPrimaryFrame ()
virtual void * GetProperty (PRUint16 aCategory, nsIAtom *aPropertyName, nsresult *aStatus=nsnull) const
void * GetProperty (nsIAtom *aPropertyName, nsresult *aStatus=nsnull) const
virtual PRUint32 GetScriptTypeID () const
nsIContentGetSelectionRootContent (nsIPresShell *aPresShell)
nsIContentGetSibling (PRInt32 aOffset)
virtual nsresult GetSystemEventGroup (nsIDOMEventGroup **aGroup)
NS_IMETHOD GetTagName (nsAString &aTagName)
virtual nsPIDOMEventTarget * GetTargetForDOMEvent ()
virtual nsPIDOMEventTarget * GetTargetForEventTargetChain ()
virtual const nsTextFragmentGetText ()
nsIContentGetTextEditorRootContent (nsIEditor **aEditor=nsnull)
JSObject * GetWrapper () const
virtual PRBool HasAttr (PRInt32 aNameSpaceID, nsIAtom *aName) const
NS_IMETHOD HasAttribute (const nsAString &aName, PRBool *aReturn)
NS_IMETHOD HasAttributeNS (const nsAString &aNamespaceURI, const nsAString &aLocalName, PRBool *aReturn)
NS_IMETHOD HasAttributes (PRBool *aHasAttributes)
NS_IMETHOD HasChildNodes (PRBool *aHasChildNodes)
PRBool HasFlag (PtrBits aFlag) const
PRBool HasProperties () const
PRBool HasSameOwnerDoc (nsINode *aOther)
virtual PRInt32 IndexOf (nsINode *aPossibleChild) const
NS_IMETHOD InsertBefore (nsIDOMNode *aNewChild, nsIDOMNode *aRefChild, nsIDOMNode **aReturn)
virtual nsresult InsertChildAt (nsIContent *aKid, PRUint32 aIndex, PRBool aNotify)
virtual PRInt32 IntrinsicState () const
 IsAttributeMapped (const nsIAtom *aAttribute) const
virtual PRBool IsDoneAddingChildren ()
PRBool IsEditable () const
virtual PRBool IsFocusable (PRInt32 *aTabIndex=nsnull)
PRBool IsInAnonymousSubtree () const
PRBool IsInDoc () const
PRBool IsInHTMLDocument () const
PRBool IsInNativeAnonymousSubtree () const
virtual PRBool IsLink (nsIURI **aURI) const
virtual PRBool IsNodeOfType (PRUint32 aFlags) const
PRBool IsRootOfAnonymousSubtree () const
PRBool IsRootOfNativeAnonymousSubtree () const
NS_IMETHOD IsSupported (const nsAString &aFeature, const nsAString &aVersion, PRBool *aReturn)
nsresult JoinTextNodes (nsIContent *aFirst, nsIContent *aSecond)
nsresult LeaveLink (nsPresContext *aPresContext)
virtual nsresult MaybeTriggerAutoLink (nsIDocShell *aShell)
virtual PRBool MayHaveFrame () const
nsINodeInfo * NodeInfo () const
nsIPrincipal * NodePrincipal () const
NS_IMETHOD Normalize ()
 NS_IMETHOD_ (PRBool) IsAttributeMapped(const nsIAtom *aAttribute) const =0
 nsGenericElement (nsINodeInfo *aNodeInfo)
virtual void PerformAccesskey (PRBool aKeyCausesActivation, PRBool aIsTrustedEvent)
virtual nsresult PostHandleEvent (nsEventChainPostVisitor &aVisitor)
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
nsresult 
PostQueryInterface (REFNSIID aIID, void **aInstancePtr)
virtual nsresult PreHandleEvent (nsEventChainPreVisitor &aVisitor)
PRBool PreservingWrapper ()
virtual void RecompileScriptEventListeners ()
NS_IMETHOD RemoveAttribute (const nsAString &aName)
NS_IMETHOD RemoveAttributeNode (nsIDOMAttr *aOldAttr, nsIDOMAttr **aReturn)
NS_IMETHOD RemoveAttributeNS (const nsAString &aNamespaceURI, const nsAString &aLocalName)
NS_IMETHOD RemoveChild (nsIDOMNode *aOldChild, nsIDOMNode **aReturn)
virtual nsresult RemoveChildAt (PRUint32 aIndex, PRBool aNotify, PRBool aMutationEvent=PR_TRUE)
virtual nsresult RemoveEventListenerByIID (nsIDOMEventListener *aListener, const nsIID &aIID)
virtual void RemoveMutationObserver (nsIMutationObserver *aMutationObserver)
NS_IMETHOD ReplaceChild (nsIDOMNode *aNewChild, nsIDOMNode *aOldChild, nsIDOMNode **aReturn)
virtual void SaveSubtreeState ()
virtual nsresult SetAttr (PRInt32 aNameSpaceID, nsIAtom *aName, nsIAtom *aPrefix, const nsAString &aValue, PRBool aNotify)
nsresult SetAttr (PRInt32 aNameSpaceID, nsIAtom *aName, const nsAString &aValue, PRBool aNotify)
NS_IMETHOD SetAttribute (const nsAString &aName, const nsAString &aValue)
NS_IMETHOD SetAttributeNode (nsIDOMAttr *aNewAttr, nsIDOMAttr **aReturn)
NS_IMETHOD SetAttributeNodeNS (nsIDOMAttr *aNewAttr, nsIDOMAttr **aReturn)
NS_IMETHOD SetAttributeNS (const nsAString &aNamespaceURI, const nsAString &aQualifiedName, const nsAString &aValue)
void SetEditableFlag (PRBool aEditable)
void SetFlags (PtrBits aFlagsToSet)
NS_IMETHOD SetInlineStyleRule (nsICSSStyleRule *aStyleRule, PRBool aNotify)
virtual void SetLinkState (nsLinkState aState)
virtual void SetMayHaveFrame (PRBool aMayHaveFrame)
void SetNativeAnonymous ()
NS_IMETHOD SetNodeValue (const nsAString &aNodeValue)
NS_IMETHOD SetPrefix (const nsAString &aPrefix)
void SetPreservingWrapper (PRBool aPreserve)
virtual nsresult SetProperty (PRUint16 aCategory, nsIAtom *aPropertyName, void *aValue, NSPropertyDtorFunc aDtor=nsnull, PRBool aTransfer=PR_FALSE, void **aOldValue=nsnull)
nsresult SetProperty (nsIAtom *aPropertyName, void *aValue, NSPropertyDtorFunc aDtor=nsnull, PRBool aTransfer=PR_FALSE)
NS_IMETHOD SetScriptTypeID (PRUint32 aLang)
nsresult SetText (const nsAString &aStr, PRBool aNotify)
virtual nsresult SetText (const PRUnichar *aBuffer, PRUint32 aLength, PRBool aNotify)
void SetWrapper (JSObject *aWrapper)
nsIAtom * Tag () const
virtual PRBool TextIsOnlyWhitespace ()
virtual PRUint32 TextLength ()
virtual void UnbindFromTree (PRBool aDeep=PR_TRUE, PRBool aNullParent=PR_TRUE)
virtual nsresult UnsetAttr (PRInt32 aNameSpaceID, nsIAtom *aAttribute, PRBool aNotify)
void UnsetFlags (PtrBits aFlagsToUnset)
virtual void * UnsetProperty (PRUint16 aCategory, nsIAtom *aPropertyName, nsresult *aStatus=nsnull)
void * UnsetProperty (nsIAtom *aPropertyName, nsresult *aStatus=nsnull)
virtual void UpdateEditableState ()
NS_IMETHOD WalkContentStyleRules (nsRuleWalker *aRuleWalker)
virtual nsresult WillHandleEvent (nsEventChainPostVisitor &aVisitor)
Methods
 NS_IMETHOD_ (nsrefcnt) AddRef(void)=0
NS_IMETHOD QueryInterface (REFNSIID aIID, void **aInstancePtr)=0

Static Public Member Functions

static nsresult DispatchClickEvent (nsPresContext *aPresContext, nsInputEvent *aSourceEvent, nsIContent *aTarget, PRBool aFullDispatch, nsEventStatus *aStatus)
static nsresult DispatchEvent (nsPresContext *aPresContext, nsEvent *aEvent, nsIContent *aTarget, PRBool aFullDispatch, nsEventStatus *aStatus)
static nsresult doInsertChildAt (nsIContent *aKid, PRUint32 aIndex, PRBool aNotify, nsIContent *aParent, nsIDocument *aDocument, nsAttrAndChildArray &aChildArray)
static PRBool doMatchesSelector (nsIContent *aNode, const nsAString &aSelector)
static nsresult doPreHandleEvent (nsIContent *aContent, nsEventChainPreVisitor &aVisitor)
static nsresult doQuerySelector (nsINode *aRoot, const nsAString &aSelector, nsIDOMElement **aReturn)
static nsresult doQuerySelectorAll (nsINode *aRoot, const nsAString &aSelector, nsIDOMNodeList **aReturn)
static nsresult doRemoveChild (nsIDOMNode *aOldChild, nsIContent *aParent, nsIDocument *aDocument, nsIDOMNode **aReturn)
static nsresult doRemoveChildAt (PRUint32 aIndex, PRBool aNotify, nsIContent *aKid, nsIContent *aParent, nsIDocument *aDocument, nsAttrAndChildArray &aChildArray, PRBool aMutationEvent)
static nsresult doReplaceOrInsertBefore (PRBool aReplace, nsIDOMNode *aNewChild, nsIDOMNode *aRefChild, nsIContent *aParent, nsIDocument *aDocument, nsIDOMNode **aReturn)
static PRBool FindAttributeDependence (const nsIAtom *aAttribute, const MappedAttributeEntry *const aMaps[], PRUint32 aMapCount)
static already_AddRefed
< nsIDOMNSFeatureFactory > 
GetDOMFeatureFactory (const nsAString &aFeature, const nsAString &aVersion)
static nsIFrameGetPrimaryFrameFor (nsIContent *aContent, nsIDocument *aDocument)
static nsresult InternalGetFeature (nsISupports *aObject, const nsAString &aFeature, const nsAString &aVersion, nsISupports **aReturn)
static nsresult InternalIsSupported (nsISupports *aObject, const nsAString &aFeature, const nsAString &aVersion, PRBool *aReturn)
static PRBool ShouldBlur (nsIContent *aContent)

Static Public Attributes

static PRInt32 sTabFocusModel = eTabFocus_any
static PRBool sTabFocusModelAppliesToXUL = PR_FALSE

Protected Types

enum  { PARENT_BIT_INDOCUMENT = 1 << 0, PARENT_BIT_PARENT_IS_CONTENT = 1 << 1 }
enum  { kParentBitMask = 0x3 }

Protected Member Functions

virtual nsresult AfterSetAttr (PRInt32 aNamespaceID, nsIAtom *aName, const nsAString *aValue, PRBool aNotify)
virtual nsresult BeforeSetAttr (PRInt32 aNamespaceID, nsIAtom *aName, const nsAString *aValue, PRBool aNotify)
PRBool CheckHandleEventForLinksPrecondition (nsEventChainVisitor &aVisitor, nsIURI **aURI) const
nsresult CopyInnerTo (nsGenericElement *aDest) const
virtual nsINode::nsSlots * CreateSlots ()
nsSlots * FlagsAsSlots () const
virtual nsAttrInfo GetAttrInfo (PRInt32 aNamespaceID, nsIAtom *aName) const
nsresult GetChildNodes (nsIDOMNodeList **aChildNodes)
void GetContentsAsText (nsAString &aText)
nsDOMSlotsGetDOMSlots ()
virtual nsresult GetEventListenerManagerForAttr (nsIEventListenerManager **aManager, nsISupports **aTarget, PRBool *aDefer)
nsDOMSlotsGetExistingDOMSlots () const
nsSlots * GetExistingSlots () const
nsresult GetFirstChild (nsIDOMNode **aFirstChild)
nsresult GetLastChild (nsIDOMNode **aLastChild)
virtual void GetLinkTarget (nsAString &aTarget)
nsTObserverArray
< nsIMutationObserver * > * 
GetMutationObservers ()
nsresult GetNextSibling (nsIDOMNode **aNextSibling)
virtual void GetOffsetRect (nsRect &aRect, nsIContent **aOffsetParent)
nsresult GetOwnerDocument (nsIDOMDocument **aOwnerDocument)
nsresult GetParentNode (nsIDOMNode **aParentNode)
nsresult GetPreviousSibling (nsIDOMNode **aPrevSibling)
nsSlots * GetSlots ()
nsIFrameGetStyledFrame ()
PRBool HasSlots () const
virtual const nsAttrName * InternalGetExistingAttrNameFromQName (const nsAString &aStr) const
virtual PRBool IsEditableExternal () const
PRBool IsEditableInternal () const
virtual PRBool ParseAttribute (PRInt32 aNamespaceID, nsIAtom *aAttribute, const nsAString &aValue, nsAttrValue &aResult)
nsresult PostHandleEventForLinks (nsEventChainPostVisitor &aVisitor)
nsresult PreHandleEventForLinks (nsEventChainPreVisitor &aVisitor)
void RegisterFreezableElement ()
nsresult SetAttrAndNotify (PRInt32 aNamespaceID, nsIAtom *aName, nsIAtom *aPrefix, const nsAString &aOldValue, nsAttrValue &aParsedValue, PRBool aModification, PRBool aFireMutation, PRBool aNotify, const nsAString *aValueForAfterSetAttr)
virtual PRBool SetMappedAttribute (nsIDocument *aDocument, nsIAtom *aName, nsAttrValue &aValue, nsresult *aRetval)
void UnregisterFreezableElement ()

Protected Attributes

nsAttrAndChildArray mAttrsAndChildren
PtrBits mFlagsOrSlots
nsCOMPtr< nsINodeInfo > mNodeInfo
PtrBits mParentPtrBits

Friends

class nsNodeSupportsWeakRefTearoff
class nsNodeUtils
class nsNodeWeakReference
class nsNSElementTearoff

Classes

struct  MappedAttributeEntry
struct  nsAttrInfo
class  nsDOMSlots

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index