Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes
nsDOMAttribute Class Reference

#include <nsDOMAttribute.h>

Inheritance diagram for nsDOMAttribute:
Inheritance graph
[legend]
Collaboration diagram for nsDOMAttribute:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsDOMAttribute (nsDOMAttributeMap *aAttrMap, nsINodeInfo *aNodeInfo, const nsAString &aValue)
virtual ~nsDOMAttribute ()
virtual NS_DECL_ISUPPORTS
nsIDOMGCParticipant
GetSCCIndex ()
 Get a reference node for what is known to be a strongly connected component of nsIDOMGCParticipants.
virtual void AppendReachableList (nsCOMArray< nsIDOMGCParticipant > &aArray)
 Append the list of nsIDOMGCPartipants reachable from this one via C++ getters exposed to script that return a different result from |GetSCCIndex|.
NS_DECL_NSIDOMNODE
NS_DECL_NSIDOM3NODE
NS_DECL_NSIDOMATTR void 
SetMap (nsDOMAttributeMap *aMap)
nsIContentGetContent () const
virtual voidGetProperty (nsIAtom *aPropertyName, nsresult *aStatus=nsnull)
virtual nsresult SetProperty (nsIAtom *aPropertyName, void *aValue, NSPropertyDtorFunc aDtor)
virtual nsresult DeleteProperty (nsIAtom *aPropertyName)
virtual voidUnsetProperty (nsIAtom *aPropertyName, nsresult *aStatus=nsnull)
nsIDOMNode insertBefore (in nsIDOMNode newChild, in nsIDOMNode refChild) raises (DOMException)
nsIDOMNode replaceChild (in nsIDOMNode newChild, in nsIDOMNode oldChild) raises (DOMException)
nsIDOMNode removeChild (in nsIDOMNode oldChild) raises (DOMException)
nsIDOMNode appendChild (in nsIDOMNode newChild) raises (DOMException)
boolean hasChildNodes ()
nsIDOMNode cloneNode (in boolean deep)
void normalize ()
boolean isSupported (in DOMString feature, in DOMString version)
boolean hasAttributes ()
unsigned short compareDocumentPosition (in nsIDOMNode other) raises (DOMException)
boolean isSameNode (in nsIDOMNode other)
DOMString lookupPrefix (in DOMString namespaceURI)
boolean isDefaultNamespace (in DOMString namespaceURI)
DOMString lookupNamespaceURI (in DOMString prefix)
boolean isEqualNode (in nsIDOMNode arg)
nsISupports getFeature (in DOMString feature, in DOMString version)
nsIVariant setUserData (in DOMString key, in nsIVariant data, in nsIDOMUserDataHandler handler)
nsIVariant getUserData (in DOMString key)
nsDOMAttributeMapGetMap ()
nsINodeInfoNodeInfo ()
nsIDocumentGetOwnerDoc () const

Static Public Member Functions

static void Initialize ()
static void Shutdown ()

Public Attributes

readonly attribute DOMString name
readonly attribute boolean specified
attribute DOMString value
readonly attribute nsIDOMElement ownerElement
const unsigned short ELEMENT_NODE = 1
const unsigned short ATTRIBUTE_NODE = 2
const unsigned short TEXT_NODE = 3
const unsigned short CDATA_SECTION_NODE = 4
const unsigned short ENTITY_REFERENCE_NODE = 5
const unsigned short ENTITY_NODE = 6
const unsigned short PROCESSING_INSTRUCTION_NODE = 7
const unsigned short COMMENT_NODE = 8
const unsigned short DOCUMENT_NODE = 9
const unsigned short DOCUMENT_TYPE_NODE = 10
const unsigned short DOCUMENT_FRAGMENT_NODE = 11
const unsigned short NOTATION_NODE = 12
readonly attribute DOMString nodeName
attribute DOMString nodeValue
readonly attribute unsigned short nodeType
readonly attribute nsIDOMNode parentNode
readonly attribute nsIDOMNodeList childNodes
readonly attribute nsIDOMNode firstChild
readonly attribute nsIDOMNode lastChild
readonly attribute nsIDOMNode previousSibling
readonly attribute nsIDOMNode nextSibling
readonly attribute
nsIDOMNamedNodeMap 
attributes
readonly attribute nsIDOMDocument ownerDocument
readonly attribute DOMString namespaceURI
attribute DOMString prefix
readonly attribute DOMString localName
readonly attribute DOMString baseURI
const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01
const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02
const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04
const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08
const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10
const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20
attribute DOMString textContent

