Bug 949380 - [Australis] Add @hidden=true initially to UITour panels. r=Unfocused
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Fri, 13 Dec 2013 23:54:04 +1300
changeset 160297 b6dab3694be22a3f0717a9c68432ffc2b0b14ccc
parent 160296 53ca707d8e7aeafeab5a8d41f2ba37f6794293cf
child 160298 c0c6d55b7cfb5c44ec1ca5677e48cf3c9eddf603
push id3956
push userbmcbride@mozilla.com
push dateFri, 13 Dec 2013 10:55:36 +0000
treeherderfx-team@b6dab3694be2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused
bugs949380
milestone29.0a1
Bug 949380 - [Australis] Add @hidden=true initially to UITour panels. r=Unfocused
browser/base/content/browser.xul
browser/modules/UITour.jsm
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -192,25 +192,27 @@
                 oncommand="StarUI.panel.hidePopup();"/>
 #endif
       </hbox>
     </panel>
 
     <!-- UI tour experience -->
     <panel id="UITourTooltip"
            type="arrow"
+           hidden="true"
            noautofocus="true"
            noautohide="true"
            align="start"
            orient="vertical"
            role="alert">
       <label id="UITourTooltipTitle" flex="1"/>
       <description id="UITourTooltipDescription" flex="1"/>
     </panel>
     <panel id="UITourHighlightContainer"
+           hidden="true"
            noautofocus="true"
            noautohide="true"
            consumeoutsideclicks="false">
       <box id="UITourHighlight"></box>
     </panel>
 
     <panel id="socialActivatedNotification"
            type="arrow"
--- a/browser/modules/UITour.jsm
+++ b/browser/modules/UITour.jsm
@@ -459,16 +459,17 @@ this.UITour = {
       if (effect == "random") {
         // Exclude "random" from the randomly selected effects.
         let randomEffect = 1 + Math.floor(Math.random() * (this.highlightEffects.length - 1));
         if (randomEffect == this.highlightEffects.length)
           randomEffect--; // On the order of 1 in 2^62 chance of this happening.
         effect = this.highlightEffects[randomEffect];
       }
       highlighter.setAttribute("active", effect);
+      highlighter.parentElement.hidden = false;
 
       let targetRect = aTargetEl.getBoundingClientRect();
 
       highlighter.style.height = targetRect.height + "px";
       highlighter.style.width = targetRect.width + "px";
 
       // Close a previous highlight so we can relocate the panel.
       if (highlighter.parentElement.state == "open") {
@@ -509,26 +510,25 @@ this.UITour = {
     function showInfoPanel(aAnchorEl) {
       aAnchorEl.focus();
 
       let document = aAnchorEl.ownerDocument;
       let tooltip = document.getElementById("UITourTooltip");
       let tooltipTitle = document.getElementById("UITourTooltipTitle");
       let tooltipDesc = document.getElementById("UITourTooltipDescription");
 
-      tooltip.hidePopup();
+      if (tooltip.state == "open") {
+        tooltip.hidePopup();
+      }
 
       tooltipTitle.textContent = aTitle;
       tooltipDesc.textContent = aDescription;
 
+      tooltip.hidden = false;
       let alignment = "bottomcenter topright";
-
-      if (tooltip.state == "open") {
-        tooltip.hidePopup();
-      }
       tooltip.openPopup(aAnchorEl, alignment);
     }
 
     this._setAppMenuStateForAnnotation(aAnchor.node.ownerDocument.defaultView, "info",
                                        this.targetIsInAppMenu(aAnchor),
                                        showInfoPanel.bind(this, aAnchor.node));
   },