Bug 769190 part.1 Rename Scroll and Win to ScrollLock and OS for the argument of getModifierState() r=smaug, sr=jst
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 06 Jul 2012 09:42:05 +0900
changeset 98825 013bdf4143572afc93b59fab57feb810d0a448ba
parent 98824 0f3558a03db75d4d694bede133d5c5aad6720d5c
child 98826 c41bf7b9364cf0a8bafb1256e359b0acc34a1058
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerssmaug, jst
bugs769190
milestone16.0a1
Bug 769190 part.1 Rename Scroll and Win to ScrollLock and OS for the argument of getModifierState() r=smaug, sr=jst
content/events/test/test_dom_keyboard_event.html
content/events/test/test_dom_mouse_event.html
dom/base/nsDOMWindowUtils.cpp
dom/interfaces/base/nsIDOMWindowUtils.idl
testing/mochitest/tests/SimpleTest/EventUtils.js
widget/nsEvent.h
--- a/content/events/test/test_dom_keyboard_event.html
+++ b/content/events/test/test_dom_keyboard_event.html
@@ -67,22 +67,23 @@ function testInitializingUntrustedEvent(
 
     { createEventArg: "KeyboardEvent",
       type: "foo", bubbles: false, cancelable: false, view: window,
       ctrlKey: true, altKey: true, shiftKey: true, metaKey: true,
       keyCode: 0x10, charCode: 0x80 },
   ];
 
   const kOtherModifierName = [
-    "CapsLock", "NumLock", "Scroll", "SymbolLock", "Fn", "Win", "AltGraph"
+    "CapsLock", "NumLock", "ScrollLock", "SymbolLock", "Fn", "OS", "AltGraph"
   ];
 
   const kInvalidModifierName = [
-    "shift", "control", "alt", "meta", "capslock", "numlock", "scroll",
-    "symbollock", "fn", "win", "altgraph", "Invalid", "Shift Control"
+    "shift", "control", "alt", "meta", "capslock", "numlock", "scrolllock",
+    "symbollock", "fn", "os", "altgraph", "Invalid", "Shift Control",
+    "Win", "Scroll"
   ];
 
   for (var i = 0; i < kTests.length; i++) {
     var description = "testInitializingUntrustedEvent, Index: " + i + ", ";
     const kTest = kTests[i];
     var e = document.createEvent(kTest.createEventArg);
     e.initKeyEvent(kTest.type, kTest.bubbles, kTest.cancelable, kTest.view,
                    kTest.ctrlKey, kTest.altKey, kTest.shiftKey, kTest.metaKey,
--- a/content/events/test/test_dom_mouse_event.html
+++ b/content/events/test/test_dom_mouse_event.html
@@ -76,22 +76,23 @@ function testInitializingUntrustedEvent(
     { createEventArg: "MouseEvent",
       type: "foo", bubbles: false, cancelable: false, view: window, detail: 100,
       screenX: 2000, screenY: 6000, clientX: 5000, clientY: 3000,
       ctrlKey: true, altKey: true, shiftKey: true, metaKey: true,
       button: 8, relatedTarget: document.getElementById("test") },
   ];
 
   const kOtherModifierName = [
-    "CapsLock", "NumLock", "Scroll", "SymbolLock", "Fn", "Win", "AltGraph"
+    "CapsLock", "NumLock", "ScrollLock", "SymbolLock", "Fn", "OS", "AltGraph"
   ];
 
   const kInvalidModifierName = [
-    "shift", "control", "alt", "meta", "capslock", "numlock", "scroll",
-    "symbollock", "fn", "win", "altgraph", "Invalid", "Shift Control"
+    "shift", "control", "alt", "meta", "capslock", "numlock", "scrolllock",
+    "symbollock", "fn", "os", "altgraph", "Invalid", "Shift Control",
+    "Win", "Scroll"
   ];
 
   for (var i = 0; i < kTests.length; i++) {
     var description = "testInitializingUntrustedEvent, Index: " + i + ", ";
     const kTest = kTests[i];
     var e = document.createEvent(kTest.createEventArg);
     e.initMouseEvent(kTest.type, kTest.bubbles, kTest.cancelable, kTest.view,
                      kTest.detail, kTest.screenX, kTest.screenY, kTest.clientX, kTest.clientY,
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -454,23 +454,23 @@ nsDOMWindowUtils::GetWidgetModifiers(PRI
     result |= widget::MODIFIER_CAPSLOCK;
   }
   if (aModifiers & nsIDOMWindowUtils::MODIFIER_FN) {
     result |= widget::MODIFIER_FN;
   }
   if (aModifiers & nsIDOMWindowUtils::MODIFIER_NUMLOCK) {
     result |= widget::MODIFIER_NUMLOCK;
   }
-  if (aModifiers & nsIDOMWindowUtils::MODIFIER_SCROLL) {
+  if (aModifiers & nsIDOMWindowUtils::MODIFIER_SCROLLLOCK) {
     result |= widget::MODIFIER_SCROLL;
   }
   if (aModifiers & nsIDOMWindowUtils::MODIFIER_SYMBOLLOCK) {
     result |= widget::MODIFIER_SYMBOLLOCK;
   }
-  if (aModifiers & nsIDOMWindowUtils::MODIFIER_WIN) {
+  if (aModifiers & nsIDOMWindowUtils::MODIFIER_OS) {
     result |= widget::MODIFIER_WIN;
   }
   return result;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::SendMouseEvent(const nsAString& aType,
                                  float aX,
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -177,19 +177,19 @@ interface nsIDOMWindowUtils : nsISupport
   const long MODIFIER_ALT        = 0x0001;
   const long MODIFIER_CONTROL    = 0x0002;
   const long MODIFIER_SHIFT      = 0x0004;
   const long MODIFIER_META       = 0x0008;
   const long MODIFIER_ALTGRAPH   = 0x0010;
   const long MODIFIER_CAPSLOCK   = 0x0020;
   const long MODIFIER_FN         = 0x0040;
   const long MODIFIER_NUMLOCK    = 0x0080;
-  const long MODIFIER_SCROLL     = 0x0100;
+  const long MODIFIER_SCROLLLOCK = 0x0100;
   const long MODIFIER_SYMBOLLOCK = 0x0200;
-  const long MODIFIER_WIN        = 0x0400;
+  const long MODIFIER_OS         = 0x0400;
 
   /** Synthesize a mouse event. The event types supported are:
    *    mousedown, mouseup, mousemove, mouseover, mouseout, contextmenu
    *
    * Events are sent in coordinates offset by aX and aY from the window.
    *
    * Note that additional events may be fired as a result of this call. For
    * instance, typically a click event will be fired as a result of a
--- a/testing/mochitest/tests/SimpleTest/EventUtils.js
+++ b/testing/mochitest/tests/SimpleTest/EventUtils.js
@@ -142,23 +142,23 @@ function _parseModifiers(aEvent)
   }
   if (aEvent.fnKey) {
     mval |= nsIDOMWindowUtils.MODIFIER_FN;
   }
   if (aEvent.numLockKey) {
     mval |= nsIDOMWindowUtils.MODIFIER_NUMLOCK;
   }
   if (aEvent.scrollLockKey) {
-    mval |= nsIDOMWindowUtils.MODIFIER_SCROLL;
+    mval |= nsIDOMWindowUtils.MODIFIER_SCROLLLOCK;
   }
   if (aEvent.symbolLockKey) {
     mval |= nsIDOMWindowUtils.MODIFIER_SYMBOLLOCK;
   }
-  if (aEvent.winKey) {
-    mval |= nsIDOMWindowUtils.MODIFIER_WIN;
+  if (aEvent.osKey) {
+    mval |= nsIDOMWindowUtils.MODIFIER_OS;
   }
 
   return mval;
 }
 
 /**
  * Synthesize a mouse event on a target. The actual client point is determined
  * by taking the aTarget's client box and offseting it by aOffsetX and
--- a/widget/nsEvent.h
+++ b/widget/nsEvent.h
@@ -108,14 +108,14 @@ typedef PRUint16 Modifiers;
 
 #define NS_DOM_KEYNAME_ALT        "Alt"
 #define NS_DOM_KEYNAME_ALTGRAPH   "AltGraph"
 #define NS_DOM_KEYNAME_CAPSLOCK   "CapsLock"
 #define NS_DOM_KEYNAME_CONTROL    "Control"
 #define NS_DOM_KEYNAME_FN         "Fn"
 #define NS_DOM_KEYNAME_META       "Meta"
 #define NS_DOM_KEYNAME_NUMLOCK    "NumLock"
-#define NS_DOM_KEYNAME_SCROLL     "Scroll"
+#define NS_DOM_KEYNAME_SCROLL     "ScrollLock"
 #define NS_DOM_KEYNAME_SHIFT      "Shift"
 #define NS_DOM_KEYNAME_SYMBOLLOCK "SymbolLock"
-#define NS_DOM_KEYNAME_WIN        "Win"
+#define NS_DOM_KEYNAME_WIN        "OS"
 
 #endif // nsEvent_h__