Bug 895274 part.63 Rename NS_FORM_SUBMIT to eFormSubmit r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 02 Sep 2015 15:08:00 +0900
changeset 260463 5443202e95e681f179b5b0a86cc4aa00164452b1
parent 260462 9afdaf8b032a01c5b9fc437dbde4db57f767bc34
child 260464 58ea57abc0e9736acc0e3c7fbf1a65d92b502edc
push id64503
push usermasayuki@d-toybox.com
push dateWed, 02 Sep 2015 06:08:16 +0000
treeherdermozilla-inbound@bd0d6c41b33e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs895274
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 895274 part.63 Rename NS_FORM_SUBMIT to eFormSubmit r=smaug
dom/events/Event.cpp
dom/events/EventNameList.h
dom/html/HTMLButtonElement.cpp
dom/html/HTMLFormElement.cpp
dom/html/HTMLFormElement.h
dom/html/HTMLInputElement.cpp
widget/EventMessageList.h
widget/nsBaseWidget.cpp
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -848,17 +848,17 @@ Event::GetEventPopupControlState(WidgetE
     }
     break;
   case eFormEventClass:
     // For these following events only allow popups if they're
     // triggered while handling user input. See
     // nsPresShell::HandleEventInternal() for details.
     if (EventStateManager::IsHandlingUserInput()) {
       switch(aEvent->mMessage) {
-      case NS_FORM_SUBMIT :
+      case eFormSubmit:
         if (PopupAllowedForEvent("submit")) {
           abuse = openControlled;
         }
         break;
       case NS_FORM_RESET :
         if (PopupAllowedForEvent("reset")) {
           abuse = openControlled;
         }
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -393,17 +393,17 @@ EVENT(show,
       NS_SHOW_EVENT,
       EventNameType_HTML,
       eBasicEventClass)
 EVENT(stalled,
       NS_STALLED,
       EventNameType_HTML,
       eBasicEventClass)
 EVENT(submit,
-      NS_FORM_SUBMIT,
+      eFormSubmit,
       EventNameType_HTMLXUL,
       eBasicEventClass)
 EVENT(suspend,
       NS_SUSPEND,
       EventNameType_HTML,
       eBasicEventClass)
 EVENT(timeupdate,
       NS_TIMEUPDATE,
--- a/dom/html/HTMLButtonElement.cpp
+++ b/dom/html/HTMLButtonElement.cpp
@@ -365,29 +365,29 @@ HTMLButtonElement::PostHandleEvent(Event
 
       default:
         break;
     }
     if (aVisitor.mItemFlags & NS_OUTER_ACTIVATE_EVENT) {
       if (mForm && (mType == NS_FORM_BUTTON_SUBMIT ||
                     mType == NS_FORM_BUTTON_RESET)) {
         InternalFormEvent event(true,
-          (mType == NS_FORM_BUTTON_RESET) ? NS_FORM_RESET : NS_FORM_SUBMIT);
+          (mType == NS_FORM_BUTTON_RESET) ? NS_FORM_RESET : eFormSubmit);
         event.originator     = this;
         nsEventStatus status = nsEventStatus_eIgnore;
 
         nsCOMPtr<nsIPresShell> presShell =
           aVisitor.mPresContext->GetPresShell();
         // If |nsIPresShell::Destroy| has been called due to
         // handling the event, the pres context will return
         // a null pres shell.  See bug 125624.
         //
         // Using presShell to dispatch the event. It makes sure that
         // event is not handled if the window is being destroyed.
-        if (presShell && (event.mMessage != NS_FORM_SUBMIT ||
+        if (presShell && (event.mMessage != eFormSubmit ||
                           mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate) ||
                           // We know the element is a submit control, if this check is moved,
                           // make sure formnovalidate is used only if it's a submit control.
                           HasAttr(kNameSpaceID_None, nsGkAtoms::formnovalidate) ||
                           mForm->CheckValidFormSubmission())) {
           // TODO: removing this code and have the submit event sent by the form
           // see bug 592124.
           // Hold a strong ref while dispatching
--- a/dom/html/HTMLFormElement.cpp
+++ b/dom/html/HTMLFormElement.cpp
@@ -251,17 +251,17 @@ HTMLFormElement::Submit(ErrorResult& aRv
   if (mPendingSubmission) {
     // aha, we have a pending submission that was not flushed
     // (this happens when form.submit() is called twice)
     // we have to delete it and build a new one since values
     // might have changed inbetween (we emulate IE here, that's all)
     mPendingSubmission = nullptr;
   }
 
-  aRv = DoSubmitOrReset(nullptr, NS_FORM_SUBMIT);
+  aRv = DoSubmitOrReset(nullptr, eFormSubmit);
 }
 
 NS_IMETHODIMP
 HTMLFormElement::Submit()
 {
   ErrorResult rv;
   Submit(rv);
   return rv.StealNSResult();
@@ -488,17 +488,17 @@ HTMLFormElement::UnbindFromTree(bool aDe
 }
 
 nsresult
 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;
       }
       mGeneratingSubmit = true;
 
       // let the form know that it needs to defer the submission,
       // that means that if there are scripted submissions, the
@@ -517,92 +517,91 @@ HTMLFormElement::PreHandleEvent(EventCha
 }
 
 nsresult
 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)) {
     aVisitor.mEvent->mFlags.mPropagationStopped = true;
   }
   return NS_OK;
 }
 
 nsresult
 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;
     }
 
     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
             // the name/value of the submitting element, thus we need
             // to forget it and the form element will build a new one
             mPendingSubmission = nullptr;
           }
           DoSubmitOrReset(aVisitor.mEvent, msg);
           break;
         }
         default:
           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
         // be submitted immediatelly.
         FlushPendingSubmission();
       }
     }
 
