Bug 1104036 - Back out -moz-window-dragging (bug 944836, bug 1070038 and bug 1072391) to fix RTL regression (bug 1104036) + non-default-theme regression (bug 1122942). a=sledru
authorMarkus Stange <mstange@themasta.com>
Tue, 20 Jan 2015 14:17:00 -0500
changeset 235765 18ebe6e21ff971c14f298fe88c0180c2f8afbaff
parent 235764 a381215f1e09a3eb1f95737d8ecec6b5c4d93091
child 235766 424c99d64c4b5893e74c1d607916daf5c6921b6b
push id633
push userryanvm@gmail.com
push dateThu, 22 Jan 2015 18:22:17 +0000
treeherdermozilla-release@95eeda368261 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssledru
bugs1104036, 944836, 1070038, 1072391, 1122942
milestone35.0
Bug 1104036 - Back out -moz-window-dragging (bug 944836, bug 1070038 and bug 1072391) to fix RTL regression (bug 1104036) + non-default-theme regression (bug 1122942). a=sledru
browser/themes/osx/browser.css
gfx/src/nsRegion.h
layout/base/nsDisplayList.cpp
layout/base/nsDisplayList.h
layout/base/nsLayoutUtils.cpp
layout/style/nsCSSKeywordList.h
layout/style/nsCSSPropList.h
layout/style/nsCSSProps.cpp
layout/style/nsCSSProps.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
layout/style/nsComputedDOMStylePropertyList.h
layout/style/nsRuleNode.cpp
layout/style/nsStyleConsts.h
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
layout/style/test/property_database.js
layout/xul/nsBoxFrame.cpp
toolkit/content/tests/chrome/window_titlebar.xul
toolkit/content/widgets/general.xml
toolkit/themes/osx/global/global.css
widget/cocoa/nsChildView.h
widget/cocoa/nsChildView.mm
widget/cocoa/nsCocoaWindow.mm
--- a/browser/themes/osx/browser.css
+++ b/browser/themes/osx/browser.css
@@ -70,20 +70,16 @@
 
 #main-window {
   -moz-appearance: none;
   background-color: #eeeeee;
 }
 
 /** Begin titlebar **/
 
-#titlebar {
-  -moz-window-dragging: drag;
-}
-
 #titlebar-buttonbox > .titlebar-button {
   display: none;
 }
 
 /* NB: these would be -moz-margin-start/end if it wasn't for the fact that OS X
  * doesn't reverse the order of the items in the titlebar in RTL mode. */
 .titlebar-placeholder[type="caption-buttons"],
 #titlebar-buttonbox {
--- a/gfx/src/nsRegion.h
+++ b/gfx/src/nsRegion.h
@@ -63,20 +63,16 @@ public:
   nsRegion (const nsRegion& aRegion) { pixman_region32_init(&mImpl); pixman_region32_copy(&mImpl,aRegion.Impl()); }
  ~nsRegion () { pixman_region32_fini(&mImpl); }
   nsRegion& operator = (const nsRect& aRect) { Copy (aRect); return *this; }
   nsRegion& operator = (const nsRegion& aRegion) { Copy (aRegion); return *this; }
   bool operator==(const nsRegion& aRgn) const
   {
     return IsEqual(aRgn);
   }
-  bool operator!=(const nsRegion& aRgn) const
-  {
-    return !(*this == aRgn);
-  }
 
   friend std::ostream& operator<<(std::ostream& stream, const nsRegion& m);
 
   void Swap(nsRegion* aOther)
   {
     pixman_region32_t tmp = mImpl;
     mImpl = aOther->mImpl;
     aOther->mImpl = tmp;
@@ -463,20 +459,16 @@ public:
   nsIntRegion (const nsIntRegion& aRegion) : mImpl (aRegion.mImpl) {}
   nsIntRegion& operator = (const nsIntRect& aRect) { mImpl = ToRect (aRect); return *this; }
   nsIntRegion& operator = (const nsIntRegion& aRegion) { mImpl = aRegion.mImpl; return *this; }
 
   bool operator==(const nsIntRegion& aRgn) const
   {
     return IsEqual(aRgn);
   }
-  bool operator!=(const nsIntRegion& aRgn) const
-  {
-    return !(*this == aRgn);
-  }
 
   friend std::ostream& operator<<(std::ostream& stream, const nsIntRegion& m) {
     return stream << m.mImpl;
   }
 
   void Swap(nsIntRegion* aOther)
   {
     mImpl.Swap(&aOther->mImpl);
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -1065,52 +1065,16 @@ nsDisplayListBuilder::FindReferenceFrame
     }
   }
   if (aOffset) {
     *aOffset = aFrame->GetOffsetToCrossDoc(mReferenceFrame);
   }
   return mReferenceFrame;
 }
 
