Bug 1001234, disable arrow panel animation on linux, r=dao, a=sylvestre
authorNeil Deakin <neil@mozilla.com>
Fri, 09 May 2014 08:36:30 -0400
changeset 199116 2c1d788a824b082677927e7f7e7e2b04fcc64683
parent 199115 e9378a757f746c60f649b4a6788414451877dcb9
child 199117 2ee9cf2caf42eb07c968be8f2b97dd0351c0e642
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, sylvestre
bugs1001234
milestone31.0a2
Bug 1001234, disable arrow panel animation on linux, r=dao, a=sylvestre
browser/base/content/browser.css
layout/xul/nsXULPopupManager.cpp
toolkit/content/jar.mn
toolkit/content/tests/chrome/test_arrowpanel.xul
toolkit/content/xul.css
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -930,23 +930,28 @@ chatbox:-moz-full-screen-ancestor > .cha
 }
 
 /* Give this menupopup an arrow panel styling */
 #BMB_bookmarksPopup {
   -moz-appearance: none;
   -moz-binding: url("chrome://browser/content/places/menu.xml#places-popup-arrow");
   background: transparent;
   border: none;
+  /* The popup inherits -moz-image-region from the button, must reset it */
+  -moz-image-region: auto;
+}
+
+%ifndef MOZ_WIDGET_GTK
+
+#BMB_bookmarksPopup {
   transform: scale(.7);
   opacity: 0;
   transition-property: transform, opacity;
   transition-duration: 0.15s;
   transition-timing-function: ease;
-  /* The popup inherits -moz-image-region from the button, must reset it */
-  -moz-image-region: auto;
 }
 
 #BMB_bookmarksPopup[animate="open"] {
   transform: none;
   opacity: 1.0;
 }
 
 #BMB_bookmarksPopup[arrowposition="after_start"] {
@@ -970,16 +975,17 @@ chatbox:-moz-full-screen-ancestor > .cha
   transform: scale(.7) skew(30deg, 20deg);
 }
 
 #BMB_bookmarksPopup[arrowposition="after_end"][animate="cancel"],
 #BMB_bookmarksPopup[arrowposition="before_start"][animate="cancel"] {
   transform: scale(.7) skew(-30deg, -20deg);
 }
 
+%endif
 
 /* Customize mode */
 #navigator-toolbox,
 #browser-bottombox,
 #content-deck {
   transition-property: margin-left, margin-right;
   transition-duration: 200ms;
   transition-timing-function: linear;
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -1375,33 +1375,37 @@ nsXULPopupManager::FirePopupHidingEvent(
     }
     else {
       // If the popup has an animate attribute and it is not set to false, assume
       // that it has a closing transition and wait for it to finish. The transition
       // may still occur either way, but the view will be hidden and you won't be
       // able to see it. If there is a next popup, indicating that mutliple popups
       // are rolling up, don't wait and hide the popup right away since the effect
       // would likely be undesirable. This also does a quick check to see if the
-      // popup has a transition defined, and skips the wait if not.
+      // popup has a transition defined, and skips the wait if not. Transitions
+      // are currently disabled on Linux due to rendering issues on certain
+      // configurations.
+#ifndef MOZ_WIDGET_GTK
       if (!aNextPopup && aPopup->HasAttr(kNameSpaceID_None, nsGkAtoms::animate) &&
           popupFrame->StyleDisplay()->mTransitionPropertyCount > 0) {
         nsAutoString animate;
         aPopup->GetAttr(kNameSpaceID_None, nsGkAtoms::animate, animate);
 
         // If animate="false" then don't transition at all. If animate="cancel",
         // only show the transition if cancelling the popup or rolling up.
         // Otherwise, always show the transition.
         if (!animate.EqualsLiteral("false") &&
             (!animate.EqualsLiteral("cancel") || aIsRollup)) {
           nsCOMPtr<TransitionEnder> ender = new TransitionEnder(aPopup, aDeselectMenu);
           aPopup->AddSystemEventListener(NS_LITERAL_STRING("transitionend"),
                                          ender, false, false);
           return;
         }
       }
+#endif
 
       HidePopupCallback(aPopup, popupFrame, aNextPopup, aLastPopup,
                         aPopupType, aDeselectMenu);
     }
   }
 }
 
 bool
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -69,17 +69,17 @@ toolkit.jar:
 *+ content/global/bindings/findbar.xml         (widgets/findbar.xml)
    content/global/bindings/general.xml         (widgets/general.xml)
    content/global/bindings/groupbox.xml        (widgets/groupbox.xml)
 *+ content/global/bindings/listbox.xml         (widgets/listbox.xml)
    content/global/bindings/menu.xml            (widgets/menu.xml)
    content/global/bindings/menulist.xml        (widgets/menulist.xml)
    content/global/bindings/notification.xml    (widgets/notification.xml)
    content/global/bindings/numberbox.xml       (widgets/numberbox.xml)
