Backed out 2 changesets (bug 956162) for m-oth failures on a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Wed, 22 Jan 2014 14:23:57 -0800
changeset 180807 62adaec0470ba69e6c25bb791d4142e42a4bd4fd
parent 180806 2fbcab3d25fee6b56b5add6a5cc143a1690bb7df
child 180808 d607ee927c695ea2afcf889e4763f983ded72ce9
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs956162
milestone29.0a1
backs out026dc3ee065478bc854d5b04559be3b7d786ab84
0a7e5eeafed63bd065fa1154e83663e8601534d8
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 2 changesets (bug 956162) for m-oth failures on a CLOSED TREE Backed out changeset 026dc3ee0654 (bug 956162) Backed out changeset 0a7e5eeafed6 (bug 956162)
browser/base/content/browser.xul
layout/xul/nsMenuPopupFrame.cpp
layout/xul/nsMenuPopupFrame.h
toolkit/content/tests/chrome/window_panel.xul
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -212,17 +212,16 @@
           <hbox id="UITourTooltipButtons" flex="1" align="end"/>
         </vbox>
       </hbox>
     </panel>
     <panel id="UITourHighlightContainer"
            hidden="true"
            noautofocus="true"
            noautohide="true"
-           flip="none"
            consumeoutsideclicks="false">
       <box id="UITourHighlight"></box>
     </panel>
 
     <panel id="social-share-panel"
            class="social-panel"
            type="arrow"
            orient="horizontal"
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -82,17 +82,17 @@ nsMenuPopupFrame::nsMenuPopupFrame(nsIPr
   mPrefSize(-1, -1),
   mLastClientOffset(0, 0),
   mPopupType(ePopupTypePanel),
   mPopupState(ePopupClosed),
   mPopupAlignment(POPUPALIGNMENT_NONE),
   mPopupAnchor(POPUPALIGNMENT_NONE),
   mPosition(POPUPPOSITION_UNKNOWN),
   mConsumeRollupEvent(nsIPopupBoxObject::ROLLUP_DEFAULT),
-  mFlip(FlipType_Default),
+  mFlipBoth(false),
   mIsOpenChanged(false),
   mIsContextMenu(false),
   mAdjustOffsetForContextMenu(false),
   mGeneratedChildren(false),
   mMenuCanOverlapOSBar(false),
   mShouldAutoPosition(true),
   mInContentShell(true),
   mIsMenuLocked(false),
@@ -576,23 +576,18 @@ nsMenuPopupFrame::InitializePopup(nsICon
         position.Assign(aPosition);
       else
         mXPos = mYPos = 0;
     }
     else if (!aPosition.IsEmpty()) {
       position.Assign(aPosition);
     }
 
-    if (flip.EqualsLiteral("none")) {
-      mFlip = FlipType_None;
-    } else if (flip.EqualsLiteral("both")) {
-      mFlip = FlipType_Both;
-    } else if (flip.EqualsLiteral("slide")) {
-      mFlip = FlipType_Slide;
-    }
+    mFlipBoth = flip.EqualsLiteral("both");
+    mSlide = flip.EqualsLiteral("slide");
 
     position.CompressWhitespace();
     int32_t spaceIdx = position.FindChar(' ');
     // if there is a space in the position, assume it is the anchor and
     // alignment as two separate tokens.
     if (spaceIdx >= 0) {
       InitPositionFromAnchorAlign(Substring(position, 0, spaceIdx), Substring(position, spaceIdx + 1));
     }
@@ -685,34 +680,36 @@ nsMenuPopupFrame::InitializePopupAtScree
 {
   EnsureWidget();
 
   mPopupState = ePopupShowing;
   mAnchorContent = nullptr;
   mTriggerContent = aTriggerContent;
   mScreenXPos = aXPos;
   mScreenYPos = aYPos;
-  mFlip = FlipType_Default;
+  mFlipBoth = false;
+  mSlide = false;
   mPopupAnchor = POPUPALIGNMENT_NONE;
   mPopupAlignment = POPUPALIGNMENT_NONE;
   mIsContextMenu = aIsContextMenu;
   mAdjustOffsetForContextMenu = aIsContextMenu;
 }
 
 void
 nsMenuPopupFrame::InitializePopupWithAnchorAlign(nsIContent* aAnchorContent,
                                                  nsAString& aAnchor,
                                                  nsAString& aAlign,
                                                  int32_t aXPos, int32_t aYPos)
 {
   EnsureWidget();
 
   mPopupState = ePopupShowing;
   mAdjustOffsetForContextMenu = false;
-  mFlip = FlipType_Default;
+  mFlipBoth = false;
+  mSlide = false;
 
   // this popup opening function is provided for backwards compatibility
   // only. It accepts either coordinates or an anchor and alignment value
   // but doesn't use both together.
   if (aXPos == -1 && aYPos == -1) {
     mAnchorContent = aAnchorContent;
     mScreenXPos = -1;
     mScreenYPos = -1;
@@ -979,17 +976,17 @@ nsMenuPopupFrame::AdjustPositionForAncho
       break;
     case POPUPALIGNMENT_TOPCENTER:
     case POPUPALIGNMENT_BOTTOMCENTER:
       aHFlip = FlipStyle_Inside;
       aVFlip = FlipStyle_Outside;
       break;
     default:
     {
-      FlipStyle anchorEdge = mFlip == FlipType_Both ? FlipStyle_Inside : FlipStyle_None;
+      FlipStyle anchorEdge = mFlipBoth ? FlipStyle_Inside : FlipStyle_None;
       aHFlip = (popupAnchor == -popupAlign) ? FlipStyle_Outside : anchorEdge;
       if (((popupAnchor > 0) == (popupAlign > 0)) ||
           (popupAnchor == POPUPALIGNMENT_TOPLEFT && popupAlign == POPUPALIGNMENT_TOPLEFT))
         aVFlip = FlipStyle_Outside;
       else
         aVFlip = anchorEdge;
       break;
     }
@@ -1269,19 +1266,19 @@ nsMenuPopupFrame::SetPopupPosition(nsIFr
     // add the margins on the popup
     screenPoint.MoveBy(margin.left + offsetForContextMenu,
                        margin.top + offsetForContextMenu);
 
     // screen positioned popups can be flipped vertically but never horizontally
     vFlip = FlipStyle_Outside;
   }
 
-  // If a panel is being moved or has flip="none", don't constrain or flip it. But always do this for
+  // If a panel is being moved, don't constrain or flip it. But always do this for
   // content shells, so that the popup doesn't extend outside the containing frame.
-  if (mInContentShell || (mFlip != FlipType_None && (!aIsMove || mPopupType != ePopupTypePanel))) {
+  if (mInContentShell || !aIsMove || mPopupType != ePopupTypePanel) {
     nsRect screenRect = GetConstraintRect(anchorRect, rootScreenRect);
 
     // ensure that anchorRect is on screen
     if (!anchorRect.IntersectRect(anchorRect, screenRect)) {
       anchorRect.width = anchorRect.height = 0;
       // if the anchor isn't within the screen, move it to the edge of the screen.
       if (anchorRect.x < screenRect.x)
         anchorRect.x = screenRect.x;
@@ -1301,17 +1298,17 @@ nsMenuPopupFrame::SetPopupPosition(nsIFr
 
     // at this point the anchor (anchorRect) is within the available screen
     // area (screenRect) and the popup is known to be no larger than the screen.
 
     // We might want to "slide" an arrow if the panel is of the correct type -
     // but we can only slide on one axis - the other axis must be "flipped or
     // resized" as normal.
     bool slideHorizontal = false, slideVertical = false;
-    if (mFlip == FlipType_Slide) {
+    if (mSlide) {
       int8_t position = GetAlignmentPosition();
       slideHorizontal = position >= POPUPPOSITION_BEFORESTART &&
                         position <= POPUPPOSITION_AFTEREND;
       slideVertical = position >= POPUPPOSITION_STARTBEFORE &&
                       position <= POPUPPOSITION_ENDAFTER;
     }
 
     // Next, check if there is enough space to show the popup at full size when
--- a/layout/xul/nsMenuPopupFrame.h
+++ b/layout/xul/nsMenuPopupFrame.h
@@ -60,24 +60,16 @@ enum nsPopupState {
 // a submenu would work. The entire popup is flipped to the opposite side
 // of the anchor.
 enum FlipStyle {
   FlipStyle_None = 0,
   FlipStyle_Outside = 1,
   FlipStyle_Inside = 2
 };
 
-// Values for the flip attribute
-enum FlipType {
-  FlipType_Default = 0,
-  FlipType_None = 1,    // don't try to flip or translate to stay onscreen
-  FlipType_Both = 2,    // flip in both directions
-  FlipType_Slide = 3    // allow the arrow to "slide" instead of resizing
-};
-
 // values are selected so that the direction can be flipped just by
 // changing the sign
 #define POPUPALIGNMENT_NONE 0
 #define POPUPALIGNMENT_TOPLEFT 1
 #define POPUPALIGNMENT_TOPRIGHT -1
 #define POPUPALIGNMENT_BOTTOMLEFT 2
 #define POPUPALIGNMENT_BOTTOMRIGHT -2
 
@@ -462,17 +454,18 @@ protected:
 
   // popup alignment relative to the anchor node
   int8_t mPopupAlignment;
   int8_t mPopupAnchor;
   int8_t mPosition;
 
   // One of nsIPopupBoxObject::ROLLUP_DEFAULT/ROLLUP_CONSUME/ROLLUP_NO_CONSUME
   int8_t mConsumeRollupEvent;
-  FlipType mFlip; // Whether to flip
+  bool mFlipBoth; // flip in both directions
+  bool mSlide; // allow the arrow to "slide" instead of resizing
 
   bool mIsOpenChanged; // true if the open state changed since the last layout
   bool mIsContextMenu; // true for context menus
   // true if we need to offset the popup to ensure it's not under the mouse
   bool mAdjustOffsetForContextMenu;
   bool mGeneratedChildren; // true if the contents have been created
 
   bool mMenuCanOverlapOSBar;    // can we appear over the taskbar/menubar?
--- a/toolkit/content/tests/chrome/window_panel.xul
+++ b/toolkit/content/tests/chrome/window_panel.xul
@@ -249,60 +249,17 @@ var tests = [
         synthesizeMouse(backdragspot, 5, 5, { type: "mousedown" });
         synthesizeMouse(backdragspot, 15, 20, { type: "mousemove" });
         synthesizeMouse(backdragspot, 15, 20, { type: "mouseup" });
 
         is(panel.getOuterScreenRect().left, 210, testname + "left");
         is(panel.getOuterScreenRect().top, 245, testname + "top");
       }
     }
-  },
-  {
-    // The panel should be allowed to appear and remain offscreen
-    testname: "normal panel with flip='none' off-screen",
-    attrs: { "flip": "none" },
-    test: function(panel) {
-      panel.openPopup(document.documentElement, "", -100 - mozInnerScreenX, -100 - mozInnerScreenY, false, false, null);
-    },
-    result: function(testname, panel) {
-      var panelrect = panel.getBoundingClientRect();
-      is(panelrect.left, -100 - mozInnerScreenX, testname + "left");
-      is(panelrect.top, -100 - mozInnerScreenY, testname + "top");
-      is(panelrect.width, 120, testname + "width");
-      is(panelrect.height, 40, testname + "height");
-
-      var screenRect = panel.getOuterScreenRect();
-      is(screenRect.left, -100, testname + " screen left");
-      is(screenRect.top, -100, testname + " screen top");
-      is(screenRect.width, 120, testname + " screen width");
-      is(screenRect.height, 40, testname + " screen height");
-    }
-  },
-  {
-    // The panel should be allowed to remain offscreen after moving and it should follow the anchor
-    testname: "normal panel with flip='none' moved off-screen",
-    attrs: { "flip": "none" },
-    test: function(panel) {
-      panel.openPopup(document.documentElement, "", -100 - mozInnerScreenX, -100 - mozInnerScreenY, false, false, null);
-      window.moveBy(-50, -50);
-    },
-    result: function(testname, panel) {
-      var panelrect = panel.getBoundingClientRect();
-      is(panelrect.left, -150 - mozInnerScreenX, testname + "left");
-      is(panelrect.top, -150 - mozInnerScreenY, testname + "top");
-      is(panelrect.width, 120, testname + "width");
-      is(panelrect.height, 40, testname + "height");
-
-      var screenRect = panel.getOuterScreenRect();
-      is(screenRect.left, -150, testname + " screen left");
-      is(screenRect.top, -150, testname + " screen top");
-      is(screenRect.width, 120, testname + " screen width");
-      is(screenRect.height, 40, testname + " screen height");
-    }
-  },
+  }
 ];
 
 window.opener.wrappedJSObject.SimpleTest.waitForFocus(test_panels, window);
 
 ]]>
 </script>
 
 </window>