Back to index

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

Implementation of the XForms <insert> and <delete> elements. More...

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

List of all members.

Public Member Functions

 nsXFormsInsertDeleteElement (PRBool aIsInsert)
 Constructor.
NS_IMETHOD HandleAction (nsIDOMEvent *aEvent, nsIXFormsActionElement *aParentAction)
nsresult HandleSingleAction (nsIDOMEvent *aEvent, nsIXFormsActionElement *aParentAction)
 Normally, an action element implements the body of its action handler using this method; however, since an nsXFormsInsertDeleteElement sets up additional context before evaluating if and while, it overrides the HandleAction method instead to get full control over the execution of its action.
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIXFORMSACTIONMODULEELEMENT
NS_DECL_NSIXTFGENERICELEMENT
NS_DECL_NSIDOMEVENTLISTENER
NS_IMETHOD 
OnDestroyed ()
NS_IMETHOD WillChangeDocument (nsIDOMDocument *aNewDocument)
NS_IMETHOD DocumentChanged (nsIDOMDocument *aNewDocument)
NS_IMETHOD WillChangeParent (nsIDOMElement *aNewParent)
NS_IMETHOD ParentChanged (nsIDOMElement *aNewParent)
virtual nsIDOMElementGetElement ()
void handleEvent (in nsIDOMEvent event)
 This method is called whenever an event occurs of the type for which the EventListener interface was registered.
virtual nsRepeatState GetRepeatState ()
 Get/Set the repeat state for the xforms control or action.
virtual void SetRepeatState (nsRepeatState aState)
void onCreated (in nsIXTFGenericElementWrapper wrapper)
void onDestroyed ()
void getScriptingInterfaces (out unsigned long count,[array, size_is(count), retval] out nsIIDPtr array)
void willChangeDocument (in nsIDOMDocument newDoc)
void documentChanged (in nsIDOMDocument newDoc)
void willChangeParent (in nsIDOMElement newParent)
void parentChanged (in nsIDOMElement newParent)
void willInsertChild (in nsIDOMNode child, in unsigned long index)
void childInserted (in nsIDOMNode child, in unsigned long index)
void willAppendChild (in nsIDOMNode child)
void childAppended (in nsIDOMNode child)
void willRemoveChild (in unsigned long index)
void childRemoved (in unsigned long index)
void willSetAttribute (in nsIAtom name, in AString newValue)
void attributeSet (in nsIAtom name, in AString newValue)
void willRemoveAttribute (in nsIAtom name)
void attributeRemoved (in nsIAtom name)
void beginAddingChildren ()
void doneAddingChildren ()
boolean handleDefault (in nsIDOMEvent aEvent)
void cloneState (in nsIDOMElement aElement)
void handleAction (in nsIDOMEvent aEvent, in nsIXFormsActionElement aParentAction)
nsIDOMEvent getCurrentEvent ()
 Get the event currently being processed in handleAction.
PRBool CanIterate ()
void SetCurrentEvent (nsIDOMEvent *aEvent)

Static Public Member Functions

static nsresult DoHandleAction (nsXFormsActionModuleHelper *aXFormsAction, nsIDOMEvent *aEvent, nsIXFormsActionElement *aParentAction)
static PRBool CanPerformAction (nsIDOMElement *aElement, PRBool *aUsesWhile, nsIDOMNode *aContextNode=nsnull, PRInt32 aContextSize=0, PRInt32 aContextPosition=0)
 Determine whether this action element should be executed, based upon optional if and while attributes.

Public Attributes

const unsigned long ELEMENT_TYPE_GENERIC_ELEMENT = 0
const unsigned long ELEMENT_TYPE_SVG_VISUAL = 1
const unsigned long ELEMENT_TYPE_XML_VISUAL = 2
const unsigned long ELEMENT_TYPE_XUL_VISUAL = 3
const unsigned long ELEMENT_TYPE_BINDABLE = 4
readonly attribute unsigned long elementType
readonly attribute boolean isAttributeHandler
const unsigned long NOTIFY_WILL_CHANGE_DOCUMENT = 0x00000001
const unsigned long NOTIFY_DOCUMENT_CHANGED = 0x00000002
const unsigned long NOTIFY_WILL_CHANGE_PARENT = 0x00000004
const unsigned long NOTIFY_PARENT_CHANGED = 0x00000008
const unsigned long NOTIFY_WILL_INSERT_CHILD = 0x00000010
const unsigned long NOTIFY_CHILD_INSERTED = 0x00000020
const unsigned long NOTIFY_WILL_APPEND_CHILD = 0x00000040
const unsigned long NOTIFY_CHILD_APPENDED = 0x00000080
const unsigned long NOTIFY_WILL_REMOVE_CHILD = 0x00000100
const unsigned long NOTIFY_CHILD_REMOVED = 0x00000200
const unsigned long NOTIFY_WILL_SET_ATTRIBUTE = 0x00000400
const unsigned long NOTIFY_ATTRIBUTE_SET = 0x00000800
const unsigned long NOTIFY_WILL_REMOVE_ATTRIBUTE = 0x00001000
const unsigned long NOTIFY_ATTRIBUTE_REMOVED = 0x00002000
const unsigned long NOTIFY_BEGIN_ADDING_CHILDREN = 0x00004000
const unsigned long NOTIFY_DONE_ADDING_CHILDREN = 0x00008000
const unsigned long NOTIFY_HANDLE_DEFAULT = 0x00010000

Protected Member Functions

virtual nsRepeatState UpdateRepeatState (nsIDOMNode *aParent)
 This is processed when an XForms control or XForms action has been inserted under a parent node AND has been inserted into a document.

Protected Attributes

nsIDOMElementmElement
nsRepeatState mRepeatState
PRPackedBool mHasParent
 State that tells whether control has a parent or not.
PRPackedBool mHasDoc
 State that tells whether control has a document or not.
PRBool mCanIterate
 This signals whether or not this action can iterate.
nsCOMPtr< nsIDOMEventmCurrentEvent
 The event currently being processed.

Private Types

enum  Location { eLocation_After, eLocation_Before, eLocation_FirstChild }

Private Member Functions

nsresult GetFirstNodeOfType (nsCOMArray< nsIDOMNode > *aNodes, PRUint16 aNodeType, nsIDOMNode **aResult)
 Get the first node of a given type in aNodes.
nsresult InsertNode (nsIDOMNode *aTargetNode, nsIDOMNode *aNewNode, Location aLocation, nsIDOMNode **aResNode)
 Insert a node.
nsresult RefreshRepeats (nsCOMArray< nsIDOMNode > *aNodes)

Private Attributes

PRBool mIsInsert
nsCOMArray< nsIXFormsContextInfomContextInfo