-    if (msg == NS_FORM_SUBMIT) {
+    if (msg == eFormSubmit) {
       mGeneratingSubmit = false;
     }
     else if (msg == NS_FORM_RESET) {
       mGeneratingReset = false;
     }
   }
   return NS_OK;
 }
 
 nsresult
 HTMLFormElement::DoSubmitOrReset(WidgetEvent* aEvent,
-                                 int32_t aMessage)
+                                 EventMessage aMessage)
 {
   // Make sure the presentation is up-to-date
   nsIDocument* doc = GetComposedDoc();
   if (doc) {
     doc->FlushPendingNotifications(Flush_ContentAndNotify);
   }
 
   // JBK Don't get form frames anymore - bug 34297
 
   // Submit or Reset the form
   if (NS_FORM_RESET == aMessage) {
     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)) {
       return NS_OK;
     }
     return DoSubmit(aEvent);
   }
 
--- a/dom/html/HTMLFormElement.h
+++ b/dom/html/HTMLFormElement.h
@@ -447,17 +447,17 @@ protected:
       return NS_OK;
     }
 
   private:
     nsRefPtr<HTMLFormElement> mForm;
   };
 
   nsresult DoSubmitOrReset(WidgetEvent* aEvent,
-                           int32_t aMessage);
+                           EventMessage aMessage);
   nsresult DoReset();
 
   // Async callback to handle removal of our default submit
   void HandleDefaultSubmitRemoval();
 
   //
   // Submit Helpers
   //
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -2812,17 +2812,17 @@ HTMLInputElement::MaybeSubmitForm(nsPres
   } else if (!mForm->ImplicitSubmissionIsDisabled() &&
              (mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate) ||
               mForm->CheckValidFormSubmission())) {
     // TODO: removing this code and have the submit event sent by the form,
     // bug 592124.
     // If there's only one text control, just submit the form
     // Hold strong ref across the event
     nsRefPtr<mozilla::dom::HTMLFormElement> form = mForm;
-    InternalFormEvent event(true, NS_FORM_SUBMIT);
+    InternalFormEvent event(true, eFormSubmit);
     nsEventStatus status = nsEventStatus_eIgnore;
     shell->HandleDOMEventWithTarget(mForm, &event, &status);
   }
 
   return NS_OK;
 }
 
 void
@@ -4010,29 +4010,29 @@ HTMLInputElement::PostHandleEvent(EventC
           }
         }
         switch(mType) {
         case NS_FORM_INPUT_RESET:
         case NS_FORM_INPUT_SUBMIT:
         case NS_FORM_INPUT_IMAGE:
           if (mForm) {
             InternalFormEvent event(true,
-              (mType == NS_FORM_INPUT_RESET) ? NS_FORM_RESET : NS_FORM_SUBMIT);
+              (mType == NS_FORM_INPUT_RESET) ? NS_FORM_RESET : eFormSubmit);
             event.originator      = this;
             nsEventStatus status  = nsEventStatus_eIgnore;
 
             nsCOMPtr<nsIPresShell> presShell =
               aVisitor.mPresContext->GetPresShell();
 
             // If |nsIPresShell::Destroy| has been called due to
             // handling the event the pres context will return a null
             // pres shell.  See bug 125624.
             // TODO: removing this code and have the submit event sent by the
             // form, see bug 592124.
-            if (presShell && (event.mMessage != NS_FORM_SUBMIT ||
+            if (presShell && (event.mMessage != eFormSubmit ||
                               mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate) ||
                               // We know the element is a submit control, if this check is moved,
                               // make sure formnovalidate is used only if it's a submit control.
                               HasAttr(kNameSpaceID_None, nsGkAtoms::formnovalidate) ||
                               mForm->CheckValidFormSubmission())) {
               // Hold a strong ref while dispatching
               nsRefPtr<mozilla::dom::HTMLFormElement> form(mForm);
               presShell->HandleDOMEventWithTarget(mForm, &event, &status);
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -85,17 +85,17 @@ NS_EVENT_MESSAGE(eUnload,               
 NS_EVENT_MESSAGE(eHashChange,           eStreamEventFirst + 2)
 NS_EVENT_MESSAGE(eImageAbort,           eStreamEventFirst + 3)
 NS_EVENT_MESSAGE(eLoadError,            eStreamEventFirst + 4)
 NS_EVENT_MESSAGE(ePopState,             eStreamEventFirst + 5)
 NS_EVENT_MESSAGE(eBeforeUnload,         eStreamEventFirst + 6)
 NS_EVENT_MESSAGE(eReadyStateChange,     eStreamEventFirst + 8)
  
 NS_EVENT_MESSAGE(eFormEventFirst,       1200)
-NS_EVENT_MESSAGE(NS_FORM_SUBMIT,        eFormEventFirst)
+NS_EVENT_MESSAGE(eFormSubmit,           eFormEventFirst)
 NS_EVENT_MESSAGE(NS_FORM_RESET,         eFormEventFirst + 1)
 NS_EVENT_MESSAGE(NS_FORM_CHANGE,        eFormEventFirst + 2)
 NS_EVENT_MESSAGE(NS_FORM_SELECTED,      eFormEventFirst + 3)
 NS_EVENT_MESSAGE(NS_FORM_INVALID,       eFormEventFirst + 4)
 
 //Need separate focus/blur notifications for non-native widgets
 NS_EVENT_MESSAGE(NS_FOCUS_EVENT_START,  1300)
 NS_EVENT_MESSAGE(NS_FOCUS_CONTENT,      NS_FOCUS_EVENT_START)
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -2637,17 +2637,17 @@ case _value: eventName.AssignLiteral(_na
     _ASSIGN_eventName(NS_DRAGDROP_ENTER,"NS_DND_ENTER");
     _ASSIGN_eventName(NS_DRAGDROP_EXIT,"NS_DND_EXIT");
     _ASSIGN_eventName(NS_DRAGDROP_OVER,"NS_DND_OVER");
     _ASSIGN_eventName(NS_EDITOR_INPUT,"NS_EDITOR_INPUT");
     _ASSIGN_eventName(NS_FOCUS_CONTENT,"NS_FOCUS_CONTENT");
     _ASSIGN_eventName(NS_FORM_SELECTED,"NS_FORM_SELECTED");
     _ASSIGN_eventName(NS_FORM_CHANGE,"NS_FORM_CHANGE");
     _ASSIGN_eventName(NS_FORM_RESET,"NS_FORM_RESET");
-    _ASSIGN_eventName(NS_FORM_SUBMIT,"NS_FORM_SUBMIT");
+    _ASSIGN_eventName(eFormSubmit,"eFormSubmit");
     _ASSIGN_eventName(eImageAbort,"eImageAbort");
     _ASSIGN_eventName(eLoadError,"eLoadError");
     _ASSIGN_eventName(eKeyDown,"eKeyDown");
     _ASSIGN_eventName(eKeyPress,"eKeyPress");
     _ASSIGN_eventName(eKeyUp,"eKeyUp");
     _ASSIGN_eventName(eMouseEnterIntoWidget,"eMouseEnterIntoWidget");
     _ASSIGN_eventName(eMouseExitFromWidget,"eMouseExitFromWidget");
     _ASSIGN_eventName(eMouseDown,"eMouseDown");