Backed out changeset 4488424e14ae for causing Bug 1377802. r=tnikkel
authorJohann Hofmann <jhofmann@mozilla.com>
Tue, 11 Jul 2017 23:18:35 +0200
changeset 368457 632562f2d03bedc006eeb3b71e54b9276d6693a5
parent 368456 657535622b207dfc417f8a17736ed85f760758de
child 368458 01b617a43277fa13059dd1d40bd47c693643f902
push id32164
push userkwierso@gmail.com
push dateThu, 13 Jul 2017 00:58:33 +0000
treeherdermozilla-central@30ea2905130e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1377802
milestone56.0a1
backs out4488424e14ae3230fb773903343253944f4b4f5e
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 4488424e14ae for causing Bug 1377802. r=tnikkel MozReview-Commit-ID: 8KUWWoWvCvF
layout/xul/nsMenuPopupFrame.cpp
toolkit/content/tests/chrome/window_panel_anchoradjust.xul
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -2556,23 +2556,21 @@ nsMenuPopupFrame::ShouldFollowAnchor()
 bool
 nsMenuPopupFrame::ShouldFollowAnchor(nsRect& aRect)
 {
   if (!ShouldFollowAnchor()) {
     return false;
   }
 
   nsIFrame* anchorFrame = mAnchorContent->GetPrimaryFrame();
-  if (!anchorFrame) {
-    return false;
-  }
-
-  nsPresContext* rootPresContext = PresContext()->GetRootPresContext();
-  if (rootPresContext) {
-    aRect = ComputeAnchorRect(rootPresContext, anchorFrame);
+  if (anchorFrame) {
+    nsPresContext* rootPresContext = PresContext()->GetRootPresContext();
+    if (rootPresContext) {
+      aRect = ComputeAnchorRect(rootPresContext, anchorFrame);
+    }
   }
 
   return true;
 }
 
 void
 nsMenuPopupFrame::CheckForAnchorChange(nsRect& aRect)
 {
--- a/toolkit/content/tests/chrome/window_panel_anchoradjust.xul
+++ b/toolkit/content/tests/chrome/window_panel_anchoradjust.xul
@@ -27,19 +27,16 @@
 </panel>
 
 <menupopup id="menupopup">
   <menuitem label="One"/>
   <menuitem id="menuanchor" label="Two"/>
   <menuitem label="Three"/>
 </menupopup>
 
-<button id="anchorhidden" label="HiddenAnchor" hidden="true"/>
-<button id="anchorextra" label="ExtraAnchor"/>
-
 <script type="application/javascript"><![CDATA[
 
 
 SimpleTest.waitForExplicitFinish();
 
 function next()
 {
   return new Promise(r => SimpleTest.executeSoon(r));
@@ -137,37 +134,16 @@ function runTests() {
     await popupshown;
 
     popuphidden = waitForPanel(panel, "popuphidden");
     menupopuphidden = waitForPanel(menupopup, "popuphidden");
     menupopup.hidePopup();
     await popuphidden;
     await menupopuphidden;
 
-    // A popup with a hidden anchor should not update
-    let anchorhidden = document.getElementById("anchorhidden");
-    popupshown = waitForPanel(panel, "popupshown");
-    panel.openPopup(anchorhidden, "after_start");
-    await popupshown;
-
-    let oldtop = panel.getBoundingClientRect().top;
-
-    // Show and adjust anchors. The panel should not update or hide due to this.
-    anchorhidden.hidden = false;
-    document.getElementById("anchorextra").hidden = true;
-    await new Promise(r => { SimpleTest.executeSoon(r); });
-
-    let newtop = panel.getBoundingClientRect().top;
-    is(panel.state, "open", "panel is still open after showing anchor");
-    is(oldtop, newtop, "panel top did not change after showing anchor");
-
-    popuphidden = waitForPanel(panel, "popuphidden");
-    panel.hidePopup();
-    await popuphidden;
-
     // The panel should no longer follow anchors.
     panel.setAttribute("followanchor", "false");
 
     let anchor4 = document.getElementById("anchor4");
     popupshown = waitForPanel(panel, "popupshown");
     panel.openPopup(anchor4, "after_start");
     await popupshown;