Bug 895274 part.63 Rename NS_FORM_SUBMIT to eFormSubmit r=smaug

This commit is contained in:
Masayuki Nakano
2015-09-02 15:08:00 +09:00
parent 0672a0d898
commit 76c0053ddf
8 changed files with 20 additions and 21 deletions

View File

@@ -256,7 +256,7 @@ HTMLFormElement::Submit(ErrorResult& aRv)
mPendingSubmission = nullptr;
}
aRv = DoSubmitOrReset(nullptr, NS_FORM_SUBMIT);
aRv = DoSubmitOrReset(nullptr, eFormSubmit);
}
NS_IMETHODIMP
@@ -493,7 +493,7 @@ HTMLFormElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
aVisitor.mWantsWillHandleEvent = true;
if (aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this)) {
uint32_t msg = aVisitor.mEvent->mMessage;
if (msg == NS_FORM_SUBMIT) {
if (msg == eFormSubmit) {
if (mGeneratingSubmit) {
aVisitor.mCanHandle = false;
return NS_OK;
@@ -522,7 +522,7 @@ HTMLFormElement::WillHandleEvent(EventChainPostVisitor& aVisitor)
// If this is the bubble stage and there is a nested form below us which
// received a submit event we do *not* want to handle the submit event
// for this form too.
if ((aVisitor.mEvent->mMessage == NS_FORM_SUBMIT ||
if ((aVisitor.mEvent->mMessage == eFormSubmit ||
aVisitor.mEvent->mMessage == NS_FORM_RESET) &&
aVisitor.mEvent->mFlags.mInBubblingPhase &&
aVisitor.mEvent->originalTarget != static_cast<nsIContent*>(this)) {
@@ -536,7 +536,7 @@ HTMLFormElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
if (aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this)) {
EventMessage msg = aVisitor.mEvent->mMessage;
if (msg == NS_FORM_SUBMIT) {
if (msg == eFormSubmit) {
// let the form know not to defer subsequent submissions
mDeferSubmission = false;
}
@@ -544,9 +544,8 @@ HTMLFormElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
if (aVisitor.mEventStatus == nsEventStatus_eIgnore) {
switch (msg) {
case NS_FORM_RESET:
case NS_FORM_SUBMIT:
{
if (mPendingSubmission && msg == NS_FORM_SUBMIT) {
case eFormSubmit: {
if (mPendingSubmission && msg == eFormSubmit) {
// tell the form to forget a possible pending submission.
// the reason is that the script returned true (the event was
// ignored) so if there is a stored submission, it will miss
@@ -561,7 +560,7 @@ HTMLFormElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
break;
}
} else {
if (msg == NS_FORM_SUBMIT) {
if (msg == eFormSubmit) {
// tell the form to flush a possible pending submission.
// the reason is that the script returned false (the event was
// not ignored) so if there is a stored submission, it needs to
@@ -570,7 +569,7 @@ HTMLFormElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
}
if (msg == NS_FORM_SUBMIT) {
if (msg == eFormSubmit) {
mGeneratingSubmit = false;
}
else if (msg == NS_FORM_RESET) {
@@ -582,7 +581,7 @@ HTMLFormElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
nsresult
HTMLFormElement::DoSubmitOrReset(WidgetEvent* aEvent,
int32_t aMessage)
EventMessage aMessage)
{
// Make sure the presentation is up-to-date
nsIDocument* doc = GetComposedDoc();
@@ -597,7 +596,7 @@ HTMLFormElement::DoSubmitOrReset(WidgetEvent* aEvent,
return DoReset();
}
if (NS_FORM_SUBMIT == aMessage) {
if (eFormSubmit == aMessage) {
// Don't submit if we're not in a document or if we're in
// a sandboxed frame and form submit is disabled.
if (!doc || (doc->GetSandboxFlags() & SANDBOXED_FORMS)) {