Protected Attributes

nsDOMAttributeMapmAttrMap
nsCOMPtr< nsINodeInfomNodeInfo

Static Protected Attributes

static PRBool sInitialized

Private Member Functions

nsIContentGetContentInternal () const

Private Attributes

nsString mValue
nsIDOMTextmChild
nsAttributeChildListmChildList

Detailed Description

Definition at line 72 of file nsDOMAttribute.h.


Constructor & Destructor Documentation

nsDOMAttribute::nsDOMAttribute ( nsDOMAttributeMap aAttrMap,
nsINodeInfo aNodeInfo,
const nsAString &  aValue 
)

Definition at line 54 of file nsDOMAttribute.cpp.

  : nsIAttribute(aAttrMap, aNodeInfo), mValue(aValue), mChild(nsnull),
    mChildList(nsnull)
{
  NS_ABORT_IF_FALSE(mNodeInfo, "We must get a nodeinfo here!");


  // We don't add a reference to our content. It will tell us
  // to drop our reference when it goes away.
}

Definition at line 67 of file nsDOMAttribute.cpp.

{
  nsIDocument *doc = GetOwnerDoc();
  if (doc)
    doc->PropertyTable()->DeleteAllPropertiesFor(this);

  NS_IF_RELEASE(mChild);
  if (mChildList) {
    mChildList->DropReference();
    NS_RELEASE(mChildList);
  }
}

Here is the call graph for this function:


Member Function Documentation

nsIDOMNode nsIDOMNode::appendChild ( in nsIDOMNode  newChild) raises (DOMException) [inherited]

Append the list of nsIDOMGCPartipants reachable from this one via C++ getters exposed to script that return a different result from |GetSCCIndex|.

The caller is responsible for taking the transitive closure of |AppendReachableList|.

This will only be called on objects that are returned by GetSCCIndex.

null pointers may be appended; they will be ignored by the caller.

Implements nsIDOMGCParticipant.

Definition at line 106 of file nsDOMAttribute.cpp.

{
  NS_ASSERTION(GetContentInternal() == nsnull,
               "shouldn't be an SCC index if we're in an element");

  // This node is the root of a subtree that's been removed from the
  // document (since AppendReachableList is only called on SCC index
  // nodes).  The document is reachable from it (through
  // .ownerDocument), but it's not reachable from the document.
  nsCOMPtr<nsIDOMGCParticipant> participant = do_QueryInterface(GetOwnerDoc());
  aArray.AppendObject(participant);
}

Here is the call graph for this function:

nsIDOMNode nsIDOMNode::cloneNode ( in boolean  deep) [inherited]
unsigned short nsIDOM3Node::compareDocumentPosition ( in nsIDOMNode  other) raises (DOMException) [inherited]
nsresult nsDOMAttribute::DeleteProperty ( nsIAtom aPropertyName) [virtual]

Implements nsIAttribute.

Definition at line 738 of file nsDOMAttribute.cpp.

{
  nsIDocument *doc = GetOwnerDoc();
  if (!doc)
    return nsnull;

  return doc->PropertyTable()->DeleteProperty(this, aPropertyName);
}

Here is the call graph for this function:

nsIContent * nsDOMAttribute::GetContent ( ) const [virtual]

Implements nsIAttribute.

Definition at line 133 of file nsDOMAttribute.cpp.

{
  return GetContentInternal();
}

Here is the call graph for this function:

nsIContent* nsDOMAttribute::GetContentInternal ( ) const [inline, private]

