Backed out changeset 0593679c47a9 (bug 894099) because it causes bug 897901. DONTBUILD
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 25 Jul 2013 11:46:25 +0200
changeset 152250 c99eac4a75c6fe8765149ed5b88fb5c10091c922
parent 152249 0593679c47a90ff9144ba9d8568706352d8eabec
child 152251 9b02a97c167feb64dfb7c43d1bb2bd47bd58f8d9
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs894099, 897901
milestone25.0a1
backs out0593679c47a90ff9144ba9d8568706352d8eabec
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
Backed out changeset 0593679c47a9 (bug 894099) because it causes bug 897901. DONTBUILD
toolkit/modules/WindowDraggingUtils.jsm
widget/windows/nsWindow.cpp
--- a/toolkit/modules/WindowDraggingUtils.jsm
+++ b/toolkit/modules/WindowDraggingUtils.jsm
@@ -1,31 +1,29 @@
 /* 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/. */
 
-#ifdef MOZ_WIDGET_COCOA
-let useHitTest = true;
-#elifdef XP_WIN
-let sysInfo = Components.classes["@mozilla.org/system-info;1"]
-              .getService(Components.interfaces.nsIPropertyBag2);
-let useHitTest = parseFloat(sysInfo.getProperty("version")) >= 6;
-#else
-let useHitTest = false;
+#ifdef XP_WIN
+#define USE_HITTEST
+#elifdef MOZ_WIDGET_COCOA
+#define USE_HITTEST
 #endif
 
 this.EXPORTED_SYMBOLS = [ "WindowDraggingElement" ];
 
 this.WindowDraggingElement = function WindowDraggingElement(elem) {
   this._elem = elem;
   this._window = elem.ownerDocument.defaultView;
-  if (useHitTest && !this.isPanel())
+#ifdef USE_HITTEST
+  if (!this.isPanel())
     this._elem.addEventListener("MozMouseHittest", this, false);
   else
-    this._elem.addEventListener("mousedown", this, false);
+#endif
+  this._elem.addEventListener("mousedown", this, false);
 };
 
 WindowDraggingElement.prototype = {
   mouseDownCheck: function(e) { return true; },
   dragTags: ["box", "hbox", "vbox", "spacer", "label", "statusbarpanel", "stack",
              "toolbaritem", "toolbarseparator", "toolbarspring", "toolbarspacer",
              "radiogroup", "deck", "scrollbox", "arrowscrollbox", "tabs"],
   shouldDrag: function(aEvent) {
@@ -57,21 +55,23 @@ WindowDraggingElement.prototype = {
     return true;
   },
   isPanel : function() {
     return this._elem instanceof Components.interfaces.nsIDOMXULElement &&
            this._elem.localName == "panel";
   },
   handleEvent: function(aEvent) {
     let isPanel = this.isPanel();
-    if (useHitTest && !isPanel) {
+#ifdef USE_HITTEST
+    if (!isPanel) {
       if (this.shouldDrag(aEvent))
         aEvent.preventDefault();
       return;
     }
+#endif
 
     switch (aEvent.type) {
       case "mousedown":
         if (!this.shouldDrag(aEvent))
           return;
 
 #ifdef MOZ_WIDGET_GTK2
         // On GTK, there is a toolkit-level function which handles
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -5490,26 +5490,21 @@ nsWindow::ClientMarginHitTestPoint(int32
                                      kResizableBorderMinSize),
                             std::max(mHorResizeMargin - mNonClientOffset.right,
                                      kResizableBorderMinSize),
                             std::max(mVertResizeMargin - mNonClientOffset.bottom,
                                      kResizableBorderMinSize),
                             std::max(mHorResizeMargin - mNonClientOffset.left,
                                      kResizableBorderMinSize));
 
-  bool allowContentOverride = false;
-  // We can skip content hit testing pre-Vista because there's no Aero Snap
-  // or similar, so there is no need for OS integration:
-  if (WinUtils::GetWindowsVersion() >= WinUtils::VISTA_VERSION) {
-    allowContentOverride = mSizeMode == nsSizeMode_Maximized ||
-                           (mx >= winRect.left + nonClientSize.left &&
-                            mx <= winRect.right - nonClientSize.right &&
-                            my >= winRect.top + nonClientSize.top &&
-                            my <= winRect.bottom - nonClientSize.bottom);
-  }
+  bool allowContentOverride = mSizeMode == nsSizeMode_Maximized ||
+                              (mx >= winRect.left + nonClientSize.left &&
+                               mx <= winRect.right - nonClientSize.right &&
+                               my >= winRect.top + nonClientSize.top &&
+                               my <= winRect.bottom - nonClientSize.bottom);
 
   // The border size.  If there is no content under mouse cursor, the border
   // size should be larger than the values in system settings.  Otherwise,
   // contents under the mouse cursor should be able to override the behavior.
   // E.g., user must expect that Firefox button always opens the popup menu
   // even when the user clicks on the above edge of it.
   nsIntMargin borderSize(std::max(nonClientSize.top,    mVertResizeMargin),
                          std::max(nonClientSize.right,  mHorResizeMargin),