Back to index

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

#include <nsRange.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS nsRange ()
virtual ~nsRange ()
NS_DECL_NSIDOMRANGE NS_IMETHOD CreateContextualFragment (const nsAString &aFragment, nsIDOMDocumentFragment **aReturn)
NS_IMETHOD IsPointInRange (nsIDOMNode *aParent, PRInt32 aOffset, PRBool *aResult)
NS_IMETHOD ComparePoint (nsIDOMNode *aParent, PRInt32 aOffset, PRInt16 *aResult)
NS_IMETHOD IntersectsNode (nsIDOMNode *aNode, PRBool *aReturn)
NS_IMETHOD CompareNode (nsIDOMNode *aNode, PRUint16 *aReturn)
NS_IMETHOD NSDetach ()
NS_IMETHOD GetHasGeneratedBefore (PRBool *aBool)
NS_IMETHOD GetHasGeneratedAfter (PRBool *aBool)
NS_IMETHOD SetHasGeneratedBefore (PRBool aBool)
NS_IMETHOD SetHasGeneratedAfter (PRBool aBool)
NS_IMETHOD SetBeforeAndAfter (PRBool aBefore, PRBool aAfter)
void setStart (in nsIDOMNode refNode, in long offset) raises (RangeException, DOMException)
void setEnd (in nsIDOMNode refNode, in long offset) raises (RangeException, DOMException)
void setStartBefore (in nsIDOMNode refNode) raises (RangeException, DOMException)
void setStartAfter (in nsIDOMNode refNode) raises (RangeException, DOMException)
void setEndBefore (in nsIDOMNode refNode) raises (RangeException, DOMException)
void setEndAfter (in nsIDOMNode refNode) raises (RangeException, DOMException)
void collapse (in boolean toStart) raises (DOMException)
void selectNode (in nsIDOMNode refNode) raises (RangeException, DOMException)
void selectNodeContents (in nsIDOMNode refNode) raises (RangeException, DOMException)
short compareBoundaryPoints (in unsigned short how, in nsIDOMRange sourceRange) raises (DOMException)
void deleteContents () raises (DOMException)
nsIDOMDocumentFragment extractContents () raises (DOMException)
nsIDOMDocumentFragment cloneContents () raises (DOMException)
void insertNode (in nsIDOMNode newNode) raises (DOMException, RangeException)
void surroundContents (in nsIDOMNode newParent) raises (DOMException, RangeException)
nsIDOMRange cloneRange () raises (DOMException)
DOMString toString () raises (DOMException)
void detach () raises (DOMException)
nsIDOMDocumentFragment createContextualFragment (in DOMString fragment)
boolean isPointInRange (in nsIDOMNode parent, in long offset)
short comparePoint (in nsIDOMNode parent, in long offset)
boolean intersectsNode (in nsIDOMNode n)
unsigned short compareNode (in nsIDOMNode n)
void nSDetach ()

Static Public Member Functions

static NS_METHOD OwnerGone (nsIContent *aParentNode)
static NS_METHOD OwnerChildInserted (nsIContent *aParentNode, PRInt32 aOffset)
static NS_METHOD OwnerChildRemoved (nsIContent *aParentNode, PRInt32 aOffset, nsIContent *aRemovedNode)
static NS_METHOD OwnerChildReplaced (nsIContent *aParentNode, PRInt32 aOffset, nsIContent *aReplacedNode)
static nsresult TextOwnerChanged (nsIContent *aTextNode, nsVoidArray *aRangeList, PRInt32 aStartOffset, PRInt32 aEndOffset, PRInt32 aReplaceLength)
static PRInt32 IndexOf (nsIDOMNode *aNode)
static nsresult PopRanges (nsIDOMNode *aDestNode, PRInt32 aOffset, nsIContent *aSourceNode)
static nsresult CloneParentsBetween (nsIDOMNode *aAncestor, nsIDOMNode *aNode, nsIDOMNode **closestAncestor, nsIDOMNode **farthestAncestor)
static PRInt32 ComparePoints (nsIDOMNode *aParent1, PRInt32 aOffset1, nsIDOMNode *aParent2, PRInt32 aOffset2)
 Utility routine to compare two "points", where a point is a node/offset pair Returns -1 if point1 < point2, 1, if point1 > point2, 0 if error or if point1 == point2.
static PRBool IsNodeIntersectsRange (nsIContent *aNode, nsIDOMRange *aRange)
 Utility routine to detect if a content node intersects a range.
static nsresult CompareNodeToRange (nsIContent *aNode, nsIDOMRange *aRange, PRBool *outNodeBefore, PRBool *outNodeAfter)

Public Attributes

readonly attribute nsIDOMNode startContainer
readonly attribute long startOffset
readonly attribute nsIDOMNode endContainer
readonly attribute long endOffset
readonly attribute boolean collapsed
readonly attribute nsIDOMNode commonAncestorContainer
const unsigned short START_TO_START = 0
const unsigned short START_TO_END = 1
const unsigned short END_TO_END = 2
const unsigned short END_TO_START = 3
const unsigned short NODE_BEFORE = 0
const unsigned short NODE_AFTER = 1
const unsigned short NODE_BEFORE_AND_AFTER = 2
const unsigned short NODE_INSIDE = 3

Protected Member Functions

 nsRange (const nsRange &)
nsRangeoperator= (const nsRange &)
nsresult DoSetRange (nsIDOMNode *aStartN, PRInt32 aStartOffset, nsIDOMNode *aEndN, PRInt32 aEndOffset)
PRBool IsDetached ()
nsresult ComparePointToRange (nsIDOMNode *aParent, PRInt32 aOffset, PRInt32 *aResult)
nsresult AddToListOf (nsIDOMNode *aNode)
void RemoveFromListOf (nsIDOMNode *aNode)
nsresult ContentOwnsUs (nsIDOMNode *domNode)
nsresult GetIsPositioned (PRBool *aIsPositioned)

Static Protected Member Functions

static nsresult CollapseRangeAfterDelete (nsIDOMRange *aRange)
static PRInt32 GetNodeLength (nsIDOMNode *aNode)
static PRBool IsIncreasing (nsIDOMNode *aStartN, PRInt32 aStartOff, nsIDOMNode *aEndN, PRInt32 aEndOff)

Protected Attributes