-   content/global/bindings/popup.xml           (widgets/popup.xml)
+*  content/global/bindings/popup.xml           (widgets/popup.xml)
 *+ content/global/bindings/preferences.xml     (widgets/preferences.xml)
    content/global/bindings/progressmeter.xml   (widgets/progressmeter.xml)
    content/global/bindings/radio.xml           (widgets/radio.xml)
    content/global/bindings/remote-browser.xml  (widgets/remote-browser.xml)
    content/global/bindings/resizer.xml         (widgets/resizer.xml)
    content/global/bindings/richlistbox.xml     (widgets/richlistbox.xml)
    content/global/bindings/scale.xml           (widgets/scale.xml)
    content/global/bindings/scrollbar.xml       (widgets/scrollbar.xml)
--- a/toolkit/content/tests/chrome/test_arrowpanel.xul
+++ b/toolkit/content/tests/chrome/test_arrowpanel.xul
@@ -171,33 +171,37 @@ function nextTest()
     $("bottomleft").setAttribute("right", "15");
     $("bottomright").setAttribute("left", "15");
     $("topleft").removeAttribute("left");
     $("topright").removeAttribute("right");
     $("bottomleft").removeAttribute("left");
     $("bottomright").removeAttribute("right");
   }
 
-  var transitions = 0;
-  function transitionEnded(event) {
-    transitions++;
-    // Two properties transition so continue on the second one finishing.
-    if (!(transitions % 2)) {
-      SimpleTest.executeSoon(() => runNextTest.next());
+  // Test that a transition occurs when opening or closing the popup. The transition is
+  // disabled on Linux.
+  if (navigator.platform.indexOf("Linux") == -1) {
+    var transitions = 0;
+    function transitionEnded(event) {
+      transitions++;
+      // Two properties transition so continue on the second one finishing.
+      if (!(transitions % 2)) {
+        SimpleTest.executeSoon(() => runNextTest.next());
+      }
     }
-  }
 
-  // Check that the transition occurs for an arrow panel with animate="true"
-  window.addEventListener("transitionend", transitionEnded, false);
-  $("animatepanel").openPopup($("topleft"), "after_start", 0, 0, false, false, null, "start");
-  yield;
-  window.removeEventListener("transitionend", transitionEnded, false);
-  synthesizeKey("VK_ESCAPE", { });
-  ok(!animatedPopupHidden, "animated popup not hidden yet");
-  yield;
+    // Check that the transition occurs for an arrow panel with animate="true"
+    window.addEventListener("transitionend", transitionEnded, false);
+    $("animatepanel").openPopup($("topleft"), "after_start", 0, 0, false, false, null, "start");
+    yield;
+    window.removeEventListener("transitionend", transitionEnded, false);
+    synthesizeKey("VK_ESCAPE", { });
+    ok(!animatedPopupHidden, "animated popup not hidden yet");
+    yield;
+  }
 
   SimpleTest.finish()
   yield;
 }
 
 function setScale(win, scale)
 {
   var wn = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -421,16 +421,18 @@ tooltip {
   white-space: pre-wrap;
   margin-top: 21px;
 }
 
 panel[type="arrow"] {
   -moz-binding: url("chrome://global/content/bindings/popup.xml#arrowpanel");
 }
 
+%ifndef MOZ_WIDGET_GTK
+
 panel[type="arrow"]:not([animate="false"]) {
   transform: scale(.7);
   opacity: 0;
   transition-property: transform, opacity;
   transition-duration: 0.15s;
   transition-timing-function: ease;
 }
 
@@ -480,16 +482,18 @@ panel[arrowposition="start_after"][anima
 
 panel[arrowposition="after_end"][animate="cancel"],
 panel[arrowposition="before_start"][animate="cancel"],
 panel[arrowposition="start_before"][animate="cancel"],
 panel[arrowposition="end_after"][animate="cancel"] {
   transform: scale(.7) skew(-10deg, -10deg);
 }
 
+%endif
+
 %ifdef XP_MACOSX
 .statusbar-resizerpanel {
   display: none;
 }
 %else
 window[sizemode="maximized"] statusbarpanel.statusbar-resizerpanel {
   visibility: collapse;
 }