-void
-nsDisplayListBuilder::AdjustWindowDraggingRegion(nsIFrame* aFrame)
-{
-  if (!IsForPainting() || IsInSubdocument() || IsInTransform()) {
-    return;
-  }
-
-  // We do some basic visibility checking on the frame's border box here.
-  // We intersect it both with the current dirty rect and with the current
-  // clip. Either one is just a conservative approximation on its own, but
-  // their intersection luckily works well enough for our purposes, so that
-  // we don't have to do full-blown visibility computations.
-  // The most important case we need to handle is the scrolled-off tab:
-  // If the tab bar overflows, tab parts that are clipped by the scrollbox
-  // should not be allowed to interfere with the window dragging region. Using
-  // just the current DisplayItemClip is not enough to cover this case
-  // completely because clips are reset while building stacking context
-  // contents, so for example we'd fail to clip frames that have a clip path
-  // applied to them. But the current dirty rect doesn't get reset in that
-  // case, so we use it to make this case work.
-  nsRect borderBox = aFrame->GetRectRelativeToSelf().Intersect(mDirtyRect);
-  borderBox += ToReferenceFrame(aFrame);
-  const DisplayItemClip* clip = ClipState().GetCurrentCombinedClip(this);
-  if (clip) {
-    borderBox = clip->ApplyNonRoundedIntersection(borderBox);
-  }
-  if (!borderBox.IsEmpty()) {
-    const nsStyleUserInterface* styleUI = aFrame->StyleUserInterface();
-    if (styleUI->mWindowDragging == NS_STYLE_WINDOW_DRAGGING_DRAG) {
-      mWindowDraggingRegion.OrWith(borderBox);
-    } else {
-      mWindowDraggingRegion.SubOut(borderBox);
-    }
-  }
-}
-
 void nsDisplayListSet::MoveTo(const nsDisplayListSet& aDestination) const
 {
   aDestination.BorderBackground()->AppendToTop(BorderBackground());
   aDestination.BlockBorderBackgrounds()->AppendToTop(BlockBorderBackgrounds());
   aDestination.Floats()->AppendToTop(Floats());
   aDestination.Content()->AppendToTop(Content());
   aDestination.PositionedDescendants()->AppendToTop(PositionedDescendants());
   aDestination.Outlines()->AppendToTop(Outlines());
@@ -1798,22 +1762,30 @@ nsDisplaySolidColor::WriteDebugInfo(nsAC
                  NS_GET_R(mColor), NS_GET_G(mColor),
                  NS_GET_B(mColor), NS_GET_A(mColor));
 }
 #endif
 
 static void
 RegisterThemeGeometry(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
 {
-  if (!aBuilder->IsInSubdocument() && !aBuilder->IsInTransform()) {
-    nsIFrame* displayRoot = nsLayoutUtils::GetDisplayRootFrame(aFrame);
-    nsRect borderBox(aFrame->GetOffsetTo(displayRoot), aFrame->GetSize());
-    aBuilder->RegisterThemeGeometry(aFrame->StyleDisplay()->mAppearance,
-        borderBox.ToNearestPixels(aFrame->PresContext()->AppUnitsPerDevPixel()));
-  }
+  nsIFrame* displayRoot = nsLayoutUtils::GetDisplayRootFrame(aFrame);
+
+  for (nsIFrame* f = aFrame; f; f = f->GetParent()) {
+    // Bail out if we're in a transformed subtree
+    if (f->IsTransformed())
+      return;
+    // Bail out if we're not in the displayRoot's document
+    if (!f->GetParent() && f != displayRoot)
+      return;
+  }
+
+  nsRect borderBox(aFrame->GetOffsetTo(displayRoot), aFrame->GetSize());
+  aBuilder->RegisterThemeGeometry(aFrame->StyleDisplay()->mAppearance,
+      borderBox.ToNearestPixels(aFrame->PresContext()->AppUnitsPerDevPixel()));
 }
 
 nsDisplayBackgroundImage::nsDisplayBackgroundImage(nsDisplayListBuilder* aBuilder,
                                                    nsIFrame* aFrame,
                                                    uint32_t aLayer,
                                                    const nsStyleBackground* aBackgroundStyle)
   : nsDisplayImageContainer(aBuilder, aFrame)
   , mBackgroundStyle(aBackgroundStyle)
--- a/layout/base/nsDisplayList.h
+++ b/layout/base/nsDisplayList.h
@@ -393,22 +393,16 @@ public:
   bool IsInTransform() const { return mInTransform; }
   /**
    * Indicate whether or not we're directly or indirectly under and
    * nsDisplayTransform or SVG foreignObject.
    */
   void SetInTransform(bool aInTransform) { mInTransform = aInTransform; }
 
   /**
-   * Return true if we're currently building a display list for a
-   * nested presshell.
-   */
-  bool IsInSubdocument() { return mPresShellStates.Length() > 1; }
-
-  /**
    * @return true if images have been set to decode synchronously.
    */
   bool ShouldSyncDecodeImages() { return mSyncDecodeImages; }
 
   /**
    * Indicates whether we should synchronously decode images. If true, we decode
    * and draw whatever image data has been loaded. If false, we just draw
    * whatever has already been decoded.
@@ -475,32 +469,23 @@ public:
    * effects applied to them (e.g. CSS opacity or filters).
    *
    * @param aWidgetType the -moz-appearance value for the themed widget
    * @param aRect the device-pixel rect relative to the widget's displayRoot
    * for the themed widget
    */
   void RegisterThemeGeometry(uint8_t aWidgetType,
                              const nsIntRect& aRect) {
-    if (mIsPaintingToWindow) {
-      mThemeGeometries.AppendElement(ThemeGeometry(aWidgetType, aRect));
+    if (mIsPaintingToWindow && mPresShellStates.Length() == 1) {
+      ThemeGeometry geometry(aWidgetType, aRect);
+      mThemeGeometries.AppendElement(geometry);
     }
   }
 
   /**
-   * Adjusts mWindowDraggingRegion to take into account aFrame. If aFrame's
-   * -moz-window-dragging value is |drag|, its border box is added to the
-   * collected dragging region; if the value is |no-drag|, the border box is
-   * subtracted from the region.
-   */
-  void AdjustWindowDraggingRegion(nsIFrame* aFrame);
-
-  const nsRegion& GetWindowDraggingRegion() { return mWindowDraggingRegion; }
-
-  /**
    * Allocate memory in our arena. It will only be freed when this display list
    * builder is destroyed. This memory holds nsDisplayItems. nsDisplayItem
    * destructors are called as soon as the item is no longer used.
    */
   void* Allocate(size_t aSize);
 
   /**
    * Allocate a new DisplayListClip in the arena. Will be cleaned up
@@ -771,17 +756,16 @@ private:
   // The reference frame for mCurrentFrame.
   const nsIFrame*                mCurrentReferenceFrame;
   // The offset from mCurrentFrame to mCurrentReferenceFrame.
   nsPoint                        mCurrentOffsetToReferenceFrame;
   // Relative to mCurrentFrame.
   nsRect                         mDirtyRect;
   nsRegion                       mWindowExcludeGlassRegion;
   nsRegion                       mWindowOpaqueRegion;
-  nsRegion                       mWindowDraggingRegion;
   // The display item for the Windows window glass background, if any
   nsDisplayItem*                 mGlassDisplayItem;
   nsTArray<DisplayItemClip*>     mDisplayItemClipsToDestroy;
   Mode                           mMode;
   ViewID                         mCurrentScrollParentId;
   ViewID                         mCurrentScrollbarTarget;
   uint32_t                       mCurrentScrollbarFlags;
   BlendModeSet                   mContainedBlendModes;
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -3140,31 +3140,25 @@ nsLayoutUtils::PaintFrame(nsRenderingCon
       fclose(gfxUtils::sDumpPaintFile);
     }
     gfxUtils::sDumpPaintFile = savedDumpFile;
     gPaintCount++;
   }
 #endif
 
   // Update the widget's opaque region information. This sets
-  // glass boundaries on Windows. Also set up the window dragging region
-  // and plugin clip regions and bounds.
+  // glass boundaries on Windows. Also set up plugin clip regions and bounds.
   if ((aFlags & PAINT_WIDGET_LAYERS) &&
       !willFlushRetainedLayers &&
       !(aFlags & PAINT_DOCUMENT_RELATIVE)) {
     nsIWidget *widget = aFrame->GetNearestWidget();
     if (widget) {
-      nsRegion opaqueRegion;
-      opaqueRegion.And(builder.GetWindowExcludeGlassRegion(), builder.GetWindowOpaqueRegion());
-      widget->UpdateOpaqueRegion(
-        opaqueRegion.ToNearestPixels(presContext->AppUnitsPerDevPixel()));
-
-      const nsRegion& draggingRegion = builder.GetWindowDraggingRegion();
-      widget->UpdateWindowDraggingRegion(
-        draggingRegion.ToNearestPixels(presContext->AppUnitsPerDevPixel()));
+       nsRegion excludedRegion = builder.GetWindowOpaqueRegion();
+       nsIntRegion windowRegion(excludedRegion.ToNearestPixels(presContext->AppUnitsPerDevPixel()));
+       widget->UpdateOpaqueRegion(windowRegion);
     }
   }
 
   if (builder.WillComputePluginGeometry()) {
     nsRefPtr<LayerManager> layerManager;
     nsIWidget* widget = aFrame->GetNearestWidget();
     if (widget) {
       layerManager = widget->GetLayerManager();
--- a/layout/style/nsCSSKeywordList.h
+++ b/layout/style/nsCSSKeywordList.h
@@ -225,17 +225,16 @@ CSS_KEY(digits, digits)
 CSS_KEY(disabled, disabled)
 CSS_KEY(disc, disc)
 CSS_KEY(disclosure-closed, disclosure_closed)
 CSS_KEY(disclosure-open, disclosure_open)
 CSS_KEY(discretionary-ligatures, discretionary_ligatures)
 CSS_KEY(dotted, dotted)
 CSS_KEY(double, double)
 CSS_KEY(double-struck, double_struck)
-CSS_KEY(drag, drag)
 CSS_KEY(drop-shadow, drop_shadow)
 CSS_KEY(e-resize, e_resize)
 CSS_KEY(ease, ease)
 CSS_KEY(ease-in, ease_in)
 CSS_KEY(ease-in-out, ease_in_out)
 CSS_KEY(ease-out, ease_out)
 CSS_KEY(element, element)
 CSS_KEY(elements, elements)
@@ -366,17 +365,16 @@ CSS_KEY(multiply, multiply)
 CSS_KEY(n-resize, n_resize)
 CSS_KEY(narrower, narrower)
 CSS_KEY(ne-resize, ne_resize)
 CSS_KEY(nesw-resize, nesw_resize)
 CSS_KEY(no-close-quote, no_close_quote)
 CSS_KEY(no-common-ligatures, no_common_ligatures)
 CSS_KEY(no-contextual, no_contextual)
 CSS_KEY(no-discretionary-ligatures, no_discretionary_ligatures)
-CSS_KEY(no-drag, no_drag)
 CSS_KEY(no-drop, no_drop)
 CSS_KEY(no-historical-ligatures, no_historical_ligatures)
 CSS_KEY(no-open-quote, no_open_quote)
 CSS_KEY(no-repeat, no_repeat)
 CSS_KEY(none, none)
 CSS_KEY(normal, normal)
 CSS_KEY(not-allowed, not_allowed)
 CSS_KEY(nowrap, nowrap)
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -3381,26 +3381,16 @@ CSS_PROP_POSITION(
         CSS_PROPERTY_STORES_CALC |
         CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
         CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
     "",
     VARIANT_AHKLP | VARIANT_CALC,
     kWidthKTable,
     offsetof(nsStylePosition, mWidth),
     eStyleAnimType_Coord)
-CSS_PROP_USERINTERFACE(
-    -moz-window-dragging,
-    _moz_window_dragging,
-    CSS_PROP_DOMPROP_PREFIXED(WindowDragging),
-    CSS_PROPERTY_PARSE_VALUE,
-    "",
-    VARIANT_HK,
-    kWindowDraggingKTable,
-    CSS_PROP_NO_OFFSET,
-    eStyleAnimType_None)
 CSS_PROP_UIRESET(
     -moz-window-shadow,
     _moz_window_shadow,
     CSS_PROP_DOMPROP_PREFIXED(WindowShadow),
     CSS_PROPERTY_PARSE_VALUE,
     "",
     VARIANT_HK,
     kWindowShadowKTable,
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -1768,22 +1768,16 @@ const KTableValue nsCSSProps::kWhitespac
 const KTableValue nsCSSProps::kWidthKTable[] = {
   eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT,
   eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT,
   eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT,
   eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE,
   eCSSKeyword_UNKNOWN,-1
 };
 
-const KTableValue nsCSSProps::kWindowDraggingKTable[] = {
-  eCSSKeyword_drag, NS_STYLE_WINDOW_DRAGGING_DRAG,
-  eCSSKeyword_no_drag, NS_STYLE_WINDOW_DRAGGING_NO_DRAG,
-  eCSSKeyword_UNKNOWN,-1
-};
-
 const KTableValue nsCSSProps::kWindowShadowKTable[] = {
   eCSSKeyword_none, NS_STYLE_WINDOW_SHADOW_NONE,
   eCSSKeyword_default, NS_STYLE_WINDOW_SHADOW_DEFAULT,
   eCSSKeyword_menu, NS_STYLE_WINDOW_SHADOW_MENU,
   eCSSKeyword_tooltip, NS_STYLE_WINDOW_SHADOW_TOOLTIP,
   eCSSKeyword_sheet, NS_STYLE_WINDOW_SHADOW_SHEET,
   eCSSKeyword_UNKNOWN,-1
 };
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -645,17 +645,16 @@ public:
   static const KTableValue kUserInputKTable[];
   static const KTableValue kUserModifyKTable[];
   static const KTableValue kUserSelectKTable[];
   static const KTableValue kVerticalAlignKTable[];
   static const KTableValue kVisibilityKTable[];
   static const KTableValue kVolumeKTable[];
   static const KTableValue kWhitespaceKTable[];
   static const KTableValue kWidthKTable[]; // also min-width, max-width
-  static const KTableValue kWindowDraggingKTable[];
   static const KTableValue kWindowShadowKTable[];
   static const KTableValue kWordBreakKTable[];
   static const KTableValue kWordWrapKTable[];
   static const KTableValue kWritingModeKTable[];
   static const KTableValue kHyphensKTable[];
   static const KTableValue kCounterSystemKTable[];
   static const KTableValue kCounterSymbolsSystemKTable[];
   static const KTableValue kCounterRangeKTable[];
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -3325,26 +3325,16 @@ nsComputedDOMStyle::DoGetWhiteSpace()
   nsROCSSPrimitiveValue *val = new nsROCSSPrimitiveValue;
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(StyleText()->mWhiteSpace,
                                    nsCSSProps::kWhitespaceKTable));
   return val;
 }
 
 CSSValue*
-nsComputedDOMStyle::DoGetWindowDragging()
-{
-  nsROCSSPrimitiveValue *val = new nsROCSSPrimitiveValue;
-  val->SetIdent(
-    nsCSSProps::ValueToKeywordEnum(StyleUserInterface()->mWindowDragging,
-                                   nsCSSProps::kWindowDraggingKTable));
-  return val;
-}
-
-CSSValue*
 nsComputedDOMStyle::DoGetWindowShadow()
 {
   nsROCSSPrimitiveValue *val = new nsROCSSPrimitiveValue;
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(StyleUIReset()->mWindowShadow,
                                    nsCSSProps::kWindowShadowKTable));
   return val;
 }
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -433,17 +433,16 @@ private:
   /* User interface properties */
   mozilla::dom::CSSValue* DoGetCursor();
   mozilla::dom::CSSValue* DoGetForceBrokenImageIcon();
   mozilla::dom::CSSValue* DoGetIMEMode();
   mozilla::dom::CSSValue* DoGetUserFocus();
   mozilla::dom::CSSValue* DoGetUserInput();
   mozilla::dom::CSSValue* DoGetUserModify();
   mozilla::dom::CSSValue* DoGetUserSelect();
-  mozilla::dom::CSSValue* DoGetWindowDragging();
 
   /* Column properties */
   mozilla::dom::CSSValue* DoGetColumnCount();
   mozilla::dom::CSSValue* DoGetColumnFill();
   mozilla::dom::CSSValue* DoGetColumnWidth();
   mozilla::dom::CSSValue* DoGetColumnGap();
   mozilla::dom::CSSValue* DoGetColumnRuleWidth();
   mozilla::dom::CSSValue* DoGetColumnRuleStyle();
--- a/layout/style/nsComputedDOMStylePropertyList.h
+++ b/layout/style/nsComputedDOMStylePropertyList.h
@@ -269,17 +269,16 @@ COMPUTED_STYLE_PROP(text_align_last,    
 COMPUTED_STYLE_PROP(text_decoration_color,         TextDecorationColor)
 COMPUTED_STYLE_PROP(text_decoration_line,          TextDecorationLine)
 COMPUTED_STYLE_PROP(text_decoration_style,         TextDecorationStyle)
 COMPUTED_STYLE_PROP(text_size_adjust,              TextSizeAdjust)
 COMPUTED_STYLE_PROP(user_focus,                    UserFocus)
 COMPUTED_STYLE_PROP(user_input,                    UserInput)
 COMPUTED_STYLE_PROP(user_modify,                   UserModify)
 COMPUTED_STYLE_PROP(user_select,                   UserSelect)
-COMPUTED_STYLE_PROP(_moz_window_dragging,          WindowDragging)
 COMPUTED_STYLE_PROP(_moz_window_shadow,            WindowShadow)
 
 /* ***************************** *\
  * Implementations of SVG styles *
 \* ***************************** */
 
 COMPUTED_STYLE_PROP(clip_path,                     ClipPath)
 COMPUTED_STYLE_PROP(clip_rule,                     ClipRule)
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -4643,23 +4643,16 @@ nsRuleNode::ComputeUserInterfaceData(voi
 
   // user-focus: enum, inherit, initial
   SetDiscrete(*aRuleData->ValueForUserFocus(),
               ui->mUserFocus, canStoreInRuleTree,
               SETDSC_ENUMERATED | SETDSC_UNSET_INHERIT,
               parentUI->mUserFocus,
               NS_STYLE_USER_FOCUS_NONE, 0, 0, 0, 0);
 
-  // -moz-window-dragging: enum, inherit, initial
-  SetDiscrete(*aRuleData->ValueForWindowDragging(),
-              ui->mWindowDragging, canStoreInRuleTree,
-              SETDSC_ENUMERATED | SETDSC_UNSET_INHERIT,
-              parentUI->mWindowDragging,
-              NS_STYLE_WINDOW_DRAGGING_NO_DRAG, 0, 0, 0, 0);
-
   COMPUTE_END_INHERITED(UserInterface, ui)
 }
 
 const void*
 nsRuleNode::ComputeUIResetData(void* aStartStruct,
                                const nsRuleData* aRuleData,
                                nsStyleContext* aContext,
                                nsRuleNode* aHighestNode,
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -116,20 +116,16 @@ static inline mozilla::css::Side operato
 #define NS_STYLE_USER_INPUT_DISABLED  2
 #define NS_STYLE_USER_INPUT_AUTO      3
 
 // user-modify
 #define NS_STYLE_USER_MODIFY_READ_ONLY   0
 #define NS_STYLE_USER_MODIFY_READ_WRITE  1
 #define NS_STYLE_USER_MODIFY_WRITE_ONLY  2
 
-// -moz-window-dragging
-#define NS_STYLE_WINDOW_DRAGGING_DRAG    0
-#define NS_STYLE_WINDOW_DRAGGING_NO_DRAG 1
-
 // box-align
 #define NS_STYLE_BOX_ALIGN_STRETCH     0
 #define NS_STYLE_BOX_ALIGN_START       1
 #define NS_STYLE_BOX_ALIGN_CENTER      2
 #define NS_STYLE_BOX_ALIGN_BASELINE    3
 #define NS_STYLE_BOX_ALIGN_END         4
 
 // box-pack
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -3438,29 +3438,27 @@ nsCursorImage::operator=(const nsCursorI
 }
 
 nsStyleUserInterface::nsStyleUserInterface(void) 
 { 
   MOZ_COUNT_CTOR(nsStyleUserInterface);
   mUserInput = NS_STYLE_USER_INPUT_AUTO;
   mUserModify = NS_STYLE_USER_MODIFY_READ_ONLY;
   mUserFocus = NS_STYLE_USER_FOCUS_NONE;
-  mWindowDragging = NS_STYLE_WINDOW_DRAGGING_NO_DRAG;
 
   mCursor = NS_STYLE_CURSOR_AUTO; // fix for bugzilla bug 51113
 
   mCursorArrayLength = 0;
   mCursorArray = nullptr;
 }
 
 nsStyleUserInterface::nsStyleUserInterface(const nsStyleUserInterface& aSource) :
   mUserInput(aSource.mUserInput),
   mUserModify(aSource.mUserModify),
   mUserFocus(aSource.mUserFocus),
-  mWindowDragging(aSource.mWindowDragging),
   mCursor(aSource.mCursor)
 { 
   MOZ_COUNT_CTOR(nsStyleUserInterface);
   CopyCursorArrayFrom(aSource);
 }
 
 nsStyleUserInterface::~nsStyleUserInterface(void) 
 { 
@@ -3490,20 +3488,16 @@ nsChangeHint nsStyleUserInterface::CalcD
       NS_UpdateHint(hint, nsChangeHint_NeutralChange);
     }
   }
 
   if (mUserFocus != aOther.mUserFocus) {
     NS_UpdateHint(hint, nsChangeHint_NeutralChange);
   }
 
-  if (mWindowDragging != aOther.mWindowDragging) {
-    NS_UpdateHint(hint, nsChangeHint_SchedulePaint);
-  }
-
   return hint;
 }
 
 void
 nsStyleUserInterface::CopyCursorArrayFrom(const nsStyleUserInterface& aSource)
 {
   mCursorArray = nullptr;
   mCursorArrayLength = 0;
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -2594,17 +2594,16 @@ struct nsStyleUserInterface {
     // nsChangeHint_ClearAncestorIntrinsics as inherited hints.
     return NS_CombineHint(nsChangeHint_NeedReflow,
                           nsChangeHint_ClearAncestorIntrinsics);
   }
 
   uint8_t   mUserInput;       // [inherited]
   uint8_t   mUserModify;      // [inherited] (modify-content)
   uint8_t   mUserFocus;       // [inherited] (auto-select)
-  uint8_t   mWindowDragging;  // [inherited]
 
   uint8_t   mCursor;          // [inherited] See nsStyleConsts.h
 
   uint32_t mCursorArrayLength;
   nsCursorImage *mCursorArray;// [inherited] The specified URL values
                               //   and coordinates.  Takes precedence over
                               //   mCursor.  Zero-length array is represented
                               //   by null pointer.
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -1778,24 +1778,16 @@ var gCSSProperties = {
   "-moz-user-select": {
     domProp: "MozUserSelect",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "auto" ],
     other_values: [ "none", "text", "element", "elements", "all", "toggle", "tri-state", "-moz-all", "-moz-none" ],
     invalid_values: []
   },
-  "-moz-window-dragging": {
-    domProp: "MozWindowDragging",
-    inherited: true,
-    type: CSS_TYPE_LONGHAND,
-    initial_values: [ "no-drag" ],
-    other_values: [ "drag" ],
-    invalid_values: [ "none" ]
-  },
   "-moz-window-shadow": {
     domProp: "MozWindowShadow",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "default" ],
     other_values: [ "none", "menu", "tooltip", "sheet" ],
     invalid_values: []
   },
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -1323,18 +1323,16 @@ nsBoxFrame::BuildDisplayList(nsDisplayLi
     }
     // Check for frames that are marked as a part of the region used
     // in calculating glass margins on Windows.
     const nsStyleDisplay* styles = StyleDisplay();
     if (styles && styles->mAppearance == NS_THEME_WIN_EXCLUDE_GLASS) {
       aBuilder->AddWindowExcludeGlassRegion(
           nsRect(aBuilder->ToReferenceFrame(this), GetSize()));
     }
-
-    aBuilder->AdjustWindowDraggingRegion(this);
   }
 
   nsDisplayListCollection tempLists;
   const nsDisplayListSet& destination = forceLayer ? tempLists : aLists;
 
   DisplayBorderBackgroundOutline(aBuilder, destination);
 
 #ifdef DEBUG_LAYOUT
--- a/toolkit/content/tests/chrome/window_titlebar.xul
+++ b/toolkit/content/tests/chrome/window_titlebar.xul
@@ -44,16 +44,21 @@
   <panel id="panelfloating" noautohide="true" level="floating"
          onpopupshown="popupshown(this, false)" onpopuphidden="popuphidden('')">
     <titlebar>
       <label id="panellabelfloating" value="Titlebar"/>
     </titlebar>
   </panel>
 
   <button id="button" label="OK"/>
+  <statusbar id="statusbar">
+    <statusbarpanel>
+      <label id="statuslabel" value="Status"/>
+    </statusbarpanel>
+  </statusbar>
 
 <script>
 <![CDATA[
 
 var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
 
 SimpleTest.waitForFocus(test_titlebar, window);
 
@@ -95,16 +100,30 @@ function waitForWindowMove(element, x, y
   }
 }
 
 function test_titlebar()
 {
   var titlebar = document.getElementById("titlebar");
   var label = document.getElementById("label");
 
+  // On Mac, the window can also be moved with the statusbar, but this works
+  // via the MozMouseHittest event, not via mouse events.
+  if (navigator.platform.indexOf("Mac") >= 0) {
+    var preventDefaulted;
+
+    var statuslabel = document.getElementById("statuslabel");
+    preventDefaulted = synthesizeMouse(statuslabel, 2, 2, { type: "MozMouseHittest" });
+    SimpleTest.ok(preventDefaulted, "MozMouseHittest should have been defaultPrevented over statusbar");
+
+    var button = document.getElementById("button");
+    preventDefaulted = synthesizeMouse(button, 2, 2, { type: "MozMouseHittest" });
+    SimpleTest.ok(!preventDefaulted, "MozMouseHittest should NOT have been defaultPrevented over button");
+  }
+
   origoldx = window.screenX;
   origoldy = window.screenY;
 
   var mousedownListener = function (event) mouseDownTarget = event.originalTarget;
   window.addEventListener("mousedown", mousedownListener, false);
   synthesizeMouse(label, 2, 2, { type: "mousedown" });
   SimpleTest.is(mouseDownTarget, titlebar, "movedown on titlebar");
   waitForWindowMove(label, 22, 22, test_titlebar_step2, mousedownListener);
--- a/toolkit/content/widgets/general.xml
+++ b/toolkit/content/widgets/general.xml
@@ -130,16 +130,34 @@
   <binding id="statusbar" role="xul:statusbar">
     <content>
       <children/>
       <xul:statusbarpanel class="statusbar-resizerpanel">
         <xul:resizer dir="bottomend"/>
       </xul:statusbarpanel>
     </content>
   </binding>
+  
+  <binding id="statusbar-drag"
+           extends="chrome://global/content/bindings/general.xml#statusbar">
+    <implementation>
+      <field name="_dragBindingAlive">true</field>
+      <constructor>
+        if (!this._draggableStarted) {
+          this._draggableStarted = true;
+          try {
+            let tmp = {};
+            Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
+            let draghandle = new tmp.WindowDraggingElement(this);
+            draghandle.mouseDownCheck = function () this._dragBindingAlive;
+          } catch (e) {}
+        }
+      </constructor>
+    </implementation>
+  </binding>
 
   <binding id="statusbarpanel-iconic" display="xul:button" role="xul:button"
            extends="chrome://global/content/bindings/general.xml#statusbarpanel">
     <content>
       <xul:image class="statusbarpanel-icon" xbl:inherits="src,src=image"/>
     </content>
   </binding>
 
--- a/toolkit/themes/osx/global/global.css
+++ b/toolkit/themes/osx/global/global.css
@@ -11,32 +11,26 @@
 /* ::::: XBL bindings ::::: */
 
 menulist > menupopup {
   -moz-binding: url("chrome://global/content/bindings/popup.xml#popup-scrollbars");
 }
 
 /* ::::: draggable elements ::::: */
 
-titlebar,
-toolbar:not([nowindowdrag="true"]):not([customizing="true"]),
-statusbar:not([nowindowdrag="true"]),
-windowdragbox {
-  -moz-window-dragging: drag;
+toolbar:not([nowindowdrag="true"]) {
+  -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
 }
 
-/* The list below is non-comprehensive and will probably need some tweaking. */
-toolbarbutton,
-button,
-textbox,
-searchbar,
-tab,
-radio,
-splitter {
-  -moz-window-dragging: no-drag;
+statusbar:not([nowindowdrag="true"]) {
+  -moz-binding: url("chrome://global/content/bindings/general.xml#statusbar-drag");
+}
+
+windowdragbox {
+  -moz-binding: url("chrome://global/content/bindings/general.xml#windowdragbox");
 }
 
 /* ::::: root elements ::::: */
 
 window,
 page,
 dialog,
 wizard,
--- a/widget/cocoa/nsChildView.h
+++ b/widget/cocoa/nsChildView.h
@@ -314,16 +314,18 @@ typedef NSInteger NSEventGestureAxis;
 
 // Stop NSView hierarchy being changed during [ChildView drawRect:]
 - (void)delayedTearDown;
 
 - (void)sendFocusEvent:(uint32_t)eventType;
 
 - (void)handleMouseMoved:(NSEvent*)aEvent;
 
+- (void)updateWindowDraggableStateOnMouseMove:(NSEvent*)theEvent;
+
 - (void)sendMouseEnterOrExitEvent:(NSEvent*)aEvent
                             enter:(BOOL)aEnter
                              type:(mozilla::WidgetMouseEvent::exitType)aType;
 
 - (void)updateGLContext;
 - (void)_surfaceNeedsUpdate:(NSNotification*)notification;
 
 - (BOOL)isPluginView;
@@ -552,19 +554,16 @@ public:
   virtual void PrepareWindowEffects() MOZ_OVERRIDE;
   virtual void CleanupWindowEffects() MOZ_OVERRIDE;
   virtual bool PreRender(LayerManagerComposite* aManager) MOZ_OVERRIDE;
   virtual void PostRender(LayerManagerComposite* aManager) MOZ_OVERRIDE;
   virtual void DrawWindowOverlay(LayerManagerComposite* aManager, nsIntRect aRect) MOZ_OVERRIDE;
 
   virtual void UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries);
 
-  virtual void UpdateWindowDraggingRegion(const nsIntRegion& aRegion) MOZ_OVERRIDE;
-  const nsIntRegion& GetDraggableRegion() { return mDraggableRegion; }
-
   void              HidePlugin();
   void              UpdatePluginPort();
 
   void              ResetParent();
 
   static bool DoHasPendingInputEvent();
   static uint32_t GetCurrentInputEventCount();
   static void UpdateCurrentInputEventCount();
@@ -686,18 +685,16 @@ protected:
   nsAutoPtr<RectTextureImage> mCornerMaskImage;
   nsAutoPtr<RectTextureImage> mTitlebarImage;
   nsAutoPtr<RectTextureImage> mBasicCompositorImage;
 
   // The area of mTitlebarCGContext that has changed and needs to be
   // uploaded to to mTitlebarImage. Main thread only.
   nsIntRegion           mDirtyTitlebarRegion;
 
-  nsIntRegion           mDraggableRegion;
-
   // Cached value of [mView backingScaleFactor], to avoid sending two obj-c
   // messages (respondsToSelector, backingScaleFactor) every time we need to
   // use it.
   // ** We'll need to reinitialize this if the backing resolution changes. **
   mutable CGFloat       mBackingScaleFactor;
 
   bool                  mVisible;
   bool                  mDrawing;
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -113,17 +113,16 @@ PRLogModuleInfo* sCocoaLog = nullptr;
 
 extern "C" {
   CG_EXTERN void CGContextResetCTM(CGContextRef);
   CG_EXTERN void CGContextSetCTM(CGContextRef, CGAffineTransform);
   CG_EXTERN void CGContextResetClip(CGContextRef);
 
   typedef CFTypeRef CGSRegionObj;
   CGError CGSNewRegionWithRect(const CGRect *rect, CGSRegionObj *outRegion);
-  CGError CGSNewRegionWithRectList(const CGRect *rects, int rectCount, CGSRegionObj *outRegion);
 }
 
 // defined in nsMenuBarX.mm
 extern NSMenu* sApplicationMenu; // Application menu shared by all menubars
 
 bool gChildViewMethodsSwizzled = false;
 
 extern nsISupportsArray *gDraggedTransferables;
@@ -196,17 +195,16 @@ static uint32_t gNumberOfWidgetsNeedingE
 #ifdef ACCESSIBILITY
 - (id<mozAccessible>)accessible;
 #endif
 
 - (nsIntPoint)convertWindowCoordinates:(NSPoint)aPoint;
 - (APZCTreeManager*)apzctm;
 
 - (BOOL)inactiveWindowAcceptsMouseEvent:(NSEvent*)aEvent;
-- (void)updateWindowDraggableState;
 
 @end
 
 @interface EventThreadRunner : NSObject
 {
   NSThread* mThread;
 }
 - (id)init;
@@ -215,21 +213,16 @@ static uint32_t gNumberOfWidgetsNeedingE
 + (void)stop;
 
 @end
 
 @interface NSView(NSThemeFrameCornerRadius)
 - (float)roundedCornerRadius;
 @end
 
-@interface NSView(DraggableRegion)
-- (CGSRegionObj)_regionForOpaqueDescendants:(NSRect)aRect forMove:(BOOL)aForMove;
-- (CGSRegionObj)_regionForOpaqueDescendants:(NSRect)aRect forMove:(BOOL)aForMove forUnderTitlebar:(BOOL)aForUnderTitlebar;
-@end
-
 // Starting with 10.7 the bottom corners of all windows are rounded.
 // Unfortunately, the standard rounding that OS X applies to OpenGL views
 // does not use anti-aliasing and looks very crude. Since we want a smooth,
 // anti-aliased curve, we'll draw it ourselves.
 // Additionally, we need to turn off the OS-supplied rounding because it
 // eats into our corner's curve. We do that by overriding an NSSurface method.
 @interface NSSurface @end
 
@@ -2740,25 +2733,16 @@ nsChildView::DoRemoteComposition(const n
   // anything during the basic compositor transaction. Draw the overlay now.
   DrawWindowOverlay(mGLPresenter, aRenderRect);
 
   mGLPresenter->EndFrame();
 
   [(ChildView*)mView postRender:mGLPresenter->GetNSOpenGLContext()];
 }
 
-void
-nsChildView::UpdateWindowDraggingRegion(const nsIntRegion& aRegion)
-{
-  if (mDraggableRegion != aRegion) {
-    mDraggableRegion = aRegion;
-    [(ChildView*)mView updateWindowDraggableState];
-  }
-}
-
 #ifdef ACCESSIBILITY
 already_AddRefed<a11y::Accessible>
 nsChildView::GetDocumentAccessible()
 {
   if (!mozilla::a11y::ShouldA11yBeEnabled())
     return nullptr;
 
   if (mAccessible) {
@@ -3603,19 +3587,17 @@ NSEvent* gLastDragMouseDownEvent = nil;
   }
   [super scrollRect:aRect by:offset];
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 - (BOOL)mouseDownCanMoveWindow
 {
-  // Return YES so that _regionForOpaqueDescendants gets called, where the
-  // actual draggable region will be assembled.
-  return YES;
+  return [[self window] isMovableByWindowBackground];
 }
 
 -(void)updateGLContext
 {
   if (mGLContext) {
     CGLLockContext((CGLContextObj)[mGLContext CGLContextObj]);
     [mGLContext setView:self];
     [mGLContext update];
@@ -4840,19 +4822,18 @@ NSEvent* gLastDragMouseDownEvent = nil;
                                            NPCocoaEventMouseUp,
                                            &cocoaEvent);
 
   // This might destroy our widget (and null out mGeckoChild).
   bool defaultPrevented = mGeckoChild->DispatchWindowEvent(geckoEvent);
 
   // Check to see if we are double-clicking in the titlebar.
   CGFloat locationInTitlebar = [[self window] frame].size.height - [theEvent locationInWindow].y;
-  LayoutDeviceIntPoint pos = geckoEvent.refPoint;
   if (!defaultPrevented && [theEvent clickCount] == 2 &&
-      mGeckoChild->GetDraggableRegion().Contains(pos.x, pos.y) &&
+      [[self window] isMovableByWindowBackground] &&
       [self shouldMinimizeOnTitlebarDoubleClick] &&
       [[self window] isKindOfClass:[ToolbarWindow class]] &&
       (locationInTitlebar < [(ToolbarWindow*)[self window] titlebarHeight] ||
        locationInTitlebar < [(ToolbarWindow*)[self window] unifiedToolbarHeight])) {
 
     NSButton *minimizeButton = [[self window] standardWindowButton:NSWindowMiniaturizeButton];
     [minimizeButton performClick:self];
   }
@@ -4892,87 +4873,34 @@ NSEvent* gLastDragMouseDownEvent = nil;
                                            &cocoaEvent);
 
   event.exit = aType;
 
   nsEventStatus status; // ignored
   mGeckoChild->DispatchEvent(&event, status);
 }
 
-- (void)updateWindowDraggableState
-{
-  // Trigger update to the window server.
-  [[self window] setMovableByWindowBackground:NO];
-  [[self window] setMovableByWindowBackground:YES];
-}
-
-// aRect is in view coordinates relative to this NSView.
-- (CGRect)convertToFlippedWindowCoordinates:(NSRect)aRect
-{
-  // First, convert the rect to regular window coordinates...
-  NSRect inWindowCoords = [self convertRect:aRect toView:nil];
-  // ... and then flip it again because window coordinates have their origin
-  // in the bottom left corner, and we need it to be in the top left corner.
-  inWindowCoords.origin.y = [[self window] frame].size.height - NSMaxY(inWindowCoords);
-  return NSRectToCGRect(inWindowCoords);
-}
-
-static CGSRegionObj
-NewCGSRegionFromRegion(const nsIntRegion& aRegion,
-                       CGRect (^aRectConverter)(const nsIntRect&))
-{
-  nsTArray<CGRect> rects;
-  nsIntRegionRectIterator iter(aRegion);
-  for (;;) {
-    const nsIntRect* r = iter.Next();
-    if (!r)
-      break;
-    rects.AppendElement(aRectConverter(*r));
-  }
-
-  CGSRegionObj region;
-  CGSNewRegionWithRectList(rects.Elements(), rects.Length(), &region);
-  return region;
-}
-
-// This function is called with forMove:YES to calculate the draggable region
-// of the window which will be submitted to the window server. Window dragging
-// is handled on the window server without calling back into our process, so it
-// also works while our app is unresponsive.
-- (CGSRegionObj)_regionForOpaqueDescendants:(NSRect)aRect forMove:(BOOL)aForMove
-{
-  if (!aForMove || !mGeckoChild) {
-    return [super _regionForOpaqueDescendants:aRect forMove:aForMove];
-  }
-
-  nsIntRect boundingRect = mGeckoChild->CocoaPointsToDevPixels(aRect);
-
-  nsIntRegion opaqueRegion;
-  opaqueRegion.Sub(boundingRect, mGeckoChild->GetDraggableRegion());
-
-  return NewCGSRegionFromRegion(opaqueRegion, ^(const nsIntRect& r) {
-    return [self convertToFlippedWindowCoordinates:mGeckoChild->DevPixelsToCocoaPoints(r)];
-  });
-}
-
-// Starting with 10.10, in addition to the traditional
-// -[NSView _regionForOpaqueDescendants:forMove:] method, there's a new form with
-// an additional forUnderTitlebar argument, which is sometimes called instead of
-// the old form. We need to override the new variant as well.
-- (CGSRegionObj)_regionForOpaqueDescendants:(NSRect)aRect
-                                    forMove:(BOOL)aForMove
-                           forUnderTitlebar:(BOOL)aForUnderTitlebar
-{
-  if (!aForMove || !mGeckoChild) {
-    return [super _regionForOpaqueDescendants:aRect
-                                      forMove:aForMove
-                             forUnderTitlebar:aForUnderTitlebar];
-  }
-
-  return [self _regionForOpaqueDescendants:aRect forMove:aForMove];
+- (void)updateWindowDraggableStateOnMouseMove:(NSEvent*)theEvent
+{
+  if (!theEvent || !mGeckoChild) {
+    return;
+  }
+
+  nsCocoaWindow* windowWidget = mGeckoChild->GetXULWindowWidget();
+  if (!windowWidget) {
+    return;
+  }
+
+  // We assume later on that sending a hit test event won't cause widget destruction.
+  WidgetMouseEvent hitTestEvent(true, NS_MOUSE_MOZHITTEST, mGeckoChild,
+                                WidgetMouseEvent::eReal);
+  [self convertCocoaMouseEvent:theEvent toGeckoEvent:&hitTestEvent];
+  bool result = mGeckoChild->DispatchWindowEvent(hitTestEvent);
+
+  [windowWidget->GetCocoaWindow() setMovableByWindowBackground:result];
 }
 
 - (void)handleMouseMoved:(NSEvent*)theEvent
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   if (!mGeckoChild)
     return;
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -3328,16 +3328,19 @@ static const NSString* kStateShowsToolba
     {
       // Drop all mouse events if a modal window has appeared above us.
       // This helps make us behave as if the OS were running a "real" modal
       // event loop.
       id delegate = [self delegate];
       if (delegate && [delegate isKindOfClass:[WindowDelegate class]]) {
         nsCocoaWindow *widget = [(WindowDelegate *)delegate geckoWidget];
         if (widget) {
+          if (type == NSMouseMoved) {
+            [[self mainChildView] updateWindowDraggableStateOnMouseMove:anEvent];
+          }
           if (gGeckoAppModalWindowList && (widget != gGeckoAppModalWindowList->window))
             return;
           if (widget->HasModalDescendents())
             return;
         }
       }
       break;
     }