Definition at line 123 of file nsDOMAttribute.h.

  {
    return mAttrMap ? mAttrMap->GetContent() : nsnull;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

nsISupports nsIDOM3Node::getFeature ( in DOMString  feature,
in DOMString  version 
) [inherited]
nsDOMAttributeMap* nsIAttribute::GetMap ( ) [inline, inherited]

Definition at line 62 of file nsIAttribute.h.

  {
    return mAttrMap;
  }
nsIDocument* nsIAttribute::GetOwnerDoc ( ) const [inline, inherited]

Definition at line 74 of file nsIAttribute.h.

  {
    nsIContent* content = GetContent();
    return content ? content->GetOwnerDoc() : mNodeInfo->GetDocument();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void * nsDOMAttribute::GetProperty ( nsIAtom aPropertyName,
nsresult aStatus = nsnull 
) [virtual]

Implements nsIAttribute.

Definition at line 715 of file nsDOMAttribute.cpp.

{
  nsIDocument *doc = GetOwnerDoc();
  if (!doc)
    return nsnull;

  return doc->PropertyTable()->GetProperty(this, aPropertyName, aStatus);
}

Here is the call graph for this function:

Get a reference node for what is known to be a strongly connected component of nsIDOMGCParticipants.

For example, DOM trees are strongly connected, so can return the root node to greatly reduce the number of nodes on which we need to run graph algorithms.

Note that it's acceptable for nodes in a single strongly connected component to return different values for GetSCCIndex, as long as those two values claim that they're reachable from each other in AppendReachableList.

Implements nsIDOMGCParticipant.

Definition at line 98 of file nsDOMAttribute.cpp.

{
  nsIContent *owner = GetContentInternal();

  return owner ? owner->GetSCCIndex() : this;
}

Here is the call graph for this function:

nsIVariant nsIDOM3Node::getUserData ( in DOMString  key) [inherited]

Definition at line 758 of file nsDOMAttribute.cpp.

nsIDOMNode nsIDOMNode::insertBefore ( in nsIDOMNode  newChild,
in nsIDOMNode  refChild 
) raises (DOMException) [inherited]
boolean nsIDOM3Node::isDefaultNamespace ( in DOMString  namespaceURI) [inherited]
boolean nsIDOM3Node::isSameNode ( in nsIDOMNode  other) [inherited]
boolean nsIDOMNode::isSupported ( in DOMString  feature,
in DOMString  version 
) [inherited]
DOMString nsIDOM3Node::lookupNamespaceURI ( in DOMString  prefix) [inherited]
DOMString nsIDOM3Node::lookupPrefix ( in DOMString  namespaceURI) [inherited]
nsINodeInfo* nsIAttribute::NodeInfo ( ) [inline, inherited]

Definition at line 67 of file nsIAttribute.h.

  {
    return mNodeInfo;
  }
void nsIDOMNode::normalize ( ) [inherited]
nsIDOMNode nsIDOMNode::removeChild ( in nsIDOMNode  oldChild) raises (DOMException) [inherited]
nsIDOMNode nsIDOMNode::replaceChild ( in nsIDOMNode  newChild,
in nsIDOMNode  oldChild 
) raises (DOMException) [inherited]

Implements nsIAttribute.

Definition at line 120 of file nsDOMAttribute.cpp.

{
  if (mAttrMap && !aMap && sInitialized) {
    // We're breaking a relationship with content and not getting a new one,
    // need to locally cache value. GetValue() does that.
    nsAutoString tmp;
    GetValue(tmp);
  }
  
  mAttrMap = aMap;
}

Here is the call graph for this function:

nsresult nsDOMAttribute::SetProperty ( nsIAtom aPropertyName,
void aValue,
NSPropertyDtorFunc  aDtor 
) [virtual]

Implements nsIAttribute.

Definition at line 725 of file nsDOMAttribute.cpp.

{
  nsIDocument *doc = GetOwnerDoc();
  if (!doc)
    return NS_ERROR_FAILURE;

  return doc->PropertyTable()->SetProperty(this, aPropertyName, aValue, aDtor,
                                           nsnull);
}

Here is the call graph for this function:

nsIVariant nsIDOM3Node::setUserData ( in DOMString  key,
in nsIVariant  data,
in nsIDOMUserDataHandler  handler 
) [inherited]

Definition at line 764 of file nsDOMAttribute.cpp.

void * nsDOMAttribute::UnsetProperty ( nsIAtom aPropertyName,
nsresult aStatus = nsnull 
) [virtual]

Implements nsIAttribute.

Definition at line 748 of file nsDOMAttribute.cpp.

{
  nsIDocument *doc = GetOwnerDoc();
  if (!doc)
    return nsnull;

  return doc->PropertyTable()->UnsetProperty(this, aPropertyName, aStatus);
}

Here is the call graph for this function:


Member Data Documentation

const unsigned short nsIDOMNode::ATTRIBUTE_NODE = 2 [inherited]

Definition at line 57 of file nsIDOMNode.idl.

Definition at line 80 of file nsIDOMNode.idl.

readonly attribute DOMString nsIDOM3Node::baseURI [inherited]

Definition at line 50 of file nsIDOM3Node.idl.

const unsigned short nsIDOMNode::CDATA_SECTION_NODE = 4 [inherited]

Definition at line 59 of file nsIDOMNode.idl.

Definition at line 75 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::COMMENT_NODE = 8 [inherited]

Definition at line 63 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::DOCUMENT_FRAGMENT_NODE = 11 [inherited]

Definition at line 66 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::DOCUMENT_NODE = 9 [inherited]

Definition at line 64 of file nsIDOMNode.idl.

const unsigned short nsIDOM3Node::DOCUMENT_POSITION_CONTAINED_BY = 0x10 [inherited]

Definition at line 57 of file nsIDOM3Node.idl.

const unsigned short nsIDOM3Node::DOCUMENT_POSITION_CONTAINS = 0x08 [inherited]

Definition at line 56 of file nsIDOM3Node.idl.

const unsigned short nsIDOM3Node::DOCUMENT_POSITION_DISCONNECTED = 0x01 [inherited]

Definition at line 53 of file nsIDOM3Node.idl.

const unsigned short nsIDOM3Node::DOCUMENT_POSITION_FOLLOWING = 0x04 [inherited]

Definition at line 55 of file nsIDOM3Node.idl.

Definition at line 58 of file nsIDOM3Node.idl.

const unsigned short nsIDOM3Node::DOCUMENT_POSITION_PRECEDING = 0x02 [inherited]

Definition at line 54 of file nsIDOM3Node.idl.

const unsigned short nsIDOMNode::DOCUMENT_TYPE_NODE = 10 [inherited]

Definition at line 65 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::ELEMENT_NODE = 1 [inherited]

Definition at line 56 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::ENTITY_NODE = 6 [inherited]

Definition at line 61 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::ENTITY_REFERENCE_NODE = 5 [inherited]

Definition at line 60 of file nsIDOMNode.idl.

Definition at line 76 of file nsIDOMNode.idl.

Definition at line 77 of file nsIDOMNode.idl.

readonly attribute DOMString nsIDOMNode::localName [inherited]

Definition at line 107 of file nsIDOMNode.idl.

nsDOMAttributeMap* nsIAttribute::mAttrMap [protected, inherited]

Definition at line 102 of file nsIAttribute.h.

Definition at line 120 of file nsDOMAttribute.h.

Definition at line 121 of file nsDOMAttribute.h.

nsCOMPtr<nsINodeInfo> nsIAttribute::mNodeInfo [protected, inherited]

Definition at line 103 of file nsIAttribute.h.

Definition at line 117 of file nsDOMAttribute.h.

readonly attribute DOMString nsIDOMAttr::name [inherited]

Definition at line 56 of file nsIDOMAttr.idl.

readonly attribute DOMString nsIDOMNode::namespaceURI [inherited]

Definition at line 101 of file nsIDOMNode.idl.

Definition at line 79 of file nsIDOMNode.idl.

readonly attribute DOMString nsIDOMNode::nodeName [inherited]

Definition at line 69 of file nsIDOMNode.idl.

readonly attribute unsigned short nsIDOMNode::nodeType [inherited]

Definition at line 73 of file nsIDOMNode.idl.

attribute DOMString nsIDOMNode::nodeValue [inherited]

Definition at line 70 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::NOTATION_NODE = 12 [inherited]

Definition at line 67 of file nsIDOMNode.idl.

Definition at line 82 of file nsIDOMNode.idl.

Definition at line 62 of file nsIDOMAttr.idl.

Definition at line 74 of file nsIDOMNode.idl.

attribute DOMString nsIDOMNode::prefix [inherited]

Definition at line 103 of file nsIDOMNode.idl.

Definition at line 78 of file nsIDOMNode.idl.

const unsigned short nsIDOMNode::PROCESSING_INSTRUCTION_NODE = 7 [inherited]

Definition at line 62 of file nsIDOMNode.idl.

PRBool nsDOMAttribute::sInitialized [static, protected]

Definition at line 114 of file nsDOMAttribute.h.

readonly attribute boolean nsIDOMAttr::specified [inherited]

Definition at line 57 of file nsIDOMAttr.idl.

const unsigned short nsIDOMNode::TEXT_NODE = 3 [inherited]

Definition at line 58 of file nsIDOMNode.idl.

attribute DOMString nsIDOM3Node::textContent [inherited]

Definition at line 64 of file nsIDOM3Node.idl.

attribute DOMString nsIDOMAttr::value [inherited]

Definition at line 58 of file nsIDOMAttr.idl.


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