PRPackedBool mBeforeGenContent
PRPackedBool mAfterGenContent
PRPackedBool mIsPositioned
PRPackedBool mIsDetached
PRInt32 mStartOffset
PRInt32 mEndOffset
nsCOMPtr< nsIDOMNodemStartParent
nsCOMPtr< nsIDOMNodemEndParent

Detailed Description

Definition at line 79 of file nsRange.h.


Constructor & Destructor Documentation

nsRange::~nsRange ( ) [virtual]

Definition at line 392 of file nsRange.cpp.

{
  DoSetRange(nsCOMPtr<nsIDOMNode>(),0,nsCOMPtr<nsIDOMNode>(),0); 
  // we want the side effects (releases and list removals)
  // note that "nsCOMPtr<nsIDOMmNode>()" is the moral equivalent of null
} 

Here is the call graph for this function:

nsRange::nsRange ( const nsRange ) [protected]

Member Function Documentation

nsresult nsRange::AddToListOf ( nsIDOMNode aNode) [protected]

Definition at line 551 of file nsRange.cpp.

{
  if (!aNode) 
    return NS_ERROR_NULL_POINTER;

  nsresult res;
  nsCOMPtr<nsIContent> cN = do_QueryInterface(aNode, &res);
  if (NS_FAILED(res)) 
    return res;

  res = cN->RangeAdd(NS_STATIC_CAST(nsIDOMRange*,this));
  return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIDOMDocumentFragment nsIDOMRange::cloneContents ( ) raises (DOMException) [inherited]
nsresult nsRange::CloneParentsBetween ( nsIDOMNode aAncestor,
nsIDOMNode aNode,
nsIDOMNode **  closestAncestor,
nsIDOMNode **  farthestAncestor 
) [static]

Definition at line 1641 of file nsRange.cpp.

{
  NS_ENSURE_ARG_POINTER((aAncestor && aNode && aClosestAncestor && aFarthestAncestor));

  *aClosestAncestor  = nsnull;
  *aFarthestAncestor = nsnull;

  if (aAncestor == aNode)
    return NS_OK;

  nsCOMPtr<nsIDOMNode> parent, firstParent, lastParent;

  nsresult res = aNode->GetParentNode(getter_AddRefs(parent));

  while(parent && parent != aAncestor)
  {
    nsCOMPtr<nsIDOMNode> clone, tmpNode;

    res = parent->CloneNode(PR_FALSE, getter_AddRefs(clone));

    if (NS_FAILED(res)) return res;
    if (!clone)         return NS_ERROR_FAILURE;

    if (! firstParent)
      firstParent = lastParent = clone;
    else
    {
      res = clone->AppendChild(lastParent, getter_AddRefs(tmpNode));

      if (NS_FAILED(res)) return res;

      lastParent = clone;
    }

    tmpNode = parent;
    res = tmpNode->GetParentNode(getter_AddRefs(parent));
  }

  *aClosestAncestor  = firstParent;
  NS_IF_ADDREF(*aClosestAncestor);

  *aFarthestAncestor = lastParent;
  NS_IF_ADDREF(*aFarthestAncestor);

  return NS_OK;
}

Here is the call graph for this function:

nsIDOMRange nsIDOMRange::cloneRange ( ) raises (DOMException) [inherited]
void nsIDOMRange::collapse ( in boolean  toStart) raises (DOMException) [inherited]
nsresult nsRange::CollapseRangeAfterDelete ( nsIDOMRange aRange) [static, protected]

Definition at line 1345 of file nsRange.cpp.

{
  NS_ENSURE_ARG_POINTER(aRange);

  // Check if range gravity took care of collapsing the range for us!

  PRBool isCollapsed = PR_FALSE;
  nsresult res = aRange->GetCollapsed(&isCollapsed);
  if (NS_FAILED(res)) return res;

  if (isCollapsed)
  {
    // aRange is collapsed so there's nothing for us to do.
    //
    // There are 2 possible scenarios here:
    //
    // 1. aRange could've been collapsed prior to the delete/extract,
    //    which would've resulted in nothing being removed, so aRange
    //    is already where it should be.
    //
    // 2. Prior to the delete/extract, aRange's start and end were in
    //    the same container which would mean everything between them
    //    was removed, causing range gravity to collapse the range.

    return NS_OK;
  }

  // aRange isn't collapsed so figure out the appropriate place to collapse!
  // First get both end points and their common ancestor.

  nsCOMPtr<nsIDOMNode> commonAncestor;
  res = aRange->GetCommonAncestorContainer(getter_AddRefs(commonAncestor));
  if(NS_FAILED(res)) return res;

  nsCOMPtr<nsIDOMNode> startContainer, endContainer;

  res = aRange->GetStartContainer(getter_AddRefs(startContainer));
  if (NS_FAILED(res)) return res;

  res = aRange->GetEndContainer(getter_AddRefs(endContainer));
  if (NS_FAILED(res)) return res;

  // Collapse to one of the end points if they are already in the
  // commonAncestor. This should work ok since this method is called
  // immediately after a delete or extract that leaves no content
  // between the 2 end points!

  if (startContainer == commonAncestor)
    return aRange->Collapse(PR_TRUE);
  if (endContainer == commonAncestor)
    return aRange->Collapse(PR_FALSE);

  // End points are at differing levels. We want to collapse to the
  // point that is between the 2 subtrees that contain each point,
  // under the common ancestor.

  nsCOMPtr<nsIDOMNode> nodeToSelect(startContainer), parent;

  while (nodeToSelect)
  {
    nsresult res = nodeToSelect->GetParentNode(getter_AddRefs(parent));
    if (NS_FAILED(res)) return res;

    if (parent == commonAncestor)
      break; // We found the nodeToSelect!

    nodeToSelect = parent;
  }

  if (!nodeToSelect)
    return NS_ERROR_FAILURE; // This should never happen!

  res = aRange->SelectNode(nodeToSelect);
  if (NS_FAILED(res)) return res;

  return aRange->Collapse(PR_FALSE);
}

Here is the call graph for this function:

short nsIDOMRange::compareBoundaryPoints ( in unsigned short  how,
in nsIDOMRange  sourceRange 
) raises (DOMException) [inherited]
unsigned short nsIDOMNSRange::compareNode ( in nsIDOMNode  n) [inherited]
NS_IMETHODIMP nsRange::CompareNode ( nsIDOMNode aNode,
PRUint16 aReturn 
)

Definition at line 507 of file nsRange.cpp.

{
  if (!aReturn)
    return NS_ERROR_NULL_POINTER;
  *aReturn = 0;
  PRBool nodeBefore, nodeAfter;
  nsCOMPtr<nsIContent> content (do_QueryInterface(aNode));
  if (!content)
    return NS_ERROR_UNEXPECTED;

  nsresult res = CompareNodeToRange(content, this, &nodeBefore, &nodeAfter);
  if (NS_FAILED(res))
    return res;

  // nodeBefore -> range start after node start, i.e. node starts before range.
  // nodeAfter -> range end before node end, i.e. node ends after range.
  // But I know that I get nodeBefore && !nodeAfter when the node is
  // entirely inside the selection!  This doesn't make sense.
  if (nodeBefore && !nodeAfter)
    *aReturn = nsIDOMNSRange::NODE_BEFORE;  // May or may not intersect
  else if (!nodeBefore && nodeAfter)
    *aReturn = nsIDOMNSRange::NODE_AFTER;   // May or may not intersect
  else if (nodeBefore && nodeAfter)
    *aReturn = nsIDOMNSRange::NODE_BEFORE_AND_AFTER;  // definitely intersects
  else
    *aReturn = nsIDOMNSRange::NODE_INSIDE;            // definitely intersects

  return NS_OK;
}

Here is the call graph for this function:

nsresult nsRange::CompareNodeToRange ( nsIContent aNode,
nsIDOMRange aRange,
PRBool outNodeBefore,
PRBool outNodeAfter 
) [static]

Definition at line 180 of file nsRange.cpp.

{
  // create a pair of dom points that expresses location of node:
  //     NODE(start), NODE(end)
  // Let incoming range be:
  //    {RANGE(start), RANGE(end)}
  // if (RANGE(start) <= NODE(start))  and (RANGE(end) => NODE(end))
  // then the Node is contained (completely) by the Range.
  
  if (!aNode) 
    return NS_ERROR_NULL_POINTER;
  if (!aRange) 
    return NS_ERROR_NULL_POINTER;
  if (!outNodeBefore) 
    return NS_ERROR_NULL_POINTER;
  if (!outNodeAfter) 
    return NS_ERROR_NULL_POINTER;
  
  PRBool isPositioned;
  nsresult err = ((nsRange*)aRange)->GetIsPositioned(&isPositioned);
  // Why do I have to cast above?  Because GetIsPositioned() is
  // mysteriously missing from the nsIDOMRange interface.  dunno why.

  if (NS_FAILED(err))
    return err;
    
  if (!isPositioned) 
    return NS_ERROR_UNEXPECTED; 
  
  nsCOMPtr<nsIDOMNode> parent, rangeStartParent, rangeEndParent;
  PRInt32 nodeStart, nodeEnd, rangeStartOffset, rangeEndOffset; 
  
  // gather up the dom point info
  if (!GetNodeBracketPoints(aNode, address_of(parent), &nodeStart, &nodeEnd))
    return NS_ERROR_FAILURE;
  
  if (NS_FAILED(aRange->GetStartContainer(getter_AddRefs(rangeStartParent))))
    return NS_ERROR_FAILURE;

  if (NS_FAILED(aRange->GetStartOffset(&rangeStartOffset)))
    return NS_ERROR_FAILURE;

  if (NS_FAILED(aRange->GetEndContainer(getter_AddRefs(rangeEndParent))))
    return NS_ERROR_FAILURE;

  if (NS_FAILED(aRange->GetEndOffset(&rangeEndOffset)))
    return NS_ERROR_FAILURE;

  *outNodeBefore = PR_FALSE;
  *outNodeAfter = PR_FALSE;
  
  // is RANGE(start) <= NODE(start) ?
  PRInt32 comp = ComparePoints(rangeStartParent, rangeStartOffset, parent, nodeStart);
  if (comp > 0)
    *outNodeBefore = PR_TRUE; // range start is after node start
    
  // is RANGE(end) >= NODE(end) ?
  comp = ComparePoints(rangeEndParent, rangeEndOffset, parent, nodeEnd);
  if (comp < 0)
    *outNodeAfter = PR_TRUE; // range end is before node end
    
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

short nsIDOMNSRange::comparePoint ( in nsIDOMNode  parent,
in long  offset 
) [inherited]
NS_IMETHODIMP nsRange::ComparePoint ( nsIDOMNode aParent,
PRInt32  aOffset,
PRInt16 aResult 
)

Definition at line 436 of file nsRange.cpp.

{
  // check arguments
  if (!aResult) 
    return NS_ERROR_NULL_POINTER;
  
  // no trivial cases please
  if (!aParent) 
    return NS_ERROR_NULL_POINTER;
  
  // our range is in a good state?
  if (!mIsPositioned) 
    return NS_ERROR_NOT_INITIALIZED;
  
  // check common case first
  if ((aParent == mStartParent.get()) && (aParent == mEndParent.get()))
  {
    if (aOffset<mStartOffset)
    {
      *aResult = -1;
      return NS_OK;
    }
    if (aOffset>mEndOffset)
    {
      *aResult = 1;
      return NS_OK;
    }
    *aResult = 0;
    return NS_OK;
  }
  
  // more common cases
  if ((aParent == mStartParent.get()) && (aOffset == mStartOffset)) 
  {
    *aResult = 0;
    return NS_OK;
  }
  if ((aParent == mEndParent.get()) && (aOffset == mEndOffset)) 
  {
    *aResult = 0;
    return NS_OK;
  }
  
  // ok, do it the hard way
  if (IsIncreasing(aParent,aOffset,mStartParent,mStartOffset)) 
    *aResult = -1;
  else if (IsIncreasing(mEndParent,mEndOffset,aParent,aOffset)) 
    *aResult = 1;
  else 
    *aResult = 0;
  
  return NS_OK;
}

Here is the call graph for this function:

PRInt32 nsRange::ComparePoints ( nsIDOMNode aParent1,
PRInt32  aOffset1,
nsIDOMNode aParent2,
PRInt32  aOffset2 
) [static]

Utility routine to compare two "points", where a point is a node/offset pair Returns -1 if point1 < point2, 1, if point1 > point2, 0 if error or if point1 == point2.

Definition at line 113 of file nsRange.cpp.

{
  if (aParent1 == aParent2) {
    return (aOffset1 < aOffset2) ? -1 :
      ((aOffset1 > aOffset2) ? 1 : 0);
  }

  return IsIncreasing(aParent1, aOffset1, aParent2, aOffset2) ? -1 : 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsRange::ComparePointToRange ( nsIDOMNode aParent,
PRInt32  aOffset,
PRInt32 aResult 
) [protected]
nsresult nsRange::ContentOwnsUs ( nsIDOMNode domNode) [protected]

Definition at line 833 of file nsRange.cpp.

{
  NS_PRECONDITION(domNode, "null pointer");
  if ((mStartParent.get() != domNode) && (mEndParent.get() != domNode))
  {
    NS_NOTREACHED("nsRange::ContentOwnsUs");
    return NS_ERROR_UNEXPECTED;
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsRange::CreateContextualFragment ( const nsAString &  aFragment,
nsIDOMDocumentFragment **  aReturn 
)

Definition at line 2293 of file nsRange.cpp.

{
  if (!mIsPositioned) {
    return NS_ERROR_FAILURE;
  }

  // Create a new parser for this entire operation
  nsresult result;
  nsCOMPtr<nsIParser> parser = do_CreateInstance(kCParserCID, &result);
  NS_ENSURE_SUCCESS(result, result);

  nsCOMPtr<nsIDocument> document;
  nsCOMPtr<nsIDOMDocument> domDocument;

  result = mStartParent->GetOwnerDocument(getter_AddRefs(domDocument));
  if (domDocument && NS_SUCCEEDED(result)) {
    document = do_QueryInterface(domDocument, &result);
  }

  nsVoidArray tagStack;
  nsCOMPtr<nsIDOMNode> parent = mStartParent;
  while (parent && 
         (parent != domDocument) && 
         NS_SUCCEEDED(result)) {
    PRUint16 nodeType;
    
    parent->GetNodeType(&nodeType);
    if (nsIDOMNode::ELEMENT_NODE == nodeType) {
      PRInt32 namespaceID;
      nsAutoString tagName, uriStr;
      parent->GetNodeName(tagName);

      // see if we need to add xmlns declarations
      nsCOMPtr<nsIContent> content( do_QueryInterface(parent) );
      PRUint32 count = content->GetAttrCount();
      PRBool setDefaultNamespace = PR_FALSE;
      if (count > 0) {
        PRUint32 index;
        nsAutoString nameStr, prefixStr, valueStr;
        nsCOMPtr<nsIAtom> attrName, attrPrefix;

        for (index = 0; index < count; index++) {
    
          content->GetAttrNameAt(index,
                                &namespaceID,
                                getter_AddRefs(attrName),
                                getter_AddRefs(attrPrefix));
    
          if (namespaceID == kNameSpaceID_XMLNS) {
            content->GetAttr(namespaceID, attrName, uriStr);

            // really want something like nsXMLContentSerializer::SerializeAttr()
            tagName.Append(NS_LITERAL_STRING(" xmlns")); // space important
            if (attrPrefix) {
              tagName.Append(PRUnichar(':'));
              attrName->ToString(nameStr);
              tagName.Append(nameStr);
            }
            else {
              setDefaultNamespace = PR_TRUE;
            }
            tagName.Append(NS_LITERAL_STRING("=\"") + uriStr + NS_LITERAL_STRING("\""));
          }
        }
      }
      if (!setDefaultNamespace) {
        nsINodeInfo* info = content->GetNodeInfo();
        if (info && !info->GetPrefixAtom() &&
            info->NamespaceID() != kNameSpaceID_None) {
          // We have no namespace prefix, but have a namespace ID.  Push
          // default namespace attr in, so that our kids will be in our
          // namespace.
          nsAutoString uri;
          info->GetNamespaceURI(uri);
          tagName.Append(NS_LITERAL_STRING(" xmlns=\"") + uri +
                         NS_LITERAL_STRING("\""));
        }
      }

      // XXX Wish we didn't have to allocate here
      PRUnichar* name = ToNewUnicode(tagName);
      if (name) {
        tagStack.AppendElement(name);
        nsCOMPtr<nsIDOMNode> temp = parent;
        result = temp->GetParentNode(getter_AddRefs(parent));
      }
      else {
        result = NS_ERROR_OUT_OF_MEMORY;
      }
    }
    else {
      nsCOMPtr<nsIDOMNode> temp = parent;
      result = temp->GetParentNode(getter_AddRefs(parent));
    }
  }

  if (NS_SUCCEEDED(result)) {
    nsCAutoString contentType;
    PRBool bCaseSensitive = PR_TRUE;
    if (document) {
      nsAutoString buf;
      document->GetContentType(buf);
      CopyUCS2toASCII(buf, contentType);
      bCaseSensitive = document->IsCaseSensitive();
    }
    else {
      contentType.AssignLiteral("text/xml");
    }

    nsCOMPtr<nsIHTMLDocument> htmlDoc(do_QueryInterface(domDocument));
    PRBool bHTML = htmlDoc && !bCaseSensitive;
    nsCOMPtr<nsIFragmentContentSink> sink;
    if (bHTML) {
      result = NS_NewHTMLFragmentContentSink(getter_AddRefs(sink));
    } else {
      result = NS_NewXMLFragmentContentSink(getter_AddRefs(sink));
    }
    if (NS_SUCCEEDED(result)) {
      sink->SetTargetDocument(document);
      nsCOMPtr<nsIContentSink> contentsink( do_QueryInterface(sink) );
      parser->SetContentSink(contentsink);

      // If there's no JS or system JS running,
      // push the current document's context on the JS context stack
      // so that event handlers in the fragment do not get 
      // compiled with the system principal.
      nsCOMPtr<nsIJSContextStack> ContextStack;
      if (document) {
        nsCOMPtr<nsIPrincipal> sysPrin;
        nsCOMPtr<nsIPrincipal> subjectPrin;

        nsIScriptSecurityManager *secMan = nsContentUtils::GetSecurityManager();

        // Just to compare, not to use!
        result = secMan->GetSystemPrincipal(getter_AddRefs(sysPrin));
        if (NS_SUCCEEDED(result))
            result = secMan->GetSubjectPrincipal(getter_AddRefs(subjectPrin));
        // If there's no subject principal, there's no JS running, so we're in system code.
        // (just in case...null subject principal will probably never happen)
        if (NS_SUCCEEDED(result) &&
           (!subjectPrin || sysPrin.get() == subjectPrin.get())) {
          nsIScriptGlobalObject *globalObj = document->GetScriptGlobalObject();
          JSContext* cx = nsnull;

          if (globalObj) {
            nsIScriptContext *scriptContext = globalObj->GetContext();

            if (scriptContext) {
              cx = (JSContext*)scriptContext->GetNativeContext();
            }
          }

          if (cx) {
            ContextStack = do_GetService("@mozilla.org/js/xpc/ContextStack;1");
            if (ContextStack) {
              result = ContextStack->Push(cx);
            }
          }
        }
      }

      nsDTDMode mode = eDTDMode_autodetect;
      nsCOMPtr<nsIHTMLDocument> htmlDoc(do_QueryInterface(domDocument));
      if (bHTML) {
        switch (htmlDoc->GetCompatibilityMode()) {
          case eCompatibility_NavQuirks:
            mode = eDTDMode_quirks;
            break;
          case eCompatibility_AlmostStandards:
            mode = eDTDMode_almost_standards;
            break;
          case eCompatibility_FullStandards:
            mode = eDTDMode_full_standards;
            break;
          default:
            NS_NOTREACHED("unknown mode");
            break;
        }
      } else {
        mode = eDTDMode_full_standards;
      }
      result = parser->ParseFragment(aFragment, (void*)0,
                                     tagStack,
                                     !bHTML, contentType, mode);

      if (ContextStack) {
        JSContext *notused;
        ContextStack->Pop(&notused);
      }

      if (NS_SUCCEEDED(result)) {
        result = sink->GetFragment(aReturn);
      }
    }
  }

  // XXX Ick! Delete strings we allocated above.
  PRInt32 count = tagStack.Count();
  for (PRInt32 i = 0; i < count; i++) {
    PRUnichar* str = (PRUnichar*)tagStack.ElementAt(i);
    if (str) {
      NS_Free(str);
    }
  }

  return result;
}

Here is the call graph for this function:

void nsIDOMRange::deleteContents ( ) raises (DOMException) [inherited]
void nsIDOMRange::detach ( ) raises (DOMException) [inherited]
nsresult nsRange::DoSetRange ( nsIDOMNode aStartN,
PRInt32  aStartOffset,
nsIDOMNode aEndN,
PRInt32  aEndOffset 
) [protected]

Definition at line 608 of file nsRange.cpp.

{
  //if only one endpoint is null, set it to the other one
  if (aStartN && !aEndN) 
  {
    aEndN = aStartN;
    aEndOffset = aStartOffset;
  }
  if (aEndN && !aStartN)
  {
    aStartN = aEndN;
    aStartOffset = aEndOffset;
  }
  
  if (mStartParent && (mStartParent.get() != aStartN) && (mStartParent.get() != aEndN))
  {
    // if old start parent no longer involved, remove range from that
    // node's range list.
    RemoveFromListOf(mStartParent);
  }
  if (mEndParent && (mEndParent.get() != aStartN) && (mEndParent.get() != aEndN))
  {
    // if old end parent no longer involved, remove range from that
    // node's range list.
    RemoveFromListOf(mEndParent);
  }
 
 
  if (mStartParent.get() != aStartN)
  {
    mStartParent = do_QueryInterface(aStartN);
    if (mStartParent) // if it has a new start node, put it on it's list
    {
      AddToListOf(mStartParent);  // AddToList() detects duplication for us
    }
  }
  mStartOffset = aStartOffset;

  if (mEndParent.get() != aEndN)
  {
    mEndParent = do_QueryInterface(aEndN);
    if (mEndParent) // if it has a new end node, put it on it's list
    {
      AddToListOf(mEndParent);  // AddToList() detects duplication for us
    }
  }
  mEndOffset = aEndOffset;

  if (mStartParent) 
    mIsPositioned = PR_TRUE;
  else
    mIsPositioned = PR_FALSE;

  // FIX ME need to handle error cases 
  // (range lists return error, or setting only one endpoint to null)
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIDOMDocumentFragment nsIDOMRange::extractContents ( ) raises (DOMException) [inherited]

Definition at line 2511 of file nsRange.cpp.

{
  NS_ENSURE_ARG_POINTER(aBool);
  *aBool = mAfterGenContent;
  return NS_OK;
}

Definition at line 2503 of file nsRange.cpp.

{
  NS_ENSURE_ARG_POINTER(aBool);
  *aBool = mBeforeGenContent;
  return NS_OK;
}
nsresult nsRange::GetIsPositioned ( PRBool aIsPositioned) [protected]

Definition at line 848 of file nsRange.cpp.

{
  *aIsPositioned = mIsPositioned;
  return NS_OK;
}
PRInt32 nsRange::GetNodeLength ( nsIDOMNode aNode) [static, protected]

Definition at line 576 of file nsRange.cpp.

{
  if (!aNode)
    return 0;

  PRUint16 nodeType;
  PRInt32 len = -1;

  aNode->GetNodeType(&nodeType);
  if( (nodeType == nsIDOMNode::CDATA_SECTION_NODE) ||
      (nodeType == nsIDOMNode::TEXT_NODE) )
  {
    nsCOMPtr<nsIDOMText> textText = do_QueryInterface(aNode);
    if (textText)
      textText->GetLength((PRUint32 *)&len);
  }
  else
  {
    nsCOMPtr<nsIDOMNodeList> childList;
    nsresult res = aNode->GetChildNodes(getter_AddRefs(childList));
    if (NS_SUCCEEDED(res) && childList)
      childList->GetLength((PRUint32 *)&len);
  }
  
  return len;
}

Here is the call graph for this function:

PRInt32 nsRange::IndexOf ( nsIDOMNode aNode) [static]

Definition at line 753 of file nsRange.cpp.

{
  // convert node to nsIContent, so that we can find the child index

  nsCOMPtr<nsIContent> contentChild = do_QueryInterface(aChildNode);
  if (!contentChild) 
    return 0;

  nsIContent *parent = contentChild->GetParent();

  if (!parent)
    return 0;

  // finally we get the index
  return parent->IndexOf(contentChild); 
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIDOMRange::insertNode ( in nsIDOMNode  newNode) raises (DOMException, RangeException) [inherited]

Definition at line 491 of file nsRange.cpp.

{
  if (!aReturn)
    return NS_ERROR_NULL_POINTER;
  nsCOMPtr<nsIContent> content (do_QueryInterface(aNode));
  if (!content)
  {
    *aReturn = 0;
    return NS_ERROR_UNEXPECTED;
  }
  *aReturn = IsNodeIntersectsRange(content, this);
  return NS_OK;
}

Here is the call graph for this function:

PRBool nsRange::IsDetached ( ) [inline, protected]

Definition at line 194 of file nsRange.h.

{return mIsDetached;}
PRBool nsRange::IsIncreasing ( nsIDOMNode aStartN,
PRInt32  aStartOff,
nsIDOMNode aEndN,
PRInt32  aEndOff 
) [static, protected]

Definition at line 668 of file nsRange.cpp.

{
  // no trivial cases please
  if (!aStartN || !aEndN) 
    return PR_FALSE;
  
  // check common case first
  if (aStartN == aEndN)
  {
    return aStartOffset <= aEndOffset;
  }

  nsCOMPtr<nsIContent> startCont = do_QueryInterface(aStartN);
  nsCOMPtr<nsIContent> endCont = do_QueryInterface(aEndN);

  nsAutoVoidArray startAncestors, endAncestors;
  nsIContent* node = startCont;
  while (node) {
    startAncestors.AppendElement(node);
    node = node->GetParent();
  }
  node = endCont;
  while (node) {
    endAncestors.AppendElement(node);
    node = node->GetParent();
  }
  
  // Get the number of ancestors, adjusting for zero-based counting.
  PRInt32 startIdx = startAncestors.Count() - 1;
  PRInt32 endIdx = endAncestors.Count() - 1;

  // Ensure that we actually have ancestors to iterate through
  if (startIdx < 0) {
    if (startIdx < endIdx) {
      return PR_TRUE;
    }
    return PR_FALSE;
  }
  if (endIdx < 0) {
    return PR_FALSE;
  }

  // back through the ancestors, starting from the root, until first non-matching ancestor found
  do
  {
    --startIdx;
    --endIdx;
    // numStartAncestors will only be <0 if one endpoint's node is the
    // common ancestor of the other
  } while (startIdx >= 0 && endIdx >= 0 &&
           startAncestors.FastElementAt(startIdx) ==
           endAncestors.FastElementAt(endIdx));
  // now back up one and that's the last common ancestor from the root,
  // or the first common ancestor from the leaf perspective
  ++startIdx;
  ++endIdx;
  // both indexes are now >= 0
  
  
  PRInt32 commonNodeStartOffset = startIdx == 0 ? aStartOffset :
    NS_STATIC_CAST(nsIContent*, startAncestors.FastElementAt(startIdx))->IndexOf(
      NS_STATIC_CAST(nsIContent*, startAncestors.FastElementAt(startIdx - 1)));

  PRInt32 commonNodeEndOffset = endIdx == 0 ? aEndOffset :
    NS_STATIC_CAST(nsIContent*, endAncestors.FastElementAt(endIdx))->IndexOf(
      NS_STATIC_CAST(nsIContent*, endAncestors.FastElementAt(endIdx - 1)));

  if (commonNodeStartOffset > commonNodeEndOffset) {
    return PR_FALSE;
  }

  if (commonNodeStartOffset < commonNodeEndOffset) {
    return PR_TRUE;
  }

  // The offsets are equal.  This can happen when one endpoint parent is the common parent
  // of both endpoints.  In this case, we compare the depth of the ancestor tree to determine
  // the ordering.

  NS_ASSERTION(startIdx != endIdx, "whoa nelly. this shouldn't happen");

  return startIdx < endIdx;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsRange::IsNodeIntersectsRange ( nsIContent aNode,
nsIDOMRange aRange 
) [static]

Utility routine to detect if a content node intersects a range.

Definition at line 127 of file nsRange.cpp.

{
  // create a pair of dom points that expresses location of node:
  //     NODE(start), NODE(end)
  // Let incoming range be:
  //    {RANGE(start), RANGE(end)}
  // if (RANGE(start) < NODE(end))  and (RANGE(end) > NODE(start))
  // then the Node intersect the Range.
  
  if (!aNode) return PR_FALSE;
  nsCOMPtr<nsIDOMNode> parent, rangeStartParent, rangeEndParent;
  PRInt32 nodeStart, nodeEnd, rangeStartOffset, rangeEndOffset; 
  
  // gather up the dom point info
  if (!GetNodeBracketPoints(aNode, address_of(parent), &nodeStart, &nodeEnd))
    return PR_FALSE;
  
  if (NS_FAILED(aRange->GetStartContainer(getter_AddRefs(rangeStartParent))))
    return PR_FALSE;

  if (NS_FAILED(aRange->GetStartOffset(&rangeStartOffset)))
    return PR_FALSE;

  if (NS_FAILED(aRange->GetEndContainer(getter_AddRefs(rangeEndParent))))
    return PR_FALSE;

  if (NS_FAILED(aRange->GetEndOffset(&rangeEndOffset)))
    return PR_FALSE;

  // is RANGE(start) < NODE(end) ?
  PRInt32 comp = ComparePoints(rangeStartParent, rangeStartOffset, parent, nodeEnd);
  if (comp >= 0)
    return PR_FALSE; // range start is after node end
    
  // is RANGE(end) > NODE(start) ?
  comp = ComparePoints(rangeEndParent, rangeEndOffset, parent, nodeStart);
  if (comp <= 0)
    return PR_FALSE; // range end is before node start
    
  // if we got here then the node intersects the range
  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

boolean nsIDOMNSRange::isPointInRange ( in nsIDOMNode  parent,
in long  offset 
) [inherited]

Definition at line 421 of file nsRange.cpp.

{
  PRInt16 compareResult = 0;
  nsresult res;
  res = ComparePoint(aParent, aOffset, &compareResult);
  if (compareResult) 
    *aResult = PR_FALSE;
  else 
    *aResult = PR_TRUE;
  return res;
}
void nsIDOMNSRange::nSDetach ( ) [inherited]

Definition at line 540 of file nsRange.cpp.

{
  return DoSetRange(nsnull,0,nsnull,0);
}

Here is the call graph for this function:

nsRange& nsRange::operator= ( const nsRange ) [protected]
nsresult nsRange::OwnerChildInserted ( nsIContent aParentNode,
PRInt32  aOffset 
) [static]

Definition at line 2121 of file nsRange.cpp.

{
  // sanity check - null nodes shouldn't have enclosed ranges
  if (!aParentNode) return NS_ERROR_UNEXPECTED;

  nsCOMPtr<nsIContent> parent( do_QueryInterface(aParentNode) );
  // quick return if no range list
  const nsVoidArray *theRangeList = parent->GetRangeList();
  if (!theRangeList) return NS_OK;

  nsresult res;

  nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(parent));
  if (!domNode) return NS_ERROR_UNEXPECTED;


  PRInt32   count = theRangeList->Count();
  for (PRInt32 loop = 0; loop < count; loop++)
  {
    nsRange* theRange = NS_STATIC_CAST(nsRange*, (theRangeList->ElementAt(loop))); 
    NS_ASSERTION(theRange, "oops, no range");

    // sanity check - do range and content agree over ownership?
    res = theRange->ContentOwnsUs(domNode);
    NS_PRECONDITION(NS_SUCCEEDED(res), "range and content disagree over range ownership");
    if (NS_SUCCEEDED(res))
    {
      if (theRange->mStartParent == domNode)
      {
        // if child inserted before start, move start offset right one
        if (aOffset < theRange->mStartOffset) theRange->mStartOffset++;
      }
      if (theRange->mEndParent == domNode)
      {
        // if child inserted before end, move end offset right one
        if (aOffset < theRange->mEndOffset) theRange->mEndOffset++;
      }
      NS_PRECONDITION(NS_SUCCEEDED(res), "error updating range list");
    }
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsRange::OwnerChildRemoved ( nsIContent aParentNode,
PRInt32  aOffset,
nsIContent aRemovedNode 
) [static]

Definition at line 2165 of file nsRange.cpp.

{
  // sanity check - null nodes shouldn't have enclosed ranges
  if (!aParentNode) return NS_ERROR_UNEXPECTED;

  nsCOMPtr<nsIContent> parent( do_QueryInterface(aParentNode) );
  nsCOMPtr<nsIContent> removed( do_QueryInterface(aRemovedNode) );

  // any ranges in the content subtree rooted by aRemovedNode need to
  // have the enclosed endpoints promoted up to the parentNode/offset
  nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(parent));
  if (!domNode) return NS_ERROR_UNEXPECTED;
  nsresult res = PopRanges(domNode, aOffset, removed);

  // quick return if no range list
  const nsVoidArray *theRangeList = parent->GetRangeList();
  if (!theRangeList) return NS_OK;
  
  PRInt32   count = theRangeList->Count();
  for (PRInt32 loop = 0; loop < count; loop++)
  {
    nsRange* theRange = NS_STATIC_CAST(nsRange*, (theRangeList->ElementAt(loop))); 
    NS_ASSERTION(theRange, "oops, no range");

    // sanity check - do range and content agree over ownership?
    res = theRange->ContentOwnsUs(domNode);
    NS_PRECONDITION(NS_SUCCEEDED(res), "range and content disagree over range ownership");
    if (NS_SUCCEEDED(res))
    {
      if (theRange->mStartParent == domNode)
      {
        // if child deleted before start, move start offset left one
        if (aOffset < theRange->mStartOffset) theRange->mStartOffset--;
      }
      if (theRange->mEndParent == domNode)
      {
        // if child deleted before end, move end offset left one
        if (aOffset < theRange->mEndOffset) 
        {
          if (theRange->mEndOffset>0) theRange->mEndOffset--;
        }
      }
    }
  }
  
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsRange::OwnerChildReplaced ( nsIContent aParentNode,
PRInt32  aOffset,
nsIContent aReplacedNode 
) [static]

Definition at line 2214 of file nsRange.cpp.

{
  // sanity check - null nodes shouldn't have enclosed ranges
  if (!aParentNode) return NS_ERROR_UNEXPECTED;

  // don't need to adjust ranges whose endpoints are in this parent,
  // but we do need to pop out any range endpoints inside the subtree
  // rooted by aReplacedNode.
  
  nsCOMPtr<nsIContent> parent( do_QueryInterface(aParentNode) );
  nsCOMPtr<nsIContent> replaced( do_QueryInterface(aReplacedNode) );
  nsCOMPtr<nsIDOMNode> parentDomNode( do_QueryInterface(parent) ); 

  if (!parentDomNode) return NS_ERROR_UNEXPECTED;

  return PopRanges(parentDomNode, aOffset, replaced);
}

Here is the call graph for this function:

nsresult nsRange::OwnerGone ( nsIContent aParentNode) [static]

Definition at line 2111 of file nsRange.cpp.

{
  // nothing for now - should be impossible to getter here
  // No node should be deleted if it holds a range endpoint,
  // since the range endpoint addrefs the node.
  NS_ASSERTION(PR_FALSE,"Deleted content holds a range endpoint");  
  return NS_OK;
}
nsresult nsRange::PopRanges ( nsIDOMNode aDestNode,
PRInt32  aOffset,
nsIContent aSourceNode 
) [static]

Definition at line 770 of file nsRange.cpp.

{
  // utility routine to pop all the range endpoints inside the content subtree defined by 
  // aSourceNode, into the node/offset represented by aDestNode/aOffset.
  
  nsCOMPtr<nsIContentIterator> iter;
  nsresult res = NS_NewContentIterator(getter_AddRefs(iter));
  iter->Init(aSourceNode);

  const nsVoidArray* theRangeList;

  while (!iter->IsDone())
  {
    nsIContent *cN = iter->GetCurrentNode();

    theRangeList = cN->GetRangeList();
    if (theRangeList)
    {
       nsRange* theRange;
       PRInt32  theCount = theRangeList->Count();
       while (theCount)
       {
          theRange = NS_STATIC_CAST(nsRange*, (theRangeList->ElementAt(0)));
          if (theRange)
          {
            nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(cN));
            NS_POSTCONDITION(domNode, "error updating range list");
            // sanity check - do range and content agree over ownership?
            res = theRange->ContentOwnsUs(domNode);
            NS_POSTCONDITION(NS_SUCCEEDED(res), "range and content disagree over range ownership");

            if (theRange->mStartParent == domNode)
            {
              // promote start point up to replacement point
              res = theRange->SetStart(aDestNode, aOffset);
              NS_POSTCONDITION(NS_SUCCEEDED(res), "nsRange::PopRanges() got error from SetStart()");
              if (NS_FAILED(res)) return res;
            }
            if (theRange->mEndParent == domNode)
            {
              // promote end point up to replacement point
              res = theRange->SetEnd(aDestNode, aOffset);
              NS_POSTCONDITION(NS_SUCCEEDED(res), "nsRange::PopRanges() got error from SetEnd()");
              if (NS_FAILED(res)) return res;
            }          
          }
          // must refresh theRangeList - it might have gone away!
          theRangeList = cN->GetRangeList();
          if (theRangeList)
            theCount = theRangeList->Count();
          else
            theCount = 0;
       } 
    }

    iter->Next();
  }
  
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsRange::RemoveFromListOf ( nsIDOMNode aNode) [protected]

Definition at line 566 of file nsRange.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIDOMRange::selectNode ( in nsIDOMNode  refNode) raises (RangeException, DOMException) [inherited]
void nsIDOMRange::selectNodeContents ( in nsIDOMNode  refNode) raises (RangeException, DOMException) [inherited]

Definition at line 2533 of file nsRange.cpp.

{
  mBeforeGenContent = aBefore;
  mBeforeGenContent = aAfter;
  return NS_OK;
}
void nsIDOMRange::setEnd ( in nsIDOMNode  refNode,
in long  offset 
) raises (RangeException, DOMException) [inherited]
void nsIDOMRange::setEndAfter ( in nsIDOMNode  refNode) raises (RangeException, DOMException) [inherited]
void nsIDOMRange::setEndBefore ( in nsIDOMNode  refNode) raises (RangeException, DOMException) [inherited]

Definition at line 2526 of file nsRange.cpp.

{
  mAfterGenContent = aBool;
  return NS_OK;
}

Definition at line 2519 of file nsRange.cpp.

{
  mBeforeGenContent = aBool;
  return NS_OK;
}
void nsIDOMRange::setStart ( in nsIDOMNode  refNode,
in long  offset 
) raises (RangeException, DOMException) [inherited]
void nsIDOMRange::setStartAfter ( in nsIDOMNode  refNode) raises (RangeException, DOMException) [inherited]
void nsIDOMRange::setStartBefore ( in nsIDOMNode  refNode) raises (RangeException, DOMException) [inherited]
void nsIDOMRange::surroundContents ( in nsIDOMNode  newParent) raises (DOMException, RangeException) [inherited]
nsresult nsRange::TextOwnerChanged ( nsIContent aTextNode,
nsVoidArray aRangeList,
PRInt32  aStartOffset,
PRInt32  aEndOffset,
PRInt32  aReplaceLength 
) [static]

Definition at line 2234 of file nsRange.cpp.

{
  NS_ASSERTION(aRangeList,
               "Don't call TextOwnerChanged if aTextNode is not in a range!");
  NS_ASSERTION(aTextNode, "Null nodes don't have enclosed ranges!");

  nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(aTextNode));
  if (!domNode) return NS_ERROR_UNEXPECTED;

  PRInt32   count = aRangeList->Count();
  for (PRInt32 loop = 0; loop < count; loop++)
  {
    nsRange* theRange = NS_STATIC_CAST(nsRange*, (aRangeList->ElementAt(loop))); 
    NS_ASSERTION(theRange, "oops, no range");

    // sanity check - do range and content agree over ownership?
    nsresult res = theRange->ContentOwnsUs(domNode);
    NS_PRECONDITION(NS_SUCCEEDED(res), "range and content disagree over range ownership");
    if (NS_SUCCEEDED(res))
    { 
      PRBool bStartPointInChangedText = PR_FALSE;
      
      if (theRange->mStartParent == domNode)
      {
        // if range start is inside changed text, position it after change
        if ((aStartChanged <= theRange->mStartOffset) && (aEndChanged >= theRange->mStartOffset))
        { 
          theRange->mStartOffset = aStartChanged+aReplaceLength;
          bStartPointInChangedText = PR_TRUE;
        }
        // else if text changed before start, adjust start offset
        else if (aEndChanged <= theRange->mStartOffset) 
          theRange->mStartOffset += aStartChanged + aReplaceLength - aEndChanged;
      }
      if (theRange->mEndParent == domNode)
      {
        // if range end is inside changed text, position it before change
        if ((aStartChanged <= theRange->mEndOffset) && (aEndChanged >= theRange->mEndOffset)) 
        {
          theRange->mEndOffset = aStartChanged;
          // hack: if BOTH range endpoints were inside the change, then they
          // both get collapsed to the beginning of the change.  
          if (bStartPointInChangedText) theRange->mStartOffset = aStartChanged;
        }
        // else if text changed before end, adjust end offset
        else if (aEndChanged <= theRange->mEndOffset) 
          theRange->mEndOffset += aStartChanged + aReplaceLength - aEndChanged;
      }
    }
  }
  
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

DOMString nsIDOMRange::toString ( ) raises (DOMException) [inherited]

Member Data Documentation

Definition at line 66 of file nsIDOMRange.idl.

Definition at line 69 of file nsIDOMRange.idl.

const unsigned short nsIDOMRange::END_TO_END = 2 [inherited]

Definition at line 94 of file nsIDOMRange.idl.

const unsigned short nsIDOMRange::END_TO_START = 3 [inherited]

Definition at line 95 of file nsIDOMRange.idl.

Definition at line 60 of file nsIDOMRange.idl.

readonly attribute long nsIDOMRange::endOffset [inherited]

Definition at line 63 of file nsIDOMRange.idl.

Definition at line 128 of file nsRange.h.

Definition at line 127 of file nsRange.h.

Definition at line 134 of file nsRange.h.

Definition at line 137 of file nsRange.h.

Definition at line 131 of file nsRange.h.

Definition at line 130 of file nsRange.h.

Definition at line 133 of file nsRange.h.

Definition at line 136 of file nsRange.h.

const unsigned short nsIDOMNSRange::NODE_AFTER = 1 [inherited]

Definition at line 63 of file nsIDOMNSRange.idl.

const unsigned short nsIDOMNSRange::NODE_BEFORE = 0 [inherited]

Definition at line 62 of file nsIDOMNSRange.idl.

const unsigned short nsIDOMNSRange::NODE_BEFORE_AND_AFTER = 2 [inherited]

Definition at line 64 of file nsIDOMNSRange.idl.

const unsigned short nsIDOMNSRange::NODE_INSIDE = 3 [inherited]

Definition at line 65 of file nsIDOMNSRange.idl.

const unsigned short nsIDOMRange::START_TO_END = 1 [inherited]

Definition at line 93 of file nsIDOMRange.idl.

const unsigned short nsIDOMRange::START_TO_START = 0 [inherited]

Definition at line 92 of file nsIDOMRange.idl.

Definition at line 54 of file nsIDOMRange.idl.

readonly attribute long nsIDOMRange::startOffset [inherited]

Definition at line 57 of file nsIDOMRange.idl.


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