mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1279860
- part 1 - Renaming nsFormSubmission to mozilla::dom::HTMLFormSubmission, r=smaug
--HG-- rename : dom/html/nsFormSubmission.cpp => dom/html/HTMLFormSubmission.cpp rename : dom/html/nsFormSubmission.h => dom/html/HTMLFormSubmission.h rename : dom/html/nsFormSubmissionConstants.h => dom/html/HTMLFormSubmissionConstants.h
This commit is contained in:
parent
815f65343a
commit
aadce059f5
@ -16,7 +16,7 @@ using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
FormData::FormData(nsISupports* aOwner)
|
||||
: nsFormSubmission(NS_LITERAL_CSTRING("UTF-8"), nullptr)
|
||||
: HTMLFormSubmission(NS_LITERAL_CSTRING("UTF-8"), nullptr)
|
||||
, mOwner(aOwner)
|
||||
{
|
||||
}
|
||||
@ -99,7 +99,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FormData)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// nsFormSubmission
|
||||
// HTMLFormSubmission
|
||||
nsresult
|
||||
FormData::GetEncodedSubmission(nsIURI* aURI,
|
||||
nsIInputStream** aPostDataStream)
|
||||
|
@ -10,11 +10,11 @@
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "mozilla/dom/HTMLFormSubmission.h"
|
||||
#include "mozilla/dom/File.h"
|
||||
#include "mozilla/dom/FormDataBinding.h"
|
||||
#include "nsIDOMFormData.h"
|
||||
#include "nsIXMLHttpRequest.h"
|
||||
#include "nsFormSubmission.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
@ -26,7 +26,7 @@ class GlobalObject;
|
||||
|
||||
class FormData final : public nsIDOMFormData,
|
||||
public nsIXHRSendable,
|
||||
public nsFormSubmission,
|
||||
public HTMLFormSubmission,
|
||||
public nsWrapperCache
|
||||
{
|
||||
private:
|
||||
@ -104,7 +104,7 @@ public:
|
||||
|
||||
const OwningBlobOrUSVString& GetValueAtIndex(uint32_t aIndex) const;
|
||||
|
||||
// nsFormSubmission
|
||||
// HTMLFormSubmission
|
||||
virtual nsresult
|
||||
GetEncodedSubmission(nsIURI* aURI, nsIInputStream** aPostDataStream) override;
|
||||
|
||||
|
@ -6,7 +6,9 @@
|
||||
|
||||
#include "mozilla/dom/HTMLButtonElement.h"
|
||||
|
||||
#include "HTMLFormSubmissionConstants.h"
|
||||
#include "mozilla/dom/HTMLButtonElementBinding.h"
|
||||
#include "mozilla/dom/HTMLFormSubmission.h"
|
||||
#include "nsIDOMHTMLFormElement.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsGkAtoms.h"
|
||||
@ -14,9 +16,6 @@
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "nsIForm.h"
|
||||
#include "nsFormSubmission.h"
|
||||
#include "nsFormSubmissionConstants.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIFormControlFrame.h"
|
||||
@ -440,7 +439,7 @@ HTMLButtonElement::Reset()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLButtonElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
|
||||
HTMLButtonElement::SubmitNamesValues(HTMLFormSubmission* aFormSubmission)
|
||||
{
|
||||
//
|
||||
// We only submit if we were the button pressed
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
// overriden nsIFormControl methods
|
||||
NS_IMETHOD_(uint32_t) GetType() const override { return mType; }
|
||||
NS_IMETHOD Reset() override;
|
||||
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) override;
|
||||
NS_IMETHOD SubmitNamesValues(HTMLFormSubmission* aFormSubmission) override;
|
||||
NS_IMETHOD SaveState() override;
|
||||
bool RestoreState(nsPresState* aState) override;
|
||||
virtual bool IsDisabledForEvents(EventMessage aMessage) override;
|
||||
|
@ -154,7 +154,7 @@ HTMLFieldSetElement::Reset()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLFieldSetElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
|
||||
HTMLFieldSetElement::SubmitNamesValues(HTMLFormSubmission* aFormSubmission)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
// nsIFormControl
|
||||
NS_IMETHOD_(uint32_t) GetType() const override { return NS_FORM_FIELDSET; }
|
||||
NS_IMETHOD Reset() override;
|
||||
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) override;
|
||||
NS_IMETHOD SubmitNamesValues(HTMLFormSubmission* aFormSubmission) override;
|
||||
virtual bool IsDisabledForEvents(EventMessage aMessage) override;
|
||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
// form submission
|
||||
#include "HTMLFormSubmissionConstants.h"
|
||||
#include "mozilla/dom/FormData.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsIFormSubmitObserver.h"
|
||||
@ -50,7 +51,6 @@
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsIWebProgress.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsFormSubmissionConstants.h"
|
||||
#include "nsIPrompt.h"
|
||||
#include "nsISecurityUITelemetry.h"
|
||||
#include "nsIStringBundle.h"
|
||||
@ -644,7 +644,7 @@ HTMLFormElement::DoSubmit(WidgetEvent* aEvent)
|
||||
mIsSubmitting = true;
|
||||
NS_ASSERTION(!mWebProgress && !mSubmittingRequest, "Web progress / submitting request should not exist here!");
|
||||
|
||||
nsAutoPtr<nsFormSubmission> submission;
|
||||
nsAutoPtr<HTMLFormSubmission> submission;
|
||||
|
||||
//
|
||||
// prepare the submission object
|
||||
@ -684,7 +684,7 @@ HTMLFormElement::DoSubmit(WidgetEvent* aEvent)
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLFormElement::BuildSubmission(nsFormSubmission** aFormSubmission,
|
||||
HTMLFormElement::BuildSubmission(HTMLFormSubmission** aFormSubmission,
|
||||
WidgetEvent* aEvent)
|
||||
{
|
||||
NS_ASSERTION(!mPendingSubmission, "tried to build two submissions!");
|
||||
@ -722,7 +722,7 @@ HTMLFormElement::BuildSubmission(nsFormSubmission** aFormSubmission,
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLFormElement::SubmitSubmission(nsFormSubmission* aFormSubmission)
|
||||
HTMLFormElement::SubmitSubmission(HTMLFormSubmission* aFormSubmission)
|
||||
{
|
||||
nsresult rv;
|
||||
nsIContent* originatingElement = aFormSubmission->GetOriginatingElement();
|
||||
@ -1033,7 +1033,7 @@ HTMLFormElement::NotifySubmitObservers(nsIURI* aActionURL,
|
||||
|
||||
|
||||
nsresult
|
||||
HTMLFormElement::WalkFormElements(nsFormSubmission* aFormSubmission)
|
||||
HTMLFormElement::WalkFormElements(HTMLFormSubmission* aFormSubmission)
|
||||
{
|
||||
nsTArray<nsGenericHTMLFormElement*> sortedControls;
|
||||
nsresult rv = mControls->GetSortedControls(sortedControls);
|
||||
@ -1609,7 +1609,7 @@ HTMLFormElement::FlushPendingSubmission()
|
||||
if (mPendingSubmission) {
|
||||
// Transfer owning reference so that the submissioin doesn't get deleted
|
||||
// if we reenter
|
||||
nsAutoPtr<nsFormSubmission> submission = Move(mPendingSubmission);
|
||||
nsAutoPtr<HTMLFormSubmission> submission = Move(mPendingSubmission);
|
||||
|
||||
SubmitSubmission(submission);
|
||||
}
|
||||
|
@ -9,11 +9,11 @@
|
||||
|
||||
#include "mozilla/AsyncEventDispatcher.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/HTMLFormSubmission.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIForm.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "nsFormSubmission.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIDOMHTMLFormElement.h"
|
||||
#include "nsIWebProgressListener.h"
|
||||
@ -283,7 +283,7 @@ public:
|
||||
*
|
||||
* @param aFormSubmission the form submission object
|
||||
*/
|
||||
nsresult WalkFormElements(nsFormSubmission* aFormSubmission);
|
||||
nsresult WalkFormElements(HTMLFormSubmission* aFormSubmission);
|
||||
|
||||
/**
|
||||
* Whether the submission of this form has been ever prevented because of
|
||||
@ -481,14 +481,14 @@ protected:
|
||||
* @param aFormSubmission the submission object
|
||||
* @param aEvent the DOM event that was passed to us for the submit
|
||||
*/
|
||||
nsresult BuildSubmission(nsFormSubmission** aFormSubmission,
|
||||
nsresult BuildSubmission(HTMLFormSubmission** aFormSubmission,
|
||||
WidgetEvent* aEvent);
|
||||
/**
|
||||
* Perform the submission (called by DoSubmit and FlushPendingSubmission)
|
||||
*
|
||||
* @param aFormSubmission the submission object
|
||||
*/
|
||||
nsresult SubmitSubmission(nsFormSubmission* aFormSubmission);
|
||||
nsresult SubmitSubmission(HTMLFormSubmission* aFormSubmission);
|
||||
|
||||
/**
|
||||
* Notify any submit observers of the submit.
|
||||
@ -590,7 +590,7 @@ protected:
|
||||
bool mSubmitInitiatedFromUserInput;
|
||||
|
||||
/** The pending submission object */
|
||||
nsAutoPtr<nsFormSubmission> mPendingSubmission;
|
||||
nsAutoPtr<HTMLFormSubmission> mPendingSubmission;
|
||||
/** The request currently being submitted */
|
||||
nsCOMPtr<nsIRequest> mSubmittingRequest;
|
||||
/** The web progress object we are currently listening to */
|
||||
|
@ -4,7 +4,7 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsFormSubmission.h"
|
||||
#include "HTMLFormSubmission.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIForm.h"
|
||||
@ -40,11 +40,8 @@
|
||||
#include "mozilla/dom/EncodingUtils.h"
|
||||
#include "mozilla/dom/File.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using mozilla::dom::Blob;
|
||||
using mozilla::dom::Directory;
|
||||
using mozilla::dom::EncodingUtils;
|
||||
using mozilla::dom::File;
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
static void
|
||||
SendJSWarning(nsIDocument* aDocument,
|
||||
@ -715,7 +712,7 @@ nsFSTextPlain::GetEncodedSubmission(nsIURI* aURI,
|
||||
|
||||
nsEncodingFormSubmission::nsEncodingFormSubmission(const nsACString& aCharset,
|
||||
nsIContent* aOriginatingElement)
|
||||
: nsFormSubmission(aCharset, aOriginatingElement)
|
||||
: HTMLFormSubmission(aCharset, aOriginatingElement)
|
||||
, mEncoder(aCharset)
|
||||
{
|
||||
if (!(aCharset.EqualsLiteral("UTF-8") || aCharset.EqualsLiteral("gb18030"))) {
|
||||
@ -806,7 +803,7 @@ GetEnumAttr(nsGenericHTMLElement* aContent,
|
||||
nsresult
|
||||
GetSubmissionFromForm(nsGenericHTMLElement* aForm,
|
||||
nsGenericHTMLElement* aOriginatingElement,
|
||||
nsFormSubmission** aFormSubmission)
|
||||
HTMLFormSubmission** aFormSubmission)
|
||||
{
|
||||
// Get all the information necessary to encode the form data
|
||||
NS_ASSERTION(aForm->GetComposedDoc(),
|
||||
@ -873,3 +870,6 @@ GetSubmissionFromForm(nsGenericHTMLElement* aForm,
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} // dom namespace
|
||||
} // mozilla namespace
|
@ -3,14 +3,15 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
#ifndef nsIFormSubmission_h___
|
||||
#define nsIFormSubmission_h___
|
||||
|
||||
#ifndef mozilla_dom_HTMLFormSubmission_h
|
||||
#define mozilla_dom_HTMLFormSubmission_h
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsString.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsNCRFallbackEncoderWrapper.h"
|
||||
#include "nsString.h"
|
||||
|
||||
class nsIURI;
|
||||
class nsIInputStream;
|
||||
@ -19,20 +20,19 @@ class nsIMultiplexInputStream;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class Blob;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
/**
|
||||
* Class for form submissions; encompasses the function to call to submit as
|
||||
* well as the form submission name/value pairs
|
||||
*/
|
||||
class nsFormSubmission
|
||||
class HTMLFormSubmission
|
||||
{
|
||||
public:
|
||||
virtual ~nsFormSubmission()
|
||||
virtual ~HTMLFormSubmission()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsFormSubmission);
|
||||
MOZ_COUNT_DTOR(HTMLFormSubmission);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,7 +53,7 @@ public:
|
||||
* not null.
|
||||
*/
|
||||
virtual nsresult AddNameBlobOrNullPair(const nsAString& aName,
|
||||
mozilla::dom::Blob* aBlob) = 0;
|
||||
Blob* aBlob) = 0;
|
||||
|
||||
/**
|
||||
* Reports whether the instance supports AddIsindex().
|
||||
@ -106,11 +106,12 @@ protected:
|
||||
* @param aCharset the charset of the form as a string
|
||||
* @param aOriginatingElement the originating element (can be null)
|
||||
*/
|
||||
nsFormSubmission(const nsACString& aCharset, nsIContent* aOriginatingElement)
|
||||
HTMLFormSubmission(const nsACString& aCharset,
|
||||
nsIContent* aOriginatingElement)
|
||||
: mCharset(aCharset)
|
||||
, mOriginatingElement(aOriginatingElement)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsFormSubmission);
|
||||
MOZ_COUNT_CTOR(HTMLFormSubmission);
|
||||
}
|
||||
|
||||
// The name of the encoder charset
|
||||
@ -120,7 +121,7 @@ protected:
|
||||
nsCOMPtr<nsIContent> mOriginatingElement;
|
||||
};
|
||||
|
||||
class nsEncodingFormSubmission : public nsFormSubmission
|
||||
class nsEncodingFormSubmission : public HTMLFormSubmission
|
||||
{
|
||||
public:
|
||||
nsEncodingFormSubmission(const nsACString& aCharset,
|
||||
@ -162,7 +163,7 @@ public:
|
||||
virtual nsresult AddNameValuePair(const nsAString& aName,
|
||||
const nsAString& aValue) override;
|
||||
virtual nsresult AddNameBlobOrNullPair(const nsAString& aName,
|
||||
mozilla::dom::Blob* aBlob) override;
|
||||
Blob* aBlob) override;
|
||||
virtual nsresult GetEncodedSubmission(nsIURI* aURI,
|
||||
nsIInputStream** aPostDataStream) override;
|
||||
|
||||
@ -220,6 +221,9 @@ private:
|
||||
*/
|
||||
nsresult GetSubmissionFromForm(nsGenericHTMLElement* aForm,
|
||||
nsGenericHTMLElement* aOriginatingElement,
|
||||
nsFormSubmission** aFormSubmission);
|
||||
HTMLFormSubmission** aFormSubmission);
|
||||
|
||||
#endif /* nsIFormSubmission_h___ */
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif /* mozilla_dom_HTMLFormSubmission_h */
|
@ -4,14 +4,17 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef nsFormSubmissionConstants_h__
|
||||
#define nsFormSubmissionConstants_h__
|
||||
#ifndef mozilla_dom_HTMLFormSubmissionConstants_h
|
||||
#define mozilla_dom_HTMLFormSubmissionConstants_h
|
||||
|
||||
#include "nsIForm.h"
|
||||
|
||||
static const nsAttrValue::EnumTable kFormMethodTable[] = {
|
||||
{ "get", NS_FORM_METHOD_GET },
|
||||
{ "post", NS_FORM_METHOD_POST },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
// Default method is 'get'.
|
||||
static const nsAttrValue::EnumTable* kFormDefaultMethod = &kFormMethodTable[0];
|
||||
|
||||
@ -21,8 +24,8 @@ static const nsAttrValue::EnumTable kFormEnctypeTable[] = {
|
||||
{ "text/plain", NS_FORM_ENCTYPE_TEXTPLAIN },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
// Default method is 'application/x-www-form-urlencoded'.
|
||||
static const nsAttrValue::EnumTable* kFormDefaultEnctype = &kFormEnctypeTable[1];
|
||||
|
||||
#endif // nsFormSubmissionConstants_h__
|
||||
|
||||
#endif // mozilla_dom_HTMLFormSubmissionConstants_h
|
@ -11,6 +11,7 @@
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/dom/Date.h"
|
||||
#include "mozilla/dom/Directory.h"
|
||||
#include "mozilla/dom/HTMLFormSubmission.h"
|
||||
#include "mozilla/dom/FileSystemUtils.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsCRTGlue.h"
|
||||
@ -21,6 +22,7 @@
|
||||
#include "nsIRadioVisitor.h"
|
||||
#include "nsIPhonetic.h"
|
||||
|
||||
#include "HTMLFormSubmissionConstants.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsIControllers.h"
|
||||
#include "nsIStringBundle.h"
|
||||
@ -38,9 +40,6 @@
|
||||
#include "nsPresContext.h"
|
||||
#include "nsMappedAttributes.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "nsIForm.h"
|
||||
#include "nsFormSubmission.h"
|
||||
#include "nsFormSubmissionConstants.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIFormControlFrame.h"
|
||||
@ -6182,7 +6181,7 @@ HTMLInputElement::Reset()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLInputElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
|
||||
HTMLInputElement::SubmitNamesValues(HTMLFormSubmission* aFormSubmission)
|
||||
{
|
||||
// Disabled elements don't submit
|
||||
// For type=reset, and type=button, we just never submit, period.
|
||||
|
@ -154,7 +154,7 @@ public:
|
||||
// Overriden nsIFormControl methods
|
||||
NS_IMETHOD_(uint32_t) GetType() const override { return mType; }
|
||||
NS_IMETHOD Reset() override;
|
||||
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) override;
|
||||
NS_IMETHOD SubmitNamesValues(HTMLFormSubmission* aFormSubmission) override;
|
||||
NS_IMETHOD SaveState() override;
|
||||
virtual bool RestoreState(nsPresState* aState) override;
|
||||
virtual bool AllowDrop() override;
|
||||
|
@ -5,6 +5,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/dom/HTMLFormSubmission.h"
|
||||
#include "mozilla/dom/HTMLObjectElement.h"
|
||||
#include "mozilla/dom/HTMLObjectElementBinding.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
@ -14,7 +15,6 @@
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIPluginDocument.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsFormSubmission.h"
|
||||
#include "nsIObjectFrame.h"
|
||||
#include "nsNPAPIPluginInstance.h"
|
||||
#include "nsIWidget.h"
|
||||
@ -407,7 +407,7 @@ HTMLObjectElement::Reset()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLObjectElement::SubmitNamesValues(nsFormSubmission *aFormSubmission)
|
||||
HTMLObjectElement::SubmitNamesValues(HTMLFormSubmission *aFormSubmission)
|
||||
{
|
||||
nsAutoString name;
|
||||
if (!GetAttr(kNameSpaceID_None, nsGkAtoms::name, name)) {
|
||||
|
@ -16,6 +16,8 @@
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class HTMLFormSubmission;
|
||||
|
||||
class HTMLObjectElement final : public nsGenericHTMLFormElement
|
||||
, public nsObjectLoadingContent
|
||||
, public nsIDOMHTMLObjectElement
|
||||
@ -70,7 +72,7 @@ public:
|
||||
}
|
||||
|
||||
NS_IMETHOD Reset() override;
|
||||
NS_IMETHOD SubmitNamesValues(nsFormSubmission *aFormSubmission) override;
|
||||
NS_IMETHOD SubmitNamesValues(HTMLFormSubmission *aFormSubmission) override;
|
||||
|
||||
virtual bool IsDisabled() const override { return false; }
|
||||
|
||||
|
@ -10,12 +10,12 @@
|
||||
#include "mozAutoDocUpdate.h"
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/HTMLFormSubmission.h"
|
||||
#include "mozilla/dom/HTMLOptionElement.h"
|
||||
#include "mozilla/dom/HTMLOptionsCollectionBinding.h"
|
||||
#include "mozilla/dom/HTMLSelectElement.h"
|
||||
#include "nsContentCreatorFunctions.h"
|
||||
#include "nsError.h"
|
||||
#include "nsFormSubmission.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIComboboxControlFrame.h"
|
||||
#include "nsIDocument.h"
|
||||
|
@ -9,10 +9,10 @@
|
||||
#include "mozAutoDocUpdate.h"
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/dom/HTMLFormElement.h"
|
||||
#include "mozilla/dom/HTMLFormSubmission.h"
|
||||
#include "mozilla/dom/HTMLOutputElementBinding.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsDOMTokenList.h"
|
||||
#include "nsFormSubmission.h"
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Output)
|
||||
|
||||
@ -75,7 +75,7 @@ HTMLOutputElement::Reset()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLOutputElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
|
||||
HTMLOutputElement::SubmitNamesValues(HTMLFormSubmission* aFormSubmission)
|
||||
{
|
||||
// The output element is not submittable.
|
||||
return NS_OK;
|
||||
|
@ -15,6 +15,8 @@
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class HTMLFormSubmission;
|
||||
|
||||
class HTMLOutputElement final : public nsGenericHTMLFormElement,
|
||||
public nsStubMutationObserver,
|
||||
public nsIConstraintValidation
|
||||
@ -31,7 +33,7 @@ public:
|
||||
// nsIFormControl
|
||||
NS_IMETHOD_(uint32_t) GetType() const override { return NS_FORM_OUTPUT; }
|
||||
NS_IMETHOD Reset() override;
|
||||
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) override;
|
||||
NS_IMETHOD SubmitNamesValues(HTMLFormSubmission* aFormSubmission) override;
|
||||
|
||||
virtual bool IsDisabled() const override { return false; }
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/HTMLFormSubmission.h"
|
||||
#include "mozilla/dom/HTMLOptGroupElement.h"
|
||||
#include "mozilla/dom/HTMLOptionElement.h"
|
||||
#include "mozilla/dom/HTMLSelectElementBinding.h"
|
||||
@ -19,7 +20,6 @@
|
||||
#include "nsContentCreatorFunctions.h"
|
||||
#include "nsContentList.h"
|
||||
#include "nsError.h"
|
||||
#include "nsFormSubmission.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIComboboxControlFrame.h"
|
||||
#include "nsIDocument.h"
|
||||
@ -1656,7 +1656,7 @@ HTMLSelectElement::Reset()
|
||||
static NS_DEFINE_CID(kFormProcessorCID, NS_FORMPROCESSOR_CID);
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLSelectElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
|
||||
HTMLSelectElement::SubmitNamesValues(HTMLFormSubmission* aFormSubmission)
|
||||
{
|
||||
// Disabled elements don't submit
|
||||
if (IsDisabled()) {
|
||||
|
@ -33,6 +33,7 @@ class EventChainPreVisitor;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class HTMLFormSubmission;
|
||||
class HTMLSelectElement;
|
||||
|
||||
#define NS_SELECT_STATE_IID \
|
||||
@ -289,7 +290,7 @@ public:
|
||||
// Overriden nsIFormControl methods
|
||||
NS_IMETHOD_(uint32_t) GetType() const override { return NS_FORM_SELECT; }
|
||||
NS_IMETHOD Reset() override;
|
||||
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) override;
|
||||
NS_IMETHOD SubmitNamesValues(HTMLFormSubmission* aFormSubmission) override;
|
||||
NS_IMETHOD SaveState() override;
|
||||
virtual bool RestoreState(nsPresState* aState) override;
|
||||
virtual bool IsDisabledForEvents(EventMessage aMessage) override;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "mozAutoDocUpdate.h"
|
||||
#include "mozilla/AsyncEventDispatcher.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/HTMLFormSubmission.h"
|
||||
#include "mozilla/dom/HTMLTextAreaElementBinding.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventStates.h"
|
||||
@ -18,7 +19,6 @@
|
||||
#include "nsContentCreatorFunctions.h"
|
||||
#include "nsError.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsFormSubmission.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIConstraintValidation.h"
|
||||
#include "nsIControllers.h"
|
||||
@ -1040,7 +1040,7 @@ HTMLTextAreaElement::Reset()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLTextAreaElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
|
||||
HTMLTextAreaElement::SubmitNamesValues(HTMLFormSubmission* aFormSubmission)
|
||||
{
|
||||
// Disabled elements don't submit
|
||||
if (IsDisabled()) {
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
#include "nsTextEditorState.h"
|
||||
|
||||
class nsFormSubmission;
|
||||
class nsIControllers;
|
||||
class nsIDocument;
|
||||
class nsPresContext;
|
||||
@ -35,6 +34,8 @@ class EventStates;
|
||||
|
||||
namespace dom {
|
||||
|
||||
class HTMLFormSubmission;
|
||||
|
||||
class HTMLTextAreaElement final : public nsGenericHTMLFormElementWithState,
|
||||
public nsIDOMHTMLTextAreaElement,
|
||||
public nsITextControlElement,
|
||||
@ -72,7 +73,7 @@ public:
|
||||
// nsIFormControl
|
||||
NS_IMETHOD_(uint32_t) GetType() const override { return NS_FORM_TEXTAREA; }
|
||||
NS_IMETHOD Reset() override;
|
||||
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) override;
|
||||
NS_IMETHOD SubmitNamesValues(HTMLFormSubmission* aFormSubmission) override;
|
||||
NS_IMETHOD SaveState() override;
|
||||
virtual bool RestoreState(nsPresState* aState) override;
|
||||
virtual bool IsDisabledForEvents(EventMessage aMessage) override;
|
||||
|
@ -28,7 +28,6 @@ XPIDL_SOURCES += [
|
||||
XPIDL_MODULE = 'content_html'
|
||||
|
||||
EXPORTS += [
|
||||
'nsFormSubmission.h',
|
||||
'nsGenericHTMLElement.h',
|
||||
'nsHTMLDNSPrefetch.h',
|
||||
'nsIConstraintValidation.h',
|
||||
@ -61,6 +60,7 @@ EXPORTS.mozilla.dom += [
|
||||
'HTMLFontElement.h',
|
||||
'HTMLFormControlsCollection.h',
|
||||
'HTMLFormElement.h',
|
||||
'HTMLFormSubmission.h',
|
||||
'HTMLFrameElement.h',
|
||||
'HTMLFrameSetElement.h',
|
||||
'HTMLHeadingElement.h',
|
||||
@ -140,6 +140,7 @@ UNIFIED_SOURCES += [
|
||||
'HTMLFontElement.cpp',
|
||||
'HTMLFormControlsCollection.cpp',
|
||||
'HTMLFormElement.cpp',
|
||||
'HTMLFormSubmission.cpp',
|
||||
'HTMLFrameElement.cpp',
|
||||
'HTMLFrameSetElement.cpp',
|
||||
'HTMLHeadingElement.cpp',
|
||||
@ -195,7 +196,6 @@ UNIFIED_SOURCES += [
|
||||
'MediaError.cpp',
|
||||
'nsBrowserElement.cpp',
|
||||
'nsDOMStringMap.cpp',
|
||||
'nsFormSubmission.cpp',
|
||||
'nsGenericHTMLElement.cpp',
|
||||
'nsGenericHTMLFrameElement.cpp',
|
||||
'nsHTMLContentSink.cpp',
|
||||
|
@ -11,12 +11,12 @@
|
||||
|
||||
class nsIDOMHTMLFormElement;
|
||||
class nsPresState;
|
||||
class nsFormSubmission;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class Element;
|
||||
class HTMLFieldSetElement;
|
||||
class HTMLFormSubmission;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
@ -141,7 +141,8 @@ public:
|
||||
* @param aFormSubmission the form submission to notify of names/values/files
|
||||
* to submit
|
||||
*/
|
||||
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) = 0;
|
||||
NS_IMETHOD
|
||||
SubmitNamesValues(mozilla::dom::HTMLFormSubmission* aFormSubmission) = 0;
|
||||
|
||||
/**
|
||||
* Save to presentation state. The form control will determine whether it
|
||||
|
Loading…
Reference in New Issue
Block a user