Detailed Description

Implementation of the XForms <insert> and <delete> elements.

Definition at line 68 of file nsXFormsInsertDeleteElement.cpp.


Member Enumeration Documentation

Enumerator:
eLocation_After 
eLocation_Before 
eLocation_FirstChild 

Definition at line 73 of file nsXFormsInsertDeleteElement.cpp.


Constructor & Destructor Documentation

Constructor.

Definition at line 109 of file nsXFormsInsertDeleteElement.cpp.

                                                :
    mIsInsert(aIsInsert)
    {}

Member Function Documentation

void nsIXTFElement::attributeSet ( in nsIAtom  name,
in AString  newValue 
) [inherited]

Definition at line 65 of file nsXFormsActionModuleBase.h.

{ return mCanIterate; }

Here is the caller graph for this function:

PRBool nsXFormsActionModuleBase::CanPerformAction ( nsIDOMElement aElement,
PRBool aUsesWhile,
nsIDOMNode aContextNode = nsnull,
PRInt32  aContextSize = 0,
PRInt32  aContextPosition = 0 
) [static, inherited]

Determine whether this action element should be executed, based upon optional if and while attributes.

For each of these attributes that are present on an action element, the action is only performed if the boolean value of the XPath expression contained in the attribute is true. In addition, if the while attribute is used, the action is "executed repeatedly" until one of these attributes evaluates to false. This method indicates to the caller whether the action element uses a while attribute through the usesWhile parameter.

Definition at line 206 of file nsXFormsActionModuleBase.cpp.

{
  *aUsesWhile = PR_FALSE;

  nsAutoString ifExpr;
  nsAutoString whileExpr;
  aElement->GetAttribute(NS_LITERAL_STRING("if"), ifExpr);
  aElement->GetAttribute(NS_LITERAL_STRING("while"), whileExpr);

  if (whileExpr.IsEmpty() && ifExpr.IsEmpty()) {
    return PR_TRUE;
  }

  nsresult rv;
  nsCOMPtr<nsIDOMXPathResult> res;
  PRBool condTrue;

  nsCOMPtr<nsIDOMNode> contextNode;

  if (aContext) {
    contextNode = aContext;
  } else {
    // Determine evaluation context.
    nsCOMPtr<nsIModelElementPrivate> model;
    nsCOMPtr<nsIDOMElement> bindElement;
    nsCOMPtr<nsIXFormsControl> parentControl;
    PRBool outerBind;
    rv = nsXFormsUtils::GetNodeContext(aElement, 0,
                                       getter_AddRefs(model),
                                       getter_AddRefs(bindElement),
                                       &outerBind,
                                       getter_AddRefs(parentControl),
                                       getter_AddRefs(contextNode),
                                       &aContextPosition, &aContextSize, PR_FALSE);
    NS_ENSURE_SUCCESS(rv, PR_FALSE);
  }

  if (!whileExpr.IsEmpty()) {
    *aUsesWhile = PR_TRUE;

    rv = nsXFormsUtils::EvaluateXPath(whileExpr, contextNode, aElement,
                                      nsIDOMXPathResult::BOOLEAN_TYPE,
                                      getter_AddRefs(res),
                                      aContextPosition, aContextSize);
    NS_ENSURE_SUCCESS(rv, PR_FALSE);
    
    rv = res->GetBooleanValue(&condTrue);
    if (NS_FAILED(rv) || !condTrue) {
      return PR_FALSE;
    }
  }

  if (!ifExpr.IsEmpty()) {
    rv = nsXFormsUtils::EvaluateXPath(ifExpr, contextNode, aElement,
                                      nsIDOMXPathResult::BOOLEAN_TYPE,
                                      getter_AddRefs(res),
                                      aContextPosition, aContextSize);
    NS_ENSURE_SUCCESS(rv, PR_FALSE);
    
    rv = res->GetBooleanValue(&condTrue);
    if (NS_FAILED(rv) || !condTrue) {
      return PR_FALSE;
    }
  }

  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIXTFElement::childInserted ( in nsIDOMNode  child,
in unsigned long  index 
) [inherited]
void nsIXTFElement::childRemoved ( in unsigned long  index) [inherited]
void nsIXTFElement::cloneState ( in nsIDOMElement  aElement) [inherited]

Definition at line 122 of file nsXFormsActionModuleBase.cpp.

Here is the call graph for this function:

nsresult nsXFormsActionModuleBase::DoHandleAction ( nsXFormsActionModuleHelper aXFormsAction,
nsIDOMEvent aEvent,
nsIXFormsActionElement aParentAction 
) [static, inherited]

Definition at line 151 of file nsXFormsActionModuleBase.cpp.

{
  nsCOMPtr<nsIDOMElement> element = aXFormsAction->GetElement();
  if (!element) {
    return NS_OK;
  }
  aXFormsAction->SetCurrentEvent(aEvent);

  // Set the maximum run time for the loop (in microseconds).
  PRTime microseconds = nsXFormsUtils::waitLimit * PR_USEC_PER_SEC;

  PRTime runTime = 0, start = PR_Now();

  while (PR_TRUE) {
    // Test the `if` and `while` attributes to determine whether this action
    // can be performed and should be repeated.
    PRBool usesWhile;
    if (!nsXFormsActionModuleBase::CanPerformAction(element, &usesWhile)) {
      return NS_OK;
    }

    nsresult rv = aXFormsAction->HandleSingleAction(aEvent, aParentAction);
    NS_ENSURE_SUCCESS(rv, rv);

    // Repeat this action if it can iterate and if it uses the `while`
    // attribute (the expression of which must have evaluated to true to
    // arrive here).
    if (!aXFormsAction->CanIterate() || !usesWhile) {
      return NS_OK;
    }

    // See if we've exceeded our time limit, and if so, prompt the user to
    // determine if she wants to cancel the loop.
    LL_SUB(runTime, PR_Now(), start);
    if (microseconds <= 0 || runTime < microseconds) {
      continue;
    }

    // The remaining part of the loop prompts the user about cancelling the
    // loop, and is only executed if we've gone over the time limit.
    PRBool stopWaiting = nsXFormsUtils::AskStopWaiting(element);

    if (stopWaiting) {
      // Stop the loop
      return NS_OK;
    } else {
      start = PR_Now();
    }
  }
}

Here is the call graph for this function:

Get the event currently being processed in handleAction.

The XPath event() method uses this method to get the context info for the current event.

virtual nsIDOMElement* nsXFormsActionModuleBase::GetElement ( ) [inline, virtual, inherited]

Implements nsXFormsActionModuleHelper.

Definition at line 111 of file nsXFormsActionModuleBase.h.

{ return mElement; }
nsresult nsXFormsInsertDeleteElement::GetFirstNodeOfType ( nsCOMArray< nsIDOMNode > *  aNodes,
PRUint16  aNodeType,
nsIDOMNode **  aResult 
) [private]

Get the first node of a given type in aNodes.

Parameters:
aNodesarray of nodes
aNodeTypetype of node to find
Returns:
aResult node of type aNodeType

Definition at line 746 of file nsXFormsInsertDeleteElement.cpp.

{
  nsCOMPtr<nsIDOMNode> currentNode;

  for (PRInt32 i = 0; i < aNodes->Count(); ++i) {
    currentNode = aNodes->ObjectAt(i);
    PRUint16 nodeType;
    currentNode->GetNodeType(&nodeType);
    if (nodeType == aNodeType) {
      NS_IF_ADDREF(*aResult = currentNode);
      break;
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Get/Set the repeat state for the xforms control or action.

The repeat state indicates whether the control or action lives inside a context container, a repeat element, an itemset or none of the above.

Definition at line 205 of file nsXFormsStubElement.cpp.

{
  return mRepeatState;
}
void nsIXTFElement::getScriptingInterfaces ( out unsigned long  count,
[array, size_is(count), retval] out nsIIDPtr  array 
) [inherited]

Definition at line 131 of file nsXFormsInsertDeleteElement.cpp.

{
  // Keep element alive while iterating.
  nsCOMPtr<nsIDOMElement> element = mElement;
  if (!element)
    return NS_OK;

  mCurrentEvent = aEvent;

  nsresult rv;

  // Set the maximum run time for the loop (in microseconds).
  PRTime microseconds = nsXFormsUtils::waitLimit * PR_USEC_PER_SEC;
  PRTime runTime = 0, start = PR_Now();
  while (PR_TRUE) {
    //
    // Step 1 (Insert or Delete): Determine the insert/delete context.
    //
    // If the bind attribute is present or if the context attribute is not given,
    // the insert context is the in-scope evaluation context. Otherwise, the
    // XPath expression provided by the context attribute is evaluated using the
    // in-scope evaluation context, and the first node rule is applied to obtain
    // the insert context.
    //
    nsCOMPtr<nsIDOMXPathResult> contextNodeset;
    nsCOMPtr<nsIDOMNode> contextNode;
    PRUint32 contextNodesetSize = 0;
    PRInt32 contextPosition;

    // Get the in-scope evaluation context. The last parameter to GetNodeContext
    // indicates whether it should try to get the context using @bind. We want to
    // ignore @bind because it should not change the in-scope evaluation context
    // for insert.
    nsCOMPtr<nsIModelElementPrivate> model;
    nsCOMPtr<nsIDOMElement> bindElement;
    nsCOMPtr<nsIXFormsControl> parentControl;
    PRBool outerBind;
    rv = nsXFormsUtils::GetNodeContext(element,
                                       nsXFormsUtils::ELEMENT_WITH_MODEL_ATTR,
                                       getter_AddRefs(model),
                                       getter_AddRefs(bindElement),
                                       &outerBind,
                                       getter_AddRefs(parentControl),
                                       getter_AddRefs(contextNode),
                                       &contextPosition,
                                       (PRInt32*)&contextNodesetSize,
                                       PR_FALSE);

    NS_ENSURE_SUCCESS(rv, rv);

    // Determine if the context node is specified via @context.
    // If @bind is present, @context is ignored.
    nsAutoString bindExpr;
    nsAutoString contextExpr;
    element->GetAttribute(NS_LITERAL_STRING("bind"), bindExpr);
    element->GetAttribute(NS_LITERAL_STRING("context"), contextExpr);

    if (bindExpr.IsEmpty() && !contextExpr.IsEmpty()) {
      // @context is specified and overrides the in-scope evaluation context.
      // The insert context is the result of evaluating @context in the current
      // in-scope evaluation context.
      rv = nsXFormsUtils::EvaluateXPath(contextExpr, contextNode, element,
                                        nsIDOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE,
                                        getter_AddRefs(contextNodeset));
      NS_ENSURE_SUCCESS(rv, rv);

      // The insert/delete action is terminated with no effect if the context
      // is the empty node-set.
      if (contextNodeset) {
        rv = contextNodeset->GetSnapshotLength(&contextNodesetSize);
        NS_ENSURE_SUCCESS(rv, rv);
    
        if (contextNodesetSize < 1)
          return NS_OK;
    
        // Context node is the first node in the nodeset.
        contextNodeset->SnapshotItem(0, getter_AddRefs(contextNode));
        contextPosition = 1;
      }
    }

    // The insert/delete action is terminated with no effect if the context
    // is the empty node-set.
    if (!contextNode)
      return NS_OK;

    // The insert action is terminated with no effect if the context attribute
    // is given and the insert context does not evaluate to an element node.
    if (mIsInsert && !contextExpr.IsEmpty()) {
      PRUint16 nodeType;
      contextNode->GetNodeType(&nodeType);
      if (nodeType != nsIDOMNode::ELEMENT_NODE)
        return NS_OK;
    }

    // Test the `if` and `while` attributes to determine whether this action
    // can be performed and should be repeated.  As the insert and delete
    // actions can change their context, we do this testing here instead of
    // relying on the default logic from our parent class' `HandleAction`
    // (or `DoHandleAction`) definition.
    PRBool usesWhile;
    if (!nsXFormsActionModuleBase::CanPerformAction(element, &usesWhile,
                                                    contextNode,
                                                    contextNodesetSize,
                                                    contextPosition)) {
      return NS_OK;
    }
  
    //
    // Step 2 (Insert or Delete): Determine the node-set binding.
    //
    // If the bind attribute is present, it directly determines the Node Set
    // Binding node-set. If a nodeset attribute is present, it is evaluated
    // within the context to determine the Node Set Binding node-set.
    //
    // A NodeSet binding attribute (@bind or @nodeset) is required unless
    // the context attribute is present.
    //
    nsCOMPtr<nsIDOMXPathResult> nodeset;
    PRUint32 nodesetSize = 0;
    nsAutoString nodesetExpr;

    if (bindExpr.IsEmpty()) {
      element->GetAttribute(NS_LITERAL_STRING("nodeset"), nodesetExpr);
      if (!nodesetExpr.IsEmpty()) {
        // Evaluate the nodeset attribute within the insert context.
        rv = nsXFormsUtils::EvaluateXPath(nodesetExpr, contextNode, element,
                                          nsIDOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE,
                                          getter_AddRefs(nodeset));
        NS_ENSURE_SUCCESS(rv, rv);
      }
    } else {
      PRBool usesModelBinding;
      rv = nsXFormsUtils::EvaluateNodeBinding(element,
                                              nsXFormsUtils::ELEMENT_WITH_MODEL_ATTR,
                                              EmptyString(),
                                              EmptyString(),
                                              nsIDOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE,
                                              getter_AddRefs(model),
                                              getter_AddRefs(nodeset),
                                              &usesModelBinding);
      NS_ENSURE_SUCCESS(rv, rv);

      if (!model)
        return NS_OK;
    }

    if (nodeset) {
      rv = nodeset->GetSnapshotLength(&nodesetSize);
      NS_ENSURE_SUCCESS(rv, rv);
    }

    // The insert action is terminated with no effect if the context attribute
    // is not given and the Node Set Binding node-set is the empty node-set.
    //
    // The delete action is terminated with no effect if the Node Set Binding
    // node-set is the empty node-set.
    if (!nodeset || nodesetSize < 1) {
      if (!mIsInsert || (mIsInsert && contextExpr.IsEmpty()))
        return NS_OK;
    }

    //
    // Step 3 (Insert): Determine the origin node-set.
    //
    nsCOMPtr<nsIDOMXPathResult> originNodeset;
    nsCOMPtr<nsIDOMXPathResult> originNode;
    PRUint32 originNodesetSize = 0;

    if (mIsInsert) {
      // If the origin attribute is not given and the Node Set Binding node-set
      // is empty, then the origin node-set is the empty node-set. Otherwise,
      // if the origin attribute is not given, then the origin node-set consists
      // of the last node of the Node Set Binding node-set (which we will obtain
      // just before performing the insert).
      //
      // If the origin attribute is given, the origin node-set is the result of
      // the evaluation of the origin attribute in the insert context.
      nsAutoString origin;
      element->GetAttribute(NS_LITERAL_STRING("origin"), origin);

      if (!origin.IsEmpty()) {
        rv = nsXFormsUtils::EvaluateXPath(origin, contextNode, element,
                                          nsIDOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE,
                                          getter_AddRefs(originNodeset));
        NS_ENSURE_SUCCESS(rv, rv);

        // The insert action is terminated with no effect if the origin node-set
        // is the empty node-set.
        if (!originNodeset)
          return NS_OK;

        rv = originNodeset->GetSnapshotLength(&originNodesetSize);
        NS_ENSURE_SUCCESS(rv, rv);

        // The insert action is terminated with no effect if the origin node-set
        // is the empty node-set.
        if (originNodesetSize < 1)
          return NS_OK;

        // Context Info: 'origin-nodes'
        nsCOMPtr<nsXFormsContextInfo> contextInfo =
          new nsXFormsContextInfo(element);
        NS_ENSURE_TRUE(contextInfo, NS_ERROR_OUT_OF_MEMORY);
        contextInfo->SetNodesetValue("origin-nodes", originNodeset);
        mContextInfo.AppendObject(contextInfo);
      }
    }

    //
    // Step 4 (Insert), Step 3 (Delete):
    // Determine the insert/delete location node.
    //
    // Insert: If the Node Set Binding node-set is not specified or empty, the
    // insert location node is the insert context node. Otherwise, if the at
    // attribute is not given, then the insert location node is the last node
    // of the Node Set Binding node-set. Otherwise, an insert location node is
    // determined from the at attribute.
    //
    // Delete: If the at attribute is not specified, there is no delete location.
    // Otherwise, the delete location is determined by evaluating the XPath
    // expression specified by the at attribute.
    //

    nsCOMPtr<nsIDOMNode> locationNode;
    PRUint32 atInt = 0;
    double atDoub = 0;

    nsAutoString atExpr;
    element->GetAttribute(NS_LITERAL_STRING("at"), atExpr);
          
    if (mIsInsert) {
      if (!nodeset || nodesetSize < 1) {
         // The insert location node is the insert context node.
         locationNode = contextNode;
      } else if (atExpr.IsEmpty()) {
        // The insert location node is the last node of the Node Set Binding
        // node-set.
        nodeset->SnapshotItem(nodesetSize - 1, getter_AddRefs(locationNode));
        NS_ENSURE_STATE(locationNode);
      }
    }

    if (!locationNode) {
      // For insert, we have a nodeset and got past the special cases of an empty
      // nodeset or no @at expression so the insert location node is determined by
      // @at.
      //
      // For delete, the delete location is determined by the @at expression if
      // present; otherwise there is no delete location and each node in the
      // Node Set Binding node-set is deleted, unless the node is the root
      // document element of an instance.
      if (!atExpr.IsEmpty()) {
        // The evaluation context node is the first node in document order of
        // the Node Set Binding node-set.
        nsCOMPtr<nsIDOMNode> evalContextNode;
        nodeset->SnapshotItem(0, getter_AddRefs(evalContextNode));

        // The context size is the size of the Node Set Binding node-set and
        // the context position is 1.
        nsCOMPtr<nsIDOMXPathResult> xpRes;
        rv = nsXFormsUtils::EvaluateXPath(atExpr, evalContextNode, element,
                                          nsIDOMXPathResult::NUMBER_TYPE,
                                          getter_AddRefs(xpRes), 1, nodesetSize);

        if (xpRes) {
          rv = xpRes->GetNumberValue(&atDoub);
          NS_ENSURE_SUCCESS(rv, rv);
        }

        // Determine the insert/delete location.
        if (atDoub < 1) {
          atInt = 1;
        } else {
          // If the location is greater than the nodeset size or NaN,
          // the location is the end of the nodeset.
          // XXX: Need to check for NaN but isnan() is not portable.
          atInt = (PRInt32) floor(atDoub+0.5);
          if (atInt > nodesetSize)
            atInt = nodesetSize;
        }

        // The location node is the node in the Node Set Binding node-set at
        // the position given by the location.
        nodeset->SnapshotItem(atInt - 1, getter_AddRefs(locationNode));
        NS_ENSURE_STATE(locationNode);
      }
    }

    // Context Info: 'insert-location-node' or 'delete-location'
    nsCOMPtr<nsXFormsContextInfo> contextInfo;
    if (mIsInsert) {
      contextInfo = new nsXFormsContextInfo(element);
      NS_ENSURE_TRUE(contextInfo, NS_ERROR_OUT_OF_MEMORY);
      contextInfo->SetNodeValue("insert-location-node", locationNode);
      mContextInfo.AppendObject(contextInfo);
    } else {
      contextInfo = new nsXFormsContextInfo(element);
      NS_ENSURE_TRUE(contextInfo, NS_ERROR_OUT_OF_MEMORY);
      contextInfo->SetNumberValue("delete-location", atInt);
      mContextInfo.AppendObject(contextInfo);
    }

    //
    // Step 5 (Insert): Each node in the origin node-set is cloned in the
    // order it appears in the origin node-set. If the origin node-set is empty
    // (Step 3), the origin node-set consists of the last node of the Node Set
    // Binding node-set.
    //
    // The clones are deep copies of the original nodes except the contents of
    // nodes of type xsd:ID are modified to remain as unique values in the
    // instance data after the clones are inserted.
    //
    // XXX: Need to modify the contents of nodes of type xsd:ID to remain
    // unique.

    nsCOMArray<nsIDOMNode> cloneNodes;
    nsCOMPtr<nsIDOMXPathResult> cloneNodeset;
    PRUint32 cloneNodesetSize = 0;

    if (mIsInsert) {
      nsCOMPtr<nsIDOMNode> prototypeNode, newNode;
      PRUint32 cloneIndex;
      
      // Get prototype node(s) and clone.
      if (originNodesetSize < 1) {
        // Origin nodeset is empty. Clone the last node of nodeset.
        cloneNodeset = nodeset;
        cloneNodesetSize = nodesetSize;
        cloneIndex = nodesetSize - 1;
      } else {
        // Clone all the nodes in the origin node-set.
        cloneNodeset = originNodeset;
        cloneNodesetSize = originNodesetSize;
        cloneIndex = 0;
      }
      // Context Info: 'inserted-nodes'
      nsCOMPtr<nsXFormsContextInfo> contextInfo =
        new nsXFormsContextInfo(element);
      NS_ENSURE_TRUE(contextInfo, NS_ERROR_OUT_OF_MEMORY);
      contextInfo->SetNodesetValue("inserted-nodes", cloneNodeset);
      mContextInfo.AppendObject(contextInfo);

      cloneNodeset->SnapshotItem(cloneIndex, getter_AddRefs(prototypeNode));
      NS_ENSURE_STATE(prototypeNode);

      // The prototypeNode (node to be cloned) and the locationNode (node to
      // which the clone will be inserted) may belong to different instances.
      nsCOMPtr<nsIDOMDocument> originDoc, locationDoc;
      prototypeNode->GetOwnerDocument(getter_AddRefs(originDoc));
      NS_ENSURE_STATE(originDoc);
      locationNode->GetOwnerDocument(getter_AddRefs(locationDoc));
      NS_ENSURE_STATE(locationDoc);

      while ((cloneIndex < cloneNodesetSize) && prototypeNode) {
        if (!SameCOMIdentity(originDoc, locationDoc)) {
          locationDoc->ImportNode(prototypeNode, PR_TRUE, getter_AddRefs(newNode));
        } else {
          prototypeNode->CloneNode(PR_TRUE, getter_AddRefs(newNode));
        }
        NS_ENSURE_STATE(newNode);
        cloneNodes.AppendObject(newNode);

        // Get the next node in the node-set.
        ++cloneIndex;
        cloneNodeset->SnapshotItem(cloneIndex, getter_AddRefs(prototypeNode));
      }
    }

    //
    // Step 6 and 7 (Insert): Determine the target location (Steps 6a-d) and
    // insert all of the nodes that were cloned in Step 5.
    //
    // Step 4 (Delete): Delete the nodes.
    //
    
    nsCOMPtr<nsIDOMDocument> locationDoc;
    nsCOMPtr<nsIDOMElement> locationDocElement;
    nsCOMPtr<nsIDOMNode> parentNode, newNode, resNode, instNode;
    if (mIsInsert) {
      // The cloned node or nodes are inserted in the order they were cloned at
      // their target location depending on their node type.
      nsCOMPtr<nsIDOMNode> newNode;
      
      for (PRInt32 i = 0; i < cloneNodes.Count(); ++i) {
        // Node to be inserted.
        newNode = cloneNodes[i];

        // Get the node type of the insert node and location node.
        PRUint16 newNodeType, locationNodeType;
        newNode->GetNodeType(&newNodeType);
        locationNode->GetNodeType(&locationNodeType);

        // Step 6a - If the Node Set Binding node-set is not specified or empty
        // OR Step 6b - If the Node Set Binding node-set is specified and not
        // empty and the type of the cloned node is different from the type of
        // the insert location node, the target location depends on the node
        // type of the cloned node.
        //
        // If the cloned node is an attribute, then the target location is before
        // the first attribute of the insert location node. If the cloned node is
        // not an attribute, then the target location is before the first child
        // of the insert location node.
        if ((!nodeset || nodesetSize < 1) ||
            (nodeset && nodesetSize > 0 && newNodeType != locationNodeType)) {
          Location location = eLocation_Before;
          nsCOMPtr<nsIDOMNode> targetNode;
          if (newNodeType != nsIDOMNode::ATTRIBUTE_NODE) {
            // Target location is before the first child of location node. If the
            // location node is empty (has no children), it remains the location
            // node and the new node will become the first child of the location
            // node.
            locationNode->GetFirstChild(getter_AddRefs(targetNode));
            if (!targetNode) {
              // New node will become first child of locationNode.
              location = eLocation_FirstChild;
              targetNode = locationNode;
            }
          }
          InsertNode(targetNode, newNode, location, getter_AddRefs(resNode));
        } else {
            // Step 6c - If insert location node is the root element of an
            // instance, then that instance root element location is the target
            // location and the cloned node replaces the instance element. If
            // there is more than one cloned node to insert, only the first node
            // that does not cause a conflict is considered.
            //
            locationNode->GetOwnerDocument(getter_AddRefs(locationDoc));
            NS_ENSURE_STATE(locationDoc);
            locationDoc->GetDocumentElement(getter_AddRefs(locationDocElement));

            if (SameCOMIdentity(locationNode, locationDocElement)) {
              // Step 7 - Replace the instance element with the first element
              // node of the cloned node(s).
              nsCOMPtr<nsIDOMNode> insertNode;
              GetFirstNodeOfType(&cloneNodes, nsIDOMNode::ELEMENT_NODE,
                                 getter_AddRefs(insertNode));
              if (insertNode) {
                nsCOMPtr<nsIDOMNode> child;
                locationDoc->RemoveChild(locationNode, getter_AddRefs(child));
                locationDoc->AppendChild(insertNode, getter_AddRefs(resNode));
                // Done...because we only consider the first node that does
                // not cause a conflict.
                break;
              }
            } else {
              // Step 6d - the target location is immediately before or after the
              // insert location node, based on the position attribute setting or
              // its default.
              PRBool insertAfter = PR_TRUE;
              nsAutoString position;
              element->GetAttribute(NS_LITERAL_STRING("position"), position);
              if (!position.IsEmpty()) {
                if (position.EqualsLiteral("before")) {
                  insertAfter = PR_FALSE;
                } else if (!position.EqualsLiteral("after")) {
                  // This is not a valid document...
                  return NS_ERROR_FAILURE;
                }
              }
              // Context Info: 'position'.
              nsCOMPtr<nsXFormsContextInfo> contextInfo =
                new nsXFormsContextInfo(element);
              NS_ENSURE_TRUE(contextInfo, NS_ERROR_OUT_OF_MEMORY);
              contextInfo->SetStringValue("position", position);
              mContextInfo.AppendObject(contextInfo);

              InsertNode(locationNode, newNode,
                         insertAfter ? eLocation_After: eLocation_Before,
                         getter_AddRefs(resNode));
            }
          }
        }
        rv = nsXFormsUtils::GetInstanceNodeForData(resNode, getter_AddRefs(instNode));
        NS_ENSURE_SUCCESS(rv, rv);

      // Step 8: Set indexes for repeats
      rv = RefreshRepeats(&cloneNodes);
      NS_ENSURE_SUCCESS(rv, rv);

    } else {
      // Delete
      // If there is no delete location, each node in the Node Set Binding
      // node-set is deleted, unless the node is the root document element of an
      // instance.
      //
      // If there is a delete location, the node at the delete location in the
      // Node Set Binding node-set is deleted, unless the node is the root
      // document element of an instance.
      PRBool didDelete = PR_FALSE;

      PRUint32 deleteIndex, deleteCount;

      if (!locationNode) {
        // Delete all the nodes in the node-set.
        deleteIndex = 0;
        deleteCount = nodesetSize;
      } else {
        // Delete the node at the delete location.
        deleteIndex = atInt - 1;
        deleteCount = atInt;
      }
      // Context Info: 'deleted-nodes'
      nsCOMPtr<nsXFormsContextInfo> contextInfo =
        new nsXFormsContextInfo(element);
      NS_ENSURE_TRUE(contextInfo, NS_ERROR_OUT_OF_MEMORY);
      contextInfo->SetNodesetValue("deleted-nodes", nodeset);
      mContextInfo.AppendObject(contextInfo);

      nodeset->SnapshotItem(deleteIndex, getter_AddRefs(locationNode));
      NS_ENSURE_STATE(locationNode);

      locationNode->GetOwnerDocument(getter_AddRefs(locationDoc));
      NS_ENSURE_STATE(locationDoc);

      rv = nsXFormsUtils::GetInstanceNodeForData(locationNode, getter_AddRefs(instNode));
      NS_ENSURE_SUCCESS(rv, rv);

      locationDoc->GetDocumentElement(getter_AddRefs(locationDocElement));
      while ((deleteIndex < deleteCount) && locationNode) {
        // Delete the node(s) unless the delete location is the root document
        // element of an instance.
        PRUint16 locationNodeType;
        locationNode->GetNodeType(&locationNodeType);
        if (locationNodeType == nsIDOMNode::ATTRIBUTE_NODE) {
          nsCOMPtr<nsIDOMElement> ownerElement;
          nsCOMPtr<nsIDOMAttr> attrNode(do_QueryInterface(locationNode));
          attrNode->GetOwnerElement(getter_AddRefs(ownerElement));
          NS_ENSURE_STATE(ownerElement);

          nsCOMPtr<nsIDOMAttr> resAttr;
          ownerElement->RemoveAttributeNode(attrNode, getter_AddRefs(resAttr));
          resNode = locationNode;

          // Deleted at least one node so delete will not terminate.
          didDelete = PR_TRUE;
        } else {
          if (!SameCOMIdentity(locationNode, locationDocElement)) {
            locationNode->GetParentNode(getter_AddRefs(parentNode));
            NS_ENSURE_STATE(parentNode);

            rv = parentNode->RemoveChild(locationNode, getter_AddRefs(resNode));
            NS_ENSURE_SUCCESS(rv, rv);

            // Deleted at least one node so delete will not terminate.
            didDelete = PR_TRUE;
          }
        }
        // Get the next node in the node-set.
        ++deleteIndex;
        nodeset->SnapshotItem(deleteIndex, getter_AddRefs(locationNode));
      }

      // The delete action is terminated with no effect if no node is deleted.
      if (!didDelete)
        return NS_OK;
    }
    NS_ENSURE_STATE(resNode);

    // Dispatch xforms-insert/delete event to the instance node we have modified
    // data for
    rv = nsXFormsUtils::DispatchEvent(instNode,
                                      mIsInsert ? eEvent_Insert : eEvent_Delete,
                                      nsnull, nsnull, &mContextInfo);
    NS_ENSURE_SUCCESS(rv, rv);

    // Dispatch refreshing events to the model
    if (aParentAction) {
      aParentAction->SetRebuild(model, PR_TRUE);
      aParentAction->SetRecalculate(model, PR_TRUE);
      aParentAction->SetRevalidate(model, PR_TRUE);
      aParentAction->SetRefresh(model, PR_TRUE);
    } else {
      rv = model->RequestRebuild();
      NS_ENSURE_SUCCESS(rv, rv);
      rv = model->RequestRecalculate();
      NS_ENSURE_SUCCESS(rv, rv);
      rv = model->RequestRevalidate();
      NS_ENSURE_SUCCESS(rv, rv);
      rv = model->RequestRefresh();
      NS_ENSURE_SUCCESS(rv, rv);
    }

    // Repeat this action if it can iterate and if it uses the `while`
    // attribute (the expression of which must have evaluated to true to
    // arrive here).
    if (!CanIterate() || !usesWhile) {
      return NS_OK;
    }

    // See if we've exceeded our time limit, and if so, prompt the user to
    // determine if she wants to cancel the loop.
    LL_SUB(runTime, PR_Now(), start);
    if (microseconds <= 0 || runTime < microseconds) {
      continue;
    }

    // The remaining part of the loop prompts the user about cancelling the
    // loop, and is only executed if we've gone over the time limit.
    PRBool stopWaiting = nsXFormsUtils::AskStopWaiting(element);

    if (stopWaiting) {
      // Stop the loop
      return NS_OK;
    } else {
      start = PR_Now();
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Parameters:
evtThe Event contains contextual information about the event. It also contains the stopPropagation and preventDefault methods which are used in determining the event's flow and default action.
nsresult nsXFormsInsertDeleteElement::HandleSingleAction ( nsIDOMEvent aEvent,
nsIXFormsActionElement aParentAction 
) [inline, virtual]

Normally, an action element implements the body of its action handler using this method; however, since an nsXFormsInsertDeleteElement sets up additional context before evaluating if and while, it overrides the HandleAction method instead to get full control over the execution of its action.

Implements nsXFormsActionModuleHelper.

Definition at line 123 of file nsXFormsInsertDeleteElement.cpp.

  {
    return NS_OK;
  }
nsresult nsXFormsInsertDeleteElement::InsertNode ( nsIDOMNode aTargetNode,
nsIDOMNode aNewNode,
Location  aLocation,
nsIDOMNode **  aResNode 
) [private]

Insert a node.

Parameters:
aTargetNodetarget location node
aNewNodenode to insert
aLocationinsert location relative to target
Returns:
aResult result node

Definition at line 766 of file nsXFormsInsertDeleteElement.cpp.

{
  NS_ENSURE_ARG(aTargetNode);
  NS_ENSURE_ARG(aNewNode);
  NS_ENSURE_ARG_POINTER(aResNode);

  // Make sure the result node is null in case we encounter a condition
  // where the node cannot be inserted and is skipped.
  *aResNode = nsnull;

  // Step 7 - The new node is inserted at the target location depending on its
  // node type. If the cloned node is a duplicate of another attribute in its
  // parent element, then the duplicate attribute is first removed. If a cloned
  // node cannot be placed at the target location due to a node type conflict,
  // then the insertion for that particular clone node is ignored.
  nsCOMPtr<nsIDOMNode> resNode;
  
  PRUint16 targetNodeType, newNodeType;
  aTargetNode->GetNodeType(&targetNodeType);
  aNewNode->GetNodeType(&newNodeType);
  
  if (newNodeType == nsIDOMNode::ATTRIBUTE_NODE) {
    // Can add an attribute to an element node or the owning element
    // of an attribute node.
    nsCOMPtr<nsIDOMElement> ownerElement;

    if (targetNodeType == nsIDOMNode::ELEMENT_NODE) {
      ownerElement = do_QueryInterface(aTargetNode);
    } else if (targetNodeType == nsIDOMNode::ATTRIBUTE_NODE) {
      nsCOMPtr<nsIDOMAttr> targetAttrNode(do_QueryInterface(aTargetNode));
      targetAttrNode->GetOwnerElement(getter_AddRefs(ownerElement));
    }
    NS_ENSURE_STATE(ownerElement);

    // Check for a duplicate attribute.
    nsAutoString attrNamespace, attrName, attrValue;
    aNewNode->GetNamespaceURI(attrNamespace);
    aNewNode->GetLocalName(attrName);
    aNewNode->GetNodeValue(attrValue);

    PRBool hasAttribute = PR_FALSE;
    ownerElement->HasAttributeNS(attrNamespace, attrName, &hasAttribute);
    if (hasAttribute) {
      ownerElement->RemoveAttributeNS(attrNamespace, attrName);
    }
    ownerElement->SetAttributeNS(attrNamespace, attrName, attrValue);
    resNode = aTargetNode;
    resNode.swap(*aResNode);

  } else {
    // New node will be inserted at location aLocation.
    nsCOMPtr<nsIDOMNode> targetNode = aTargetNode;

    nsCOMPtr<nsIDOMNode> parentNode;
    targetNode->GetParentNode(getter_AddRefs(parentNode));
    NS_ENSURE_STATE(parentNode);

    if (aLocation == eLocation_FirstChild) {
      aTargetNode->AppendChild(aNewNode, getter_AddRefs(resNode));
      resNode.swap(*aResNode);
    } else {
      if (aLocation == eLocation_After) {
        // If we're at the end of the nodeset, this returns nsnull, which is
        // fine, because InsertBefore then inserts at the end of the nodeset.
        aTargetNode->GetNextSibling(getter_AddRefs(targetNode));
      }
      parentNode->InsertBefore(aNewNode, targetNode,
                               getter_AddRefs(resNode));
      resNode.swap(*aResNode);
    }
  }
  
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 93 of file nsXFormsActionModuleBase.cpp.

{
  mElement = nsnull;
  return NS_OK;
}

Definition at line 107 of file nsXFormsActionModuleBase.cpp.

{
  nsXFormsStubElement::ParentChanged(aNewParent);
  UpdateRepeatState(aNewParent);
  return NS_OK;
}

Here is the call graph for this function:

void nsIXTFElement::parentChanged ( in nsIDOMElement  newParent) [inherited]

Definition at line 845 of file nsXFormsInsertDeleteElement.cpp.

{
  // XXXbeaufour: only check repeats belonging to the same model...
  // possibly use mFormControls? Should be quicker than searching through
  // entire document!! mModel->GetControls("repeat"); Would also possibly
  // save a QI?

  nsCOMPtr<nsIDOMDocument> document;

  nsresult rv = mElement->GetOwnerDocument(getter_AddRefs(document));
  NS_ENSURE_STATE(document);

  nsCOMPtr<nsIDOMNodeList> repeatNodes;
  document->GetElementsByTagNameNS(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS),
                                   NS_LITERAL_STRING("repeat"),
                                   getter_AddRefs(repeatNodes));
  NS_ENSURE_STATE(repeatNodes);

  // work over each node and if the node contains the inserted element
  PRUint32 nodeCount;
  rv = repeatNodes->GetLength(&nodeCount);
  NS_ENSURE_SUCCESS(rv, rv);

  for (PRUint32 node = 0; node < nodeCount; ++node) {
    nsCOMPtr<nsIDOMNode> repeatNode;

    rv = repeatNodes->Item(node, getter_AddRefs(repeatNode));
    nsCOMPtr<nsIXFormsRepeatElement> repeatEl(do_QueryInterface(repeatNode));
    NS_ENSURE_STATE(repeatEl);

    for (PRInt32 i = 0; i < aNodes->Count(); ++i) {
      nsCOMPtr<nsIDOMNode> newNode = aNodes->ObjectAt(i);
      rv = repeatEl->HandleNodeInsert(newNode);
      NS_ENSURE_SUCCESS(rv, rv);
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 66 of file nsXFormsActionModuleBase.h.

{ mCurrentEvent = aEvent; }

Here is the caller graph for this function:

void nsXFormsStubElement::SetRepeatState ( nsRepeatState  aState) [virtual, inherited]

Definition at line 211 of file nsXFormsStubElement.cpp.

{
  mRepeatState = aState;
  return;
}

Here is the caller graph for this function:

nsRepeatState nsXFormsStubElement::UpdateRepeatState ( nsIDOMNode aParent) [protected, virtual, inherited]

This is processed when an XForms control or XForms action has been inserted under a parent node AND has been inserted into a document.

It checks the ancestors of the element and returns an nsRepeatState depending on the element's place in the document.

Parameters:
aParentThe new parent of the XForms control

Definition at line 218 of file nsXFormsStubElement.cpp.

{
  // Walk up the parent chain looking to see if the this control is contained
  // in an item.  If it is and that item is contained in a itemset, then we
  // know that this control was generated as a clone from the itemset's
  // template.  Similarly, we'll check to see if this control lives in a
  // contextcontainer (meaning it was cloned from a repeat's template).
  // Otherwise, if neither of these are the case but it lives under a repeat
  // or an itemset, then this control must be part of a template.  A template
  // is the content of a repeat or itemset that gets cloned once for every
  // node in the bound nodeset.
  //
  // If none of this applies, we'll return eType_NotApplicable to show that this
  // control isn't bound to a repeating nodeset.
  nsRepeatState repeatState = eType_NotApplicable;

  if (!mHasDoc || !mHasParent) {
    // If we don't have a document or a parent, none of these tests will work
    // correctly so no sense doing them now.  If either of these are false the
    // repeat state for the object should already be eType_Unknown so just
    // return that now.
    return eType_Unknown;
  }

  nsCOMPtr<nsIDOMNode> parent = aParent;
  PRBool childIsItem = PR_FALSE;
  while (parent) {
    if (nsXFormsUtils::IsXFormsElement(parent,
                                       NS_LITERAL_STRING("contextcontainer"))) {
      repeatState = eType_GeneratedContent;
      break;
    }
    if (nsXFormsUtils::IsXFormsElement(parent, NS_LITERAL_STRING("repeat"))) {
      repeatState = eType_Template;
      break;
    }
    if (nsXFormsUtils::IsXFormsElement(parent, NS_LITERAL_STRING("itemset"))) {
      if (childIsItem) {
        repeatState = eType_GeneratedContent;
        break;
      }
      repeatState = eType_Template;
      break;
    }

    if (nsXFormsUtils::IsXFormsElement(parent, NS_LITERAL_STRING("item"))) {
      childIsItem = PR_TRUE;
    } else {

      nsCOMPtr<nsIDOMElement> parentEle(do_QueryInterface(parent));
      if (!parentEle) {
        // I don't know how this can possibly happen, but if it does I guess
        // we should just ignore it and coninue on our way.
        break;
      }

      // if this control is contained underneath an element that contains
      // an xforms binding attribute that introduces an anonymous xf:repeat
      // then the control is part of a template
      PRBool repeatAttr = PR_FALSE;
      parentEle->HasAttributeNS(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS),
                                NS_LITERAL_STRING("repeat-bind"),
                                &repeatAttr);
      if (repeatAttr) {
        repeatState = eType_Template;
        break;
      }

      parentEle->HasAttributeNS(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS),
                                NS_LITERAL_STRING("repeat-nodeset"),
                                &repeatAttr);
      if (repeatAttr) {
        repeatState = eType_Template;
        break;
      }
    }
    nsCOMPtr<nsIDOMNode> tmp;
    parent->GetParentNode(getter_AddRefs(tmp));
    parent = tmp;
  }

  SetRepeatState(repeatState);
  return repeatState;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 115 of file nsXFormsActionModuleBase.cpp.

Here is the call graph for this function:

Definition at line 100 of file nsXFormsActionModuleBase.cpp.

Here is the call graph for this function:

void nsIXTFElement::willInsertChild ( in nsIDOMNode  child,
in unsigned long  index 
) [inherited]
void nsIXTFElement::willRemoveChild ( in unsigned long  index) [inherited]
void nsIXTFElement::willSetAttribute ( in nsIAtom  name,
in AString  newValue 
) [inherited]

Member Data Documentation

Definition at line 72 of file nsIXTFElement.idl.

Definition at line 56 of file nsIXTFElement.idl.

Definition at line 60 of file nsIXTFElement.idl.

Definition at line 64 of file nsIXTFElement.idl.

Definition at line 68 of file nsIXTFElement.idl.

readonly attribute unsigned long nsIXTFElement::elementType [inherited]

Definition at line 78 of file nsIXTFElement.idl.

Definition at line 86 of file nsIXTFElement.idl.

This signals whether or not this action can iterate.

Technically, all XForms 1.1 actions are allowed to iterate, but for some of them it may not make sense. Currently, this is set to PR_TRUE for all actions, but we can optionally disable iteration for specific actions based upon additional information in the future.

Definition at line 85 of file nsXFormsActionModuleBase.h.

Definition at line 80 of file nsXFormsInsertDeleteElement.cpp.

The event currently being processed.

Definition at line 90 of file nsXFormsActionModuleBase.h.

Definition at line 132 of file nsXFormsActionModuleBase.h.

State that tells whether control has a document or not.

This could be false even if the control has a document. Just means that the element doesn't need to track whether it has a document or not (i.e. xf:choices)

Definition at line 109 of file nsXFormsStubElement.h.

State that tells whether control has a parent or not.

This could be false even if the control has a parent. Just means that the element doesn't need to track whether it has a parent or not (i.e. xf:choices)

Definition at line 102 of file nsXFormsStubElement.h.

Definition at line 71 of file nsXFormsInsertDeleteElement.cpp.

Definition at line 95 of file nsXFormsStubElement.h.

const unsigned long nsIXTFElement::NOTIFY_ATTRIBUTE_REMOVED = 0x00002000 [inherited]

Definition at line 118 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_ATTRIBUTE_SET = 0x00000800 [inherited]

Definition at line 115 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_BEGIN_ADDING_CHILDREN = 0x00004000 [inherited]

Definition at line 120 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_CHILD_APPENDED = 0x00000080 [inherited]

Definition at line 109 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_CHILD_INSERTED = 0x00000020 [inherited]

Definition at line 106 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_CHILD_REMOVED = 0x00000200 [inherited]

Definition at line 112 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_DOCUMENT_CHANGED = 0x00000002 [inherited]

Definition at line 100 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_DONE_ADDING_CHILDREN = 0x00008000 [inherited]

Definition at line 121 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_HANDLE_DEFAULT = 0x00010000 [inherited]

Definition at line 123 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_PARENT_CHANGED = 0x00000008 [inherited]

Definition at line 103 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_APPEND_CHILD = 0x00000040 [inherited]

Definition at line 108 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_CHANGE_DOCUMENT = 0x00000001 [inherited]

Definition at line 99 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_CHANGE_PARENT = 0x00000004 [inherited]

Definition at line 102 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_INSERT_CHILD = 0x00000010 [inherited]

Definition at line 105 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_REMOVE_ATTRIBUTE = 0x00001000 [inherited]

Definition at line 117 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_REMOVE_CHILD = 0x00000100 [inherited]

Definition at line 111 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_SET_ATTRIBUTE = 0x00000400 [inherited]

Definition at line 114 of file nsIXTFElement.idl.


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