Skip to content

Commit

Permalink
Bug 600813 - Removing PUT and DELETE form methods. a=blocking-b7
Browse files Browse the repository at this point in the history
  • Loading branch information
mounirlamouri committed Sep 30, 2010
1 parent a013a3e commit a94d43b
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 531 deletions.
6 changes: 2 additions & 4 deletions content/html/content/public/nsIForm.h
Expand Up @@ -44,10 +44,8 @@ class nsIFormControl;
class nsISimpleEnumerator;
class nsIURI;

#define NS_FORM_METHOD_GET 0
#define NS_FORM_METHOD_POST 1
#define NS_FORM_METHOD_PUT 2
#define NS_FORM_METHOD_DELETE 3
#define NS_FORM_METHOD_GET 0
#define NS_FORM_METHOD_POST 1
#define NS_FORM_ENCTYPE_URLENCODED 0
#define NS_FORM_ENCTYPE_MULTIPART 1
#define NS_FORM_ENCTYPE_TEXTPLAIN 2
Expand Down
6 changes: 2 additions & 4 deletions content/html/content/src/nsFormSubmissionConstants.h
Expand Up @@ -39,10 +39,8 @@
#define nsFormSubmissionConstants_h__

static const nsAttrValue::EnumTable kFormMethodTable[] = {
{ "get", NS_FORM_METHOD_GET },
{ "post", NS_FORM_METHOD_POST },
{ "put", NS_FORM_METHOD_PUT },
{ "delete", NS_FORM_METHOD_DELETE },
{ "get", NS_FORM_METHOD_GET },
{ "post", NS_FORM_METHOD_POST },
{ 0 }
};
// Default method is 'get'.
Expand Down
26 changes: 13 additions & 13 deletions content/html/content/src/nsGenericHTMLElement.h
Expand Up @@ -508,19 +508,6 @@ class nsGenericHTMLElement : public nsGenericHTMLElementBase
*/
NS_HIDDEN_(nsresult) GetURIAttr(nsIAtom* aAttr, nsIAtom* aBaseAttr, nsAString& aResult);

/**
* Helper method for NS_IMPL_ENUM_ATTR_DEFAULT_VALUE.
* Gets the enum value string of an attribute and using a default value if
* the attribute is missing or the string is an invalid enum value.
*
* @param aType the name of the attribute.
* @param aDefault the default value if the attribute is missing or invalid.
* @param aResult string corresponding to the value [out].
*/
NS_HIDDEN_(nsresult) GetEnumAttr(nsIAtom* aAttr,
const char* aDefault,
nsAString& aResult);

protected:
/**
* Add/remove this element to the documents name cache
Expand Down Expand Up @@ -707,6 +694,19 @@ class nsGenericHTMLElement : public nsGenericHTMLElementBase
*/
NS_HIDDEN_(nsresult) GetURIListAttr(nsIAtom* aAttr, nsAString& aResult);

/**
* Helper method for NS_IMPL_ENUM_ATTR_DEFAULT_VALUE.
* Gets the enum value string of an attribute and using a default value if
* the attribute is missing or the string is an invalid enum value.
*
* @param aType the name of the attribute.
* @param aDefault the default value if the attribute is missing or invalid.
* @param aResult string corresponding to the value [out].
*/
NS_HIDDEN_(nsresult) GetEnumAttr(nsIAtom* aAttr,
const char* aDefault,
nsAString& aResult);

/**
* Locates the nsIEditor associated with this node. In general this is
* equivalent to GetEditorInternal(), but for designmode or contenteditable,
Expand Down
16 changes: 1 addition & 15 deletions content/html/content/src/nsHTMLFormElement.cpp
Expand Up @@ -878,25 +878,11 @@ nsHTMLFormElement::SubmitSubmission(nsFormSubmission* aFormSubmission)
getter_AddRefs(postDataStream));
NS_ENSURE_SUBMIT_SUCCESS(rv);

nsAutoString method;
if (originatingElement &&
originatingElement->HasAttr(kNameSpaceID_None,
nsGkAtoms::formmethod)) {
if (!originatingElement->IsHTML()) {
return NS_ERROR_UNEXPECTED;
}
static_cast<nsGenericHTMLElement*>(originatingElement)->
GetEnumAttr(nsGkAtoms::formmethod, kFormDefaultMethod->tag, method);
} else {
GetEnumAttr(nsGkAtoms::method, kFormDefaultMethod->tag, method);
}

rv = linkHandler->OnLinkClickSync(this, actionURI,
target.get(),
postDataStream, nsnull,
getter_AddRefs(docShell),
getter_AddRefs(mSubmittingRequest),
NS_LossyConvertUTF16toASCII(method).get());
getter_AddRefs(mSubmittingRequest));
NS_ENSURE_SUBMIT_SUCCESS(rv);
}

Expand Down
8 changes: 0 additions & 8 deletions content/html/content/test/583288_redirect_server.sjs

This file was deleted.

5 changes: 0 additions & 5 deletions content/html/content/test/583288_submit_server.sjs

This file was deleted.

5 changes: 0 additions & 5 deletions content/html/content/test/Makefile.in
Expand Up @@ -212,11 +212,6 @@ _TEST_FILES = \
test_bug590353-1.html \
test_bug590353-2.html \
test_bug593689.html \
test_bug583288-1.html \
test_bug583288-2.html \
test_bug583288-3.html \
583288_submit_server.sjs \
583288_redirect_server.sjs \
$(NULL)

libs:: $(_TEST_FILES)
Expand Down
143 changes: 0 additions & 143 deletions content/html/content/test/test_bug583288-1.html

This file was deleted.

99 changes: 0 additions & 99 deletions content/html/content/test/test_bug583288-2.html

This file was deleted.

0 comments on commit a94d43b

Please sign in to comment.