Bug 684534 - Apply workaround to all arrow panels to prevent flickering when reopening certain panels. r=enndeakin
authorDão Gottwald <dao@mozilla.com>
Tue, 26 Jun 2012 00:17:45 +0200
changeset 102900 e670f4596c3705e9179f97514621a83d51e47df3
parent 102899 75c9e54e17f2bb789e6215a0a21110cceb7abd31
child 102901 2bb22a2cbd33ac68940ab24acae8fa7a84f4349a
push id191
push userlsblakk@mozilla.com
push dateFri, 05 Oct 2012 17:12:53 +0000
treeherdermozilla-release@ddb22ac6c03b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenndeakin
bugs684534
milestone16.0a1
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
Bug 684534 - Apply workaround to all arrow panels to prevent flickering when reopening certain panels. r=enndeakin
toolkit/content/widgets/popup.xml
--- a/toolkit/content/widgets/popup.xml
+++ b/toolkit/content/widgets/popup.xml
@@ -462,19 +462,27 @@
           this.hidePopup();
           this.style.removeProperty("opacity");
         }
       ]]>
       </handler>
       <handler event="popupshown" phase="target">
         this.setAttribute("panelopen", "true");
       </handler>
-      <handler event="popuphidden" phase="target">
+      <handler event="popuphidden" phase="target"><![CDATA[
         this.removeAttribute("panelopen");
-      </handler>
+
+        if (this.state == "closed") {
+          // Destroy the widget to prevent the current state from being rendered
+          // briefly when the panel reopens.
+          this.hidden = true;
+          this.clientHeight; // flush layout
+          this.hidden = false;
+        }
+      ]]></handler>
     </handlers>
   </binding>
 
   <binding id="tooltip" extends="chrome://global/content/bindings/popup.xml#popup-base">
     <content>
       <children>
         <xul:label class="tooltip-label" xbl:inherits="xbl:text=label" flex="1"/>
       </children>