Bug 895274 part.270 Add comment to explain the naming rules of EventMessage r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 15 Sep 2015 00:14:38 +0900
changeset 294973 b3f5c61b22ee65a236d04bdbbc4a3aa71c34435c
parent 294972 e69d4cf68a8729310ca15166fc3d8f0951753430
child 294974 c425e00cb6c5431550756a50aeb93230117b53da
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [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.270 Add comment to explain the naming rules of EventMessage r=smaug
widget/EventMessageList.h
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -2,16 +2,28 @@
 /* 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/. */
 
 /**
  * This header file lists up all event messages and their values.
  * Before including this header file, you should define
  * NS_EVENT_MESSAGE(aMessage, aValue)
+ *
+ * Naming rules of the event messages:
+ * 0. Starting with "e" prefix and use camelcase.
+ * 1. Basically, use same name as the DOM name which is fired at dispatching
+ *    the event.
+ * 2. If the event message name becomes too generic, e.g., "eInvalid", that may
+ *    conflict with another enum's item name, append something after the "e"
+ *    prefix, e.g., "eFormInvalid".
+ * 3. When you need to define a group of event messages, you should define
+ *    the special enum name messages as starting with "e" prefix, appending the
+ *    generic event name, e.g., "Pointer" with "Event" and "First" or "Last"
+ *    such as "ePointerEventFirst" and "ePointerEventLast".
  */
 
 NS_EVENT_MESSAGE(eVoidEvent,            0)
 
 // This is a dummy event message for all event listener implementation in
 // EventListenerManager.
 NS_EVENT_MESSAGE(eAllEvents,            1)