Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsHTMLFormElement.cpp File Reference
#include "nsCOMPtr.h"
#include "nsIForm.h"
#include "nsIFormControl.h"
#include "nsIFormSubmission.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMNSHTMLFormElement.h"
#include "nsIHTMLDocument.h"
#include "nsIDOMNSHTMLFormControlList.h"
#include "nsIDOMEventReceiver.h"
#include "nsGenericHTMLElement.h"
#include "nsEventStateManager.h"
#include "nsHTMLAtoms.h"
#include "nsStyleConsts.h"
#include "nsPresContext.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsIFrame.h"
#include "nsIFormControlFrame.h"
#include "nsIScriptGlobalObject.h"
#include "nsDOMError.h"
#include "nsContentUtils.h"
#include "nsInterfaceHashtable.h"
#include "nsContentList.h"
#include "nsGUIEvent.h"
#include "nsSupportsArray.h"
#include "nsIFormSubmitObserver.h"
#include "nsIURI.h"
#include "nsIObserverService.h"
#include "nsICategoryManager.h"
#include "nsCategoryManagerUtils.h"
#include "nsISimpleEnumerator.h"
#include "nsIDOMWindowInternal.h"
#include "nsPIDOMWindow.h"
#include "nsRange.h"
#include "nsIScriptSecurityManager.h"
#include "nsNetUtil.h"
#include "nsIWebProgress.h"
#include "nsIDocShell.h"
#include "nsIWebProgressListener.h"
#include "nsWeakReference.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIRadioControlElement.h"
#include "nsIRadioVisitor.h"
#include "nsIRadioGroupContainer.h"
#include "nsLayoutUtils.h"

Go to the source code of this file.

Classes

class  nsHTMLFormElement
class  nsFormControlList
class  nsFormControlEnumerator

Defines

#define NS_ENSURE_SUBMIT_SUCCESS(rv)

Functions

static PRBool ShouldBeInElements (nsIFormControl *aFormControl)
nsGenericHTMLElementNS_NewHTMLFormElement (nsINodeInfo *aNodeInfo, PRBool aFromParser)
static PRInt32 CompareFormControlPosition (nsIFormControl *control1, nsIFormControl *control2)

Variables

static const int NS_FORM_CONTROL_LIST_HASHTABLE_SIZE = 16
static const nsAttrValue::EnumTable kFormMethodTable []
static const nsAttrValue::EnumTable kFormEnctypeTable []

Define Documentation

Value:
if (NS_FAILED(rv)) {                                                        \
    ForgetCurrentSubmission();                                                \
    return rv;                                                                \
  }

Definition at line 808 of file nsHTMLFormElement.cpp.


Function Documentation

static PRInt32 CompareFormControlPosition ( nsIFormControl control1,
nsIFormControl control2 
) [static]

Definition at line 1159 of file nsHTMLFormElement.cpp.

{
  nsCOMPtr<nsIContent> content1 = do_QueryInterface(control1);
  nsCOMPtr<nsIContent> content2 = do_QueryInterface(control2);

  NS_ASSERTION(content1 && content2, "We should be able to QI to nsIContent here!");

  // We check that the parent of both content nodes is non-null here, because
  // newly created form control elements may not be in the parent form
  // element's DOM tree yet. This prevents an assertion in CompareTreePosition.
  // See Bug 267511 for more information.
  if (content1 && content2 && content1->GetParent() && content2->GetParent())
    return nsLayoutUtils::CompareTreePosition(content1, content2);
  
  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsGenericHTMLElement* NS_NewHTMLFormElement ( nsINodeInfo aNodeInfo,
PRBool  aFromParser 
)

Definition at line 419 of file nsHTMLFormElement.cpp.

{
  nsHTMLFormElement* it = new nsHTMLFormElement(aNodeInfo);
  if (!it) {
    return nsnull;
  }

  nsresult rv = it->Init();

  if (NS_FAILED(rv)) {
    delete it;
    return nsnull;
  }

  return it;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool ShouldBeInElements ( nsIFormControl aFormControl) [static]

Definition at line 377 of file nsHTMLFormElement.cpp.

{
  // For backwards compatibility (with 4.x and IE) we must not add
  // <input type=image> elements to the list of form controls in a
  // form.

  switch (aFormControl->GetType()) {
  case NS_FORM_BUTTON_BUTTON :
  case NS_FORM_BUTTON_RESET :
  case NS_FORM_BUTTON_SUBMIT :
  case NS_FORM_INPUT_BUTTON :
  case NS_FORM_INPUT_CHECKBOX :
  case NS_FORM_INPUT_FILE :
  case NS_FORM_INPUT_HIDDEN :
  case NS_FORM_INPUT_RESET :
  case NS_FORM_INPUT_PASSWORD :
  case NS_FORM_INPUT_RADIO :
  case NS_FORM_INPUT_SUBMIT :
  case NS_FORM_INPUT_TEXT :
  case NS_FORM_SELECT :
  case NS_FORM_TEXTAREA :
  case NS_FORM_FIELDSET :
  case NS_FORM_OBJECT :
    return PR_TRUE;
  }

  // These form control types are not supposed to end up in the
  // form.elements array
  //
  // NS_FORM_INPUT_IMAGE
  // NS_FORM_LABEL
  // NS_FORM_OPTION
  // NS_FORM_OPTGROUP
  // NS_FORM_LEGEND

  return PR_FALSE;
}

Here is the caller graph for this function:


Variable Documentation

Initial value:
 {
  { "multipart/form-data", NS_FORM_ENCTYPE_MULTIPART },
  { "application/x-www-form-urlencoded", NS_FORM_ENCTYPE_URLENCODED },
  { "text/plain", NS_FORM_ENCTYPE_TEXTPLAIN },
  { 0 }
}

Definition at line 625 of file nsHTMLFormElement.cpp.

Initial value:
 {
  { "get", NS_FORM_METHOD_GET },
  { "post", NS_FORM_METHOD_POST },
  { 0 }
}

Definition at line 619 of file nsHTMLFormElement.cpp.

Definition at line 88 of file nsHTMLFormElement